当前位置: 首页>>代码示例>>C++>>正文


C++ EFXFixture::setLsbTiltChannel方法代码示例

本文整理汇总了C++中EFXFixture::setLsbTiltChannel方法的典型用法代码示例。如果您正苦于以下问题:C++ EFXFixture::setLsbTiltChannel方法的具体用法?C++ EFXFixture::setLsbTiltChannel怎么用?C++ EFXFixture::setLsbTiltChannel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EFXFixture的用法示例。


在下文中一共展示了EFXFixture::setLsbTiltChannel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: nextStepSingleShot

void EFXFixture_Test::nextStepSingleShot()
{
    QByteArray array;

    EFX e(m_doc);
    e.slotBusValueChanged(e.busID(), 50); /* 50 steps */
    e.pointFunc = e.circlePoint;
    e.setRunOrder(EFX::SingleShot);

    EFXFixture* ef = new EFXFixture(&e);
    ef->setFixture(0);
    e.addFixture(ef);

    /* Nothing should happen since isValid() == false */
    ef->nextStep(&array);
    QVERIFY(array.size() == 0);

    /* Initialize the EFXFixture so that it can do math */
    ef->setSerialNumber(0);
    ef->setMsbPanChannel(0);
    ef->setMsbTiltChannel(1);
    ef->setLsbPanChannel(2);
    ef->setLsbTiltChannel(3);
    QVERIFY(ef->isValid() == true);
    QVERIFY(ef->m_initialized == false);
    QVERIFY(ef->m_iterator == 0);

    ef->reset();

    /* Run one cycle (50 steps) and reset the checking iterator in
       the middle to expect correct iterator values. */
    qreal checkIter = 0;
    for (int i = 0; i < 50; i++)
    {
        ef->nextStep(&array);
        checkIter += e.m_stepSize;
        QVERIFY(ef->m_initialized == true);
        QVERIFY(ef->m_iterator == checkIter);
        QVERIFY(ef->isReady() == false);
    }

    ef->nextStep(&array);

    /* Single-shot EFX should now be ready */
    QVERIFY(ef->isReady() == true);
}
开发者ID:speakman,项目名称:qlc,代码行数:46,代码来源:efxfixture_test.cpp

示例2: nextStepLoop

void EFXFixture_Test::nextStepLoop()
{
    QByteArray array;

    EFX e(m_doc);
    e.slotBusValueChanged(e.busID(), 50); /* 50 steps */
    e.pointFunc = e.circlePoint;

    EFXFixture* ef = new EFXFixture(&e);
    ef->setFixture(0);
    e.addFixture(ef);

    /* Nothing should happen since isValid() == false */
    ef->nextStep(&array);
    QVERIFY(array.size() == 0);

    /* Initialize the EFXFixture so that it can do math */
    ef->setSerialNumber(0);
    ef->setMsbPanChannel(0);
    ef->setMsbTiltChannel(1);
    ef->setLsbPanChannel(2);
    ef->setLsbTiltChannel(3);
    QVERIFY(ef->isValid() == true);
    QVERIFY(ef->m_initialized == false);
    QVERIFY(ef->m_iterator == 0);

    /* Run two cycles (2 * 50 = 100) and reset the checking iterator in
       the middle to expect correct iterator values. */
    qreal checkIter = 0;
    for (int i = 0; i < 100; i++)
    {
        ef->nextStep(&array);
        checkIter += e.m_stepSize;
        if (i == 50)
            checkIter = 0;
        QVERIFY(ef->m_iterator == checkIter);
        QVERIFY(ef->m_initialized == true);
        QVERIFY(ef->isReady() == false); // Loop is never ready
    }
}
开发者ID:speakman,项目名称:qlc,代码行数:40,代码来源:efxfixture_test.cpp

示例3: arm

void EFX::arm()
{
	class Scene* startScene = NULL;
	class Scene* stopScene = NULL;
	QLCFixtureMode* mode = NULL;
	QLCChannel* ch = NULL;
	int serialNumber = 0;
	Fixture* fxi = NULL;

	/* Initialization scene */
	if (m_startSceneID != KNoID && m_startSceneEnabled == true)
		startScene = static_cast <class Scene*>
			(_app->doc()->function(m_startSceneID));

	/* De-initialization scene */
	if (m_stopSceneID != KNoID && m_stopSceneEnabled == true)
		stopScene = static_cast <class Scene*>
			(_app->doc()->function(m_stopSceneID));

	QListIterator <EFXFixture*> it(m_fixtures);
	while (it.hasNext() == true)
	{
		EFXFixture* ef = it.next();
		Q_ASSERT(ef != NULL);

		ef->setSerialNumber(serialNumber++);
		ef->setStartScene(startScene);
		ef->setStopScene(stopScene);

		/* If fxi == NULL, the fixture has been destroyed */
		fxi = _app->doc()->fixture(ef->fixture());
		if (fxi == NULL)
			continue;

		/* If this fixture has no mode, it's a generic dimmer that
		   can't do pan&tilt anyway. */
		mode = fxi->fixtureMode();
		if (mode == NULL)
			continue;

		/* Find exact channel numbers for MSB/LSB pan and tilt */
		for (t_channel i = 0; i < mode->channels(); i++)
		{
			ch = mode->channel(i);
			Q_ASSERT(ch != NULL);

			if (ch->group() == KQLCChannelGroupPan)
			{
				if (ch->controlByte() == 0)
				{
					ef->setMsbPanChannel(
						fxi->universeAddress() + i);
				}
				else if (ch->controlByte() == 1)
				{
					ef->setLsbPanChannel(
						fxi->universeAddress() + i);
				}
			}
			else if (ch->group() == KQLCChannelGroupTilt)
			{
				if (ch->controlByte() == 0)
				{
					ef->setMsbTiltChannel(
						fxi->universeAddress() + i);
				}
				else if (ch->controlByte() == 1)
				{
					ef->setLsbTiltChannel(
						fxi->universeAddress() + i);
				}
			}
		}
	}

	/* Choose a point calculation function depending on the algorithm */
	if (m_algorithm == KCircleAlgorithmName)
		pointFunc = circlePoint;
	else if (m_algorithm == KEightAlgorithmName)
		pointFunc = eightPoint;
	else if (m_algorithm == KLineAlgorithmName)
		pointFunc = linePoint;
	else if (m_algorithm == KTriangleAlgorithmName)
		pointFunc = trianglePoint;
	else if (m_algorithm == KDiamondAlgorithmName)
		pointFunc = diamondPoint;
	else if (m_algorithm == KLissajousAlgorithmName)
		pointFunc = lissajousPoint;
	else
		pointFunc = NULL;
}
开发者ID:,项目名称:,代码行数:91,代码来源:


注:本文中的EFXFixture::setLsbTiltChannel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。