本文整理汇总了C++中QLCFixtureDef::setModel方法的典型用法代码示例。如果您正苦于以下问题:C++ QLCFixtureDef::setModel方法的具体用法?C++ QLCFixtureDef::setModel怎么用?C++ QLCFixtureDef::setModel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QLCFixtureDef
的用法示例。
在下文中一共展示了QLCFixtureDef::setModel方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: name
void QLCFixtureDef_Test::name()
{
QLCFixtureDef* fd = new QLCFixtureDef();
fd->setManufacturer("Martin");
fd->setModel("MAC600");
QVERIFY(fd->name() == "Martin MAC600");
delete fd;
}
示例2: model
void QLCFixtureDef_Test::model()
{
QLCFixtureDef* fd = new QLCFixtureDef();
fd->setModel("MAC600");
QVERIFY(fd->model() == "MAC600");
QVERIFY(fd->name() == " MAC600");
delete fd;
}
示例3: loadMapManufacturer
int QLCFixtureDefCache::loadMapManufacturer(QXmlStreamReader *doc, QString manufacturer)
{
int count = 0;
QString spacedManufacturer = manufacturer;
spacedManufacturer.replace("_", " ");
while (doc->readNextStartElement())
{
if (doc->name() == "F")
{
QString defFile = "";
QString model = "";
if (doc->attributes().hasAttribute("n"))
{
defFile = QString("%1%2%3%4")
.arg(manufacturer).arg(QDir::separator())
.arg(doc->attributes().value("n").toString()).arg(KExtFixture);
//qDebug() << "Manufacturer" << spacedManufacturer << "file" << defFile;
}
if (doc->attributes().hasAttribute("m"))
model = doc->attributes().value("m").toString();
if (defFile.isEmpty() == false &&
spacedManufacturer.isEmpty() == false &&
model.isEmpty() == false)
{
QLCFixtureDef *fxi = new QLCFixtureDef();
Q_ASSERT(fxi != NULL);
fxi->setDefinitionSourceFile(defFile);
fxi->setManufacturer(spacedManufacturer);
fxi->setModel(model);
/* Delete the def if it's a duplicate. */
if (addFixtureDef(fxi) == false)
delete fxi;
fxi = NULL;
count++;
}
}
else
{
qWarning() << Q_FUNC_INFO << "Unknown manufacturer tag: " << doc->name();
}
doc->skipCurrentElement();
}
return count;
}
示例4: QLCFixtureDef
QLCFixtureDef *Fixture::genericDimmerDef(int channels)
{
QLCFixtureDef *def = new QLCFixtureDef();
def->setManufacturer(KXMLFixtureGeneric);
def->setModel(KXMLFixtureGeneric);
def->setType(QLCFixtureDef::Dimmer);
def->setAuthor("QLC+");
for (int i = 0; i < channels; i++)
{
QLCChannel *intensity = new QLCChannel();
intensity->setGroup(QLCChannel::Intensity);
intensity->setName(tr("Dimmer #%1").arg(i + 1));
intensity->addCapability(new QLCCapability(0, UCHAR_MAX, tr("Intensity")));
def->addChannel(intensity);
}
return def;
}
示例5: saveLoadXML
void QLCFixtureDef_Test::saveLoadXML()
{
const QString path("qlcfixturedef_test_saveXML.qxf");
QLCFixtureDef* def = new QLCFixtureDef;
def->setManufacturer("Foobar");
def->setModel("Xyzzy");
def->setType("Blinder");
QLCChannel* ch = new QLCChannel;
ch->setName("Whatever");
def->addChannel(ch);
QLCFixtureMode* mode = new QLCFixtureMode(def);
mode->setName("Barfoo");
def->addMode(mode);
mode->insertChannel(ch, 0);
QVERIFY(def->saveXML(QString("zxcvb:/path/to/nowhere") + path) != QFile::NoError);
QCOMPARE(def->saveXML(path), QFile::NoError);
// Test only QLCFixtureDef's doings and don't go into channel/mode details
// since they are tested in their individual unit tests.
QLCFixtureDef* def2 = new QLCFixtureDef;
QCOMPARE(def2->loadXML(QString()), QFile::OpenError);
QCOMPARE(def2->loadXML("/path/beyond/this/universe/foo.qxf"), QFile::ReadError);
QCOMPARE(def2->loadXML("readonly.xml"), QFile::ReadError);
QCOMPARE(def2->loadXML(path), QFile::NoError);
QCOMPARE(def2->manufacturer(), def->manufacturer());
QCOMPARE(def2->model(), def->model());
QCOMPARE(def2->channels().size(), 1);
QCOMPARE(def2->channels().at(0)->name(), ch->name());
QCOMPARE(def2->modes().size(), 1);
QCOMPARE(def2->modes().at(0)->name(), mode->name());
delete def;
delete def2;
QFile::remove(path);
QVERIFY(QFile::exists(path) == false);
}
示例6: 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;
}
示例7: add
void QLCFixtureDefCache_Test::add()
{
QVERIFY(cache.addFixtureDef(NULL) == false);
QVERIFY(cache.manufacturers().count() != 0);
cache.clear();
QVERIFY(cache.manufacturers().count() == 0);
/* Add the first fixtureDef */
QLCFixtureDef* def = new QLCFixtureDef();
def->setManufacturer("Martin");
def->setModel("MAC250");
QVERIFY(cache.addFixtureDef(def) == true);
QVERIFY(cache.manufacturers().count() == 1);
QVERIFY(cache.manufacturers().contains("Martin") == true);
QVERIFY(cache.manufacturers().contains("MAC250") == false);
QVERIFY(cache.models("Martin").count() == 1);
QVERIFY(cache.models("Martin").contains("MAC250") == true);
QVERIFY(cache.models("Foo").count() == 0);
/* Another fixtureDef, same manufacturer & model. Should be ignored. */
QLCFixtureDef* def2 = new QLCFixtureDef();
def2->setManufacturer("Martin");
def2->setModel("MAC250");
QVERIFY(cache.addFixtureDef(def2) == false);
QVERIFY(cache.manufacturers().count() == 1);
QVERIFY(cache.manufacturers().contains("Martin") == true);
delete def2;
def2 = NULL;
/* Another fixtureDef, same manufacturer, different model */
def2 = new QLCFixtureDef();
def2->setManufacturer("Martin");
def2->setModel("MAC500");
QVERIFY(cache.addFixtureDef(def2) == true);
QVERIFY(cache.manufacturers().count() == 1);
QVERIFY(cache.manufacturers().contains("Martin") == true);
QVERIFY(cache.manufacturers().contains("MAC500") == false);
QVERIFY(cache.models("Martin").count() == 2);
QVERIFY(cache.models("Martin").contains("MAC250") == true);
QVERIFY(cache.models("Martin").contains("MAC500") == true);
/* Another fixtureDef, different manufacturer, different model */
QLCFixtureDef* def3 = new QLCFixtureDef();
def3->setManufacturer("Futurelight");
def3->setModel("PHS700");
QVERIFY(cache.addFixtureDef(def3) == true);
QVERIFY(cache.manufacturers().count() == 2);
QVERIFY(cache.manufacturers().contains("Martin") == true);
QVERIFY(cache.manufacturers().contains("Futurelight") == true);
QVERIFY(cache.manufacturers().contains("PHS700") == false);
/* Another fixtureDef, different manufacturer, same model */
QLCFixtureDef* def4 = new QLCFixtureDef();
def4->setManufacturer("Yoyodyne");
def4->setModel("MAC250");
QVERIFY(cache.addFixtureDef(def4) == true);
QVERIFY(cache.manufacturers().count() == 3);
QVERIFY(cache.manufacturers().contains("Martin") == true);
QVERIFY(cache.manufacturers().contains("Futurelight") == true);
QVERIFY(cache.manufacturers().contains("Yoyodyne") == true);
QVERIFY(cache.manufacturers().contains("MAC250") == false);
QVERIFY(cache.models("Yoyodyne").count() == 1);
QVERIFY(cache.models("Yoyodyne").contains("MAC250") == true);
}
示例8: if
QLCFixtureDef *Fixture::genericRGBPanelDef(int columns, Components components)
{
QLCFixtureDef *def = new QLCFixtureDef();
def->setManufacturer(KXMLFixtureGeneric);
def->setModel(KXMLFixtureRGBPanel);
def->setType("LED Bar");
def->setAuthor("QLC+");
for (int i = 0; i < columns; i++)
{
QLCChannel* red = new QLCChannel();
red->setName(QString("Red %1").arg(i + 1));
red->setGroup(QLCChannel::Intensity);
red->setColour(QLCChannel::Red);
QLCChannel* green = new QLCChannel();
green->setName(QString("Green %1").arg(i + 1));
green->setGroup(QLCChannel::Intensity);
green->setColour(QLCChannel::Green);
QLCChannel* blue = new QLCChannel();
blue->setName(QString("Blue %1").arg(i + 1));
blue->setGroup(QLCChannel::Intensity);
blue->setColour(QLCChannel::Blue);
if (components == BGR)
{
def->addChannel(blue);
def->addChannel(green);
def->addChannel(red);
}
else if (components == RGBW)
{
QLCChannel* white = new QLCChannel();
white->setName(QString("White %1").arg(i + 1));
white->setGroup(QLCChannel::Intensity);
white->setColour(QLCChannel::White);
def->addChannel(red);
def->addChannel(green);
def->addChannel(blue);
def->addChannel(white);
}
else if (components == RGBWW)
{
QLCChannel* white = new QLCChannel();
white->setName(QString("Warm White %1").arg(i + 1));
white->setGroup(QLCChannel::Intensity);
white->setColour(QLCChannel::White);
QLCChannel* white2 = new QLCChannel();
white2->setName(QString("Cold White %1").arg(i + 1));
white2->setGroup(QLCChannel::Intensity);
white2->setColour(QLCChannel::White);
def->addChannel(red);
def->addChannel(green);
def->addChannel(blue);
def->addChannel(white);
def->addChannel(white2);
}
else
{
def->addChannel(red);
def->addChannel(green);
def->addChannel(blue);
}
}
return def;
}