本文整理汇总了C++中QLCFixtureDef::channels方法的典型用法代码示例。如果您正苦于以下问题:C++ QLCFixtureDef::channels方法的具体用法?C++ QLCFixtureDef::channels怎么用?C++ QLCFixtureDef::channels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QLCFixtureDef
的用法示例。
在下文中一共展示了QLCFixtureDef::channels方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeChannel
void QLCFixtureDef_Test::removeChannel()
{
QLCFixtureDef* fd = new QLCFixtureDef();
QLCChannel* ch1 = new QLCChannel();
QLCChannel* ch2 = new QLCChannel();
QVERIFY(fd->channels().size() == 0);
QVERIFY(fd->removeChannel(NULL) == false);
QVERIFY(fd->removeChannel(ch1) == false);
QVERIFY(fd->removeChannel(ch2) == false);
fd->addChannel(ch1);
fd->addChannel(ch2);
QVERIFY(fd->channels().size() == 2);
QVERIFY(fd->removeChannel(ch1) == true);
QVERIFY(fd->channels().size() == 1);
QVERIFY(fd->channels().at(0) == ch2);
QVERIFY(fd->removeChannel(ch1) == false);
QVERIFY(fd->channels().size() == 1);
QVERIFY(fd->channels().at(0) == ch2);
QVERIFY(fd->removeChannel(NULL) == false);
QVERIFY(fd->channels().size() == 1);
QVERIFY(fd->channels().at(0) == ch2);
QVERIFY(fd->removeChannel(ch2) == true);
QVERIFY(fd->channels().size() == 0);
delete fd;
}
示例2: copy
void QLCFixtureDef_Test::copy()
{
QLCFixtureDef* fd = new QLCFixtureDef();
fd->setManufacturer("Martin");
fd->setModel("MAC600");
fd->setType("Moving Head");
QLCChannel* ch = new QLCChannel();
ch->setName("TestChannel");
fd->addChannel(ch);
QLCFixtureMode* mode = new QLCFixtureMode(fd);
mode->setName("TestMode");
fd->addMode(mode);
mode->insertChannel(ch, 0);
QLCFixtureDef* copy = new QLCFixtureDef(fd);
QVERIFY(copy->manufacturer() == "Martin");
QVERIFY(copy->model() == "MAC600");
QVERIFY(copy->type() == "Moving Head");
/* Verify that modes and channels get copied and that the channels in
the copied mode are from the copied fixtureDef and not the one that
the copy is taken FROM. */
QVERIFY(copy->channels().at(0)->name() == "TestChannel");
QVERIFY(copy->modes().at(0)->name() == "TestMode");
QVERIFY(copy->modes().at(0)->channels().size() == 1);
QVERIFY(copy->modes().size() == 1);
QVERIFY(copy->modes().at(0)->channel(0) != ch);
QVERIFY(copy->modes().at(0)->channel(0) == copy->channels().at(0));
QVERIFY(copy->channels().at(0)->name() == "TestChannel");
QVERIFY(copy->modes().at(0)->channel(0)->name() == "TestChannel");
delete fd;
delete copy;
}
示例3: channels
void QLCFixtureDef_Test::channels()
{
QLCFixtureDef* fd = new QLCFixtureDef();
QLCChannel* ch1 = new QLCChannel();
QLCChannel* ch2 = new QLCChannel();
QLCChannel* ch3 = new QLCChannel();
QVERIFY(fd->channels().size() == 0);
fd->addChannel(ch1);
QVERIFY(fd->channels().size() == 1);
QVERIFY(fd->channels().at(0) == ch1);
fd->addChannel(ch2);
QVERIFY(fd->channels().size() == 2);
QVERIFY(fd->channels().at(0) == ch1);
QVERIFY(fd->channels().at(1) == ch2);
fd->addChannel(ch3);
QVERIFY(fd->channels().size() == 3);
QVERIFY(fd->channels().at(0) == ch1);
QVERIFY(fd->channels().at(1) == ch2);
QVERIFY(fd->channels().at(2) == ch3);
delete fd;
}
示例4: initialScanner
void AddFixture_Test::initialScanner()
{
Fixture* fxi = new Fixture(m_doc);
fxi->setName("My scanner");
QLCFixtureDef* def = m_doc->fixtureDefCache()->fixtureDef("Martin", "MAC300");
Q_ASSERT(def != NULL);
Q_ASSERT(def != NULL);
Q_ASSERT(def->channels().size() > 0);
QLCFixtureMode* mode = def->modes().first();
Q_ASSERT(def->modes().size() > 1);
fxi->setFixtureDefinition(def, mode);
fxi->setUniverse(2);
fxi->setAddress(484);
m_doc->addFixture(fxi);
AddFixture af(NULL, m_doc, fxi);
QVERIFY(m_doc == af.m_doc);
QVERIFY(af.fixtureDef() == def);
QVERIFY(af.mode() == mode);
QVERIFY(af.name() == QString("My scanner"));
QVERIFY(af.address() == 484);
QVERIFY(af.universe() == 2);
QVERIFY(af.amount() == 1);
QVERIFY(af.gap() == 0);
QVERIFY(af.channels() == fxi->channels());
// Check that all makes & models are put to the tree
QStringList makers(m_doc->fixtureDefCache()->manufacturers());
QVERIFY(makers.isEmpty() == false);
for (int i = 0; i < af.m_tree->topLevelItemCount(); i++)
{
QTreeWidgetItem* top = af.m_tree->topLevelItem(i);
if (top->text(0) != KXMLFixtureGeneric)
{
QStringList models(m_doc->fixtureDefCache()->models(top->text(0)));
for (int j = 0; j < top->childCount(); j++)
{
QTreeWidgetItem* child = top->child(j);
QCOMPARE(child->childCount(), 0);
QCOMPARE(models.removeAll(child->text(0)), 1);
}
QCOMPARE(makers.removeAll(top->text(0)), 1);
}
else
{
QCOMPARE(i, af.m_tree->topLevelItemCount() - 1); // Generic should be last
QCOMPARE(top->childCount(), 3);
QCOMPARE(top->child(0)->text(0), QString(KXMLFixtureGeneric));
QStringList models(m_doc->fixtureDefCache()->models(top->text(0)));
for (int j = 0; j < top->childCount(); j++)
{
QTreeWidgetItem* child = top->child(j);
QCOMPARE(child->childCount(), 0);
QCOMPARE(models.removeAll(child->text(0)), child->text(0) == KXMLFixtureGeneric ? 0 : 1);
}
QCOMPARE(makers.removeAll(top->text(0)), 1);
}
}
QVERIFY(makers.isEmpty() == true);
// Generic / Generic should be selected for dimmers
QVERIFY(af.m_tree->currentItem() != NULL);
QCOMPARE(af.m_tree->currentItem()->text(0), def->model());
QVERIFY(af.m_tree->currentItem()->parent() != NULL);
QCOMPARE(af.m_tree->currentItem()->parent()->text(0), def->manufacturer());
QVERIFY(af.m_modeCombo->isEnabled() == true);
QCOMPARE(af.m_modeCombo->count(), def->modes().size());
QCOMPARE(af.m_modeCombo->itemText(0), mode->name());
QVERIFY(af.m_universeCombo->isEnabled() == true);
QCOMPARE(af.m_universeCombo->currentIndex(), 2);
QCOMPARE(af.m_universeCombo->count(), 4);
QVERIFY(af.m_addressSpin->isEnabled() == true);
QCOMPARE(af.m_addressSpin->value(), 485);
QVERIFY(af.m_channelsSpin->isEnabled() == false);
QCOMPARE(af.m_channelsSpin->value(), (int) fxi->channels());
QVERIFY(af.m_nameEdit->isEnabled() == true);
QCOMPARE(af.m_nameEdit->text(), QString("My scanner"));
QVERIFY(af.m_nameEdit->isModified() == true);
QVERIFY(af.m_multipleGroup->isEnabled() == false);
QVERIFY(af.m_gapSpin->isEnabled() == false);
QCOMPARE(af.m_gapSpin->value(), 0);
QVERIFY(af.m_amountSpin->isEnabled() == false);
QCOMPARE(af.m_amountSpin->value(), 1);
}