本文整理汇总了C++中EFXFixture::reset方法的典型用法代码示例。如果您正苦于以下问题:C++ EFXFixture::reset方法的具体用法?C++ EFXFixture::reset怎么用?C++ EFXFixture::reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EFXFixture
的用法示例。
在下文中一共展示了EFXFixture::reset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: nextStepSingleShot
void EFXFixture_Test::nextStepSingleShot()
{
QList<Universe*> ua;
ua.append(new Universe(0, new GrandMaster()));
MasterTimerStub mts(m_doc, ua);
EFX e(m_doc);
e.setDuration(1000); // 1s
e.setRunOrder(EFX::SingleShot);
EFXFixture* ef = new EFXFixture(&e);
ef->setHead(GroupHead(0,0));
e.addFixture(ef);
/* Initialize the EFXFixture so that it can do math */
ef->setSerialNumber(0);
QVERIFY(ef->isValid() == true);
QVERIFY(ef->isReady() == false);
QVERIFY(ef->m_elapsed == 0);
e.preRun(&mts);
ef->reset();
/* Run one cycle (50 steps) */
uint max = MasterTimer::tick() * MasterTimer::frequency();
for (uint i = MasterTimer::tick(); i < max; i += MasterTimer::tick())
{
ef->nextStep(&mts, ua);
QVERIFY(ef->isReady() == false);
QCOMPARE(ef->m_elapsed, i);
}
ef->nextStep(&mts, ua);
/* Single-shot EFX should now be ready */
QVERIFY(ef->isReady() == true);
e.postRun(&mts, ua);
}