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


C++ QLCFixtureDef::model方法代码示例

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


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

示例1: model

void QLCFixtureDef_Test::model()
{
    QLCFixtureDef* fd = new QLCFixtureDef();
    fd->setModel("MAC600");
    QVERIFY(fd->model() == "MAC600");
    QVERIFY(fd->name() == " MAC600");
    delete fd;
}
开发者ID:Andersbakken,项目名称:qlc-svn,代码行数:8,代码来源:qlcfixturedef_test.cpp

示例2: fillTree

void AddFixture::fillTree()
{
	QPtrListIterator <QLCFixtureDef> it(*_app->fixtureDefList());
	QLCFixtureDef* fixtureDef = NULL;
	QListViewItem* parent = NULL;
	QListViewItem* node = NULL;
	QString str;

	/* Clear the tree of any previous data */
	m_tree->clear();

	/* Add all known fixture definitions. */
	while ( (fixtureDef = *it) != NULL )
	{
		parent = NULL;

		/* Search for an existing manufacturer parent node from
		   the tree. If such is found, it will be used as the
		   parent for the current fixture. If not, the manufacturer
		   will be added as a new parent and then used for the
		   current fixture. */
		for (node = m_tree->firstChild(); node != NULL;
		     node = node->nextSibling())
		{
			if (node->text(KColumnName) == fixtureDef->manufacturer())
			{
				parent = node;
				break;
			}
		}

		/* If an existing manufacturer parent node was not found,
		   we must create one. Otherwise we use the found node
		   as the parent for the new item. */
		if (parent == NULL)
			parent = new QListViewItem(m_tree,
						   fixtureDef->manufacturer());

		/* Create a new fixture node, under the parent node */
		node = new QListViewItem(parent);
		node->setText(KColumnName, fixtureDef->model());
		node->setText(KColumnType, fixtureDef->type());

		/* Store the fixture pointer into the tree */
		str.sprintf("%d", (unsigned long) fixtureDef);
		node->setText(KColumnPointer, str);

		++it;
	}

	/* Create a node & parent for generic dimmers */
	parent = new QListViewItem(m_tree);
	parent->setText(KColumnName, KXMLFixtureGeneric);
	node = new QListViewItem(parent);
	node->setText(KColumnName, KXMLFixtureGeneric);
	node->setText(KColumnType, KXMLFixtureDimmer);
	node->setText(KColumnPointer, "0");
}
开发者ID:speakman,项目名称:qlc,代码行数:58,代码来源:addfixture.cpp

示例3: initial

void QLCFixtureDef_Test::initial()
{
    QLCFixtureDef* fd = new QLCFixtureDef();
    QVERIFY(fd->manufacturer().isEmpty());
    QVERIFY(fd->model().isEmpty());
    QVERIFY(fd->name() == " ");
    QVERIFY(fd->type() == "Dimmer");
    delete fd;
}
开发者ID:Andersbakken,项目名称:qlc-svn,代码行数:9,代码来源:qlcfixturedef_test.cpp

示例4: fixtureDef

QLCFixtureDef* QLCFixtureDefCache::fixtureDef(
    const QString& manufacturer, const QString& model) const
{
    QListIterator <QLCFixtureDef*> it(m_defs);
    while (it.hasNext() == true)
    {
        QLCFixtureDef* def = it.next();
        if (def->manufacturer() == manufacturer && def->model() == model)
        {
            def->checkLoaded(m_mapAbsolutePath);
            return def;
        }
    }

    return NULL;
}
开发者ID:exmatrikulator,项目名称:qlcplus,代码行数:16,代码来源:qlcfixturedefcache.cpp

示例5: models

QStringList QLCFixtureDefCache::models(const QString& manufacturer) const
{
    QSet <QString> models;
    QListIterator <QLCFixtureDef*> it(m_defs);
    while (it.hasNext() == true)
    {
        QLCFixtureDef* def = it.next();
        if (def->manufacturer() == manufacturer)
            models << def->model();
    }

    // Bounce the QSet into a QStringList
    QStringList list;
    foreach (QString model, models)
        list << model;

    return list;
}
开发者ID:exmatrikulator,项目名称:qlcplus,代码行数:18,代码来源:qlcfixturedefcache.cpp

示例6: 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);
}
开发者ID:Andersbakken,项目名称:qlc-svn,代码行数:41,代码来源:qlcfixturedef_test.cpp

示例7: 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;
}
开发者ID:Andersbakken,项目名称:qlc-svn,代码行数:36,代码来源:qlcfixturedef_test.cpp

示例8: 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);
}
开发者ID:ChrisLaurie,项目名称:qlcplus,代码行数:97,代码来源:addfixture_test.cpp


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