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


C++ QLCPhysical类代码示例

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


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

示例1: Q_ASSERT

QLCFixtureMode *Fixture::genericDimmerMode(QLCFixtureDef *def, int channels)
{
    Q_ASSERT(def != NULL);
    QLCFixtureMode *mode = new QLCFixtureMode(def);

    mode->setName(QString("%1 Channel").arg(channels));
    QList<QLCChannel *>chList = def->channels();
    for (int i = 0; i < chList.count(); i++)
    {
        QLCChannel *ch = chList.at(i);
        mode->insertChannel(ch, i);
        QLCFixtureHead head;
        head.addChannel(i);
        mode->insertHead(-1, head);
    }

    QLCPhysical physical;
    physical.setWidth(300 * channels);
    physical.setHeight(300);
    physical.setDepth(300);

    mode->setPhysical(physical);
    def->addMode(mode);

    return mode;
}
开发者ID:ming-hai,项目名称:qlcplus,代码行数:26,代码来源:fixture.cpp

示例2: qWarning

bool QLCFixtureMode::loadXML(const QDomElement& root)
{
    if (root.tagName() != KXMLQLCFixtureMode)
    {
        qWarning() << Q_FUNC_INFO << "Mode tag not found";
        return false;
    }

    /* Mode name */
    QString str = root.attribute(KXMLQLCFixtureModeName);
    if (str.isEmpty() == true)
    {
        qWarning() << Q_FUNC_INFO << "Mode has no name";
        return false;
    }
    else
    {
        setName(str);
    }

    /* Subtags */
    QDomNode node = root.firstChild();
    while (node.isNull() == false)
    {
        QDomElement tag = node.toElement();
        if (tag.tagName() == KXMLQLCFixtureModeChannel)
        {
            /* Channel */
            Q_ASSERT(m_fixtureDef != NULL);
            str = tag.attribute(KXMLQLCFixtureModeChannelNumber);
            insertChannel(m_fixtureDef->channel(tag.text()),
                          str.toInt());
        }
        else if (tag.tagName() == KXMLQLCFixtureHead)
        {
            /* Head */
            QLCFixtureHead head;
            if (head.loadXML(tag) == true)
                insertHead(-1, head);
        }
        else if (tag.tagName() == KXMLQLCPhysical)
        {
            /* Physical */
            QLCPhysical physical;
            physical.loadXML(tag);
            setPhysical(physical);
        }
        else
        {
            qWarning() << Q_FUNC_INFO << "Unknown Fixture Mode tag:" << tag.tagName();
        }

        node = node.nextSibling();
    }

    // Cache all head channels
    cacheHeads();

    return true;
}
开发者ID:Babbsdrebbler,项目名称:qlcplus,代码行数:60,代码来源:qlcfixturemode.cpp

示例3: fxit

int Doc::totalPowerConsumption(int& fuzzy) const
{
    int totalPowerConsumption = 0;

    // Make sure fuzzy starts from zero
    fuzzy = 0;

    QListIterator <Fixture*> fxit(fixtures());
    while (fxit.hasNext() == true)
    {
        Fixture* fxi(fxit.next());
        Q_ASSERT(fxi != NULL);

        // Generic dimmer has no mode and physical
        if (fxi->isDimmer() == false && fxi->fixtureMode() != NULL)
        {
            QLCPhysical phys = fxi->fixtureMode()->physical();
            if (phys.powerConsumption() > 0)
                totalPowerConsumption += phys.powerConsumption();
            else
                fuzzy++;
        }
        else
        {
            fuzzy++;
        }
    }

    return totalPowerConsumption;
}
开发者ID:glocklueng,项目名称:qlc,代码行数:30,代码来源:doc.cpp

示例4: qWarning

bool QLCFixtureMode::loadXML(QXmlStreamReader &doc)
{
    if (doc.name() != KXMLQLCFixtureMode)
    {
        qWarning() << Q_FUNC_INFO << "Mode tag not found";
        return false;
    }

    /* Mode name */
    QString str = doc.attributes().value(KXMLQLCFixtureModeName).toString();
    if (str.isEmpty() == true)
    {
        qWarning() << Q_FUNC_INFO << "Mode has no name";
        return false;
    }
    else
    {
        setName(str);
    }

    /* Subtags */
    while (doc.readNextStartElement())
    {
        if (doc.name() == KXMLQLCFixtureModeChannel)
        {
            /* Channel */
            Q_ASSERT(m_fixtureDef != NULL);
            str = doc.attributes().value(KXMLQLCFixtureModeChannelNumber).toString();
            insertChannel(m_fixtureDef->channel(doc.readElementText()),
                          str.toInt());
        }
        else if (doc.name() == KXMLQLCFixtureHead)
        {
            /* Head */
            QLCFixtureHead head;
            if (head.loadXML(doc) == true)
                insertHead(-1, head);
        }
        else if (doc.name() == KXMLQLCPhysical)
        {
            /* Physical */
            QLCPhysical physical;
            physical.loadXML(doc);
            setPhysical(physical);
        }
        else
        {
            qWarning() << Q_FUNC_INFO << "Unknown Fixture Mode tag:" << doc.name();
            doc.skipCurrentElement();
        }
    }

    // Cache all head channels
    cacheHeads();

    return true;
}
开发者ID:PML369,项目名称:qlcplus,代码行数:57,代码来源:qlcfixturemode.cpp

示例5: Q_ASSERT

QLCFixtureMode *Fixture::genericRGBPanelMode(QLCFixtureDef *def, Components components, quint32 width, quint32 height)
{
    Q_ASSERT(def != NULL);
    QLCFixtureMode *mode = new QLCFixtureMode(def);
    int compNum = 3;
    if (components == BGR)
    {
        mode->setName("BGR");
    }
    else if (components == RGBW)
    {
        mode->setName("RGBW");
        compNum = 4;
    }
    else if (components == RGBWW)
    {
        mode->setName("RGBWW");
        compNum = 5;
    }
    else
        mode->setName("RGB");

    QList<QLCChannel *>channels = def->channels();
    for (int i = 0; i < channels.count(); i++)
    {
        QLCChannel *ch = channels.at(i);
        mode->insertChannel(ch, i);
        if (i%compNum == 0)
        {
            QLCFixtureHead head;
            head.addChannel(i);
            head.addChannel(i+1);
            head.addChannel(i+2);
            if (components == RGBW)
                head.addChannel(i+3);
            else if (components == RGBWW)
            {
                head.addChannel(i+3);
                head.addChannel(i+4);
            }
            mode->insertHead(-1, head);
        }
    }
    QLCPhysical physical;
    physical.setWidth(width);
    physical.setHeight(height);
    physical.setDepth(height);

    mode->setPhysical(physical);

    return mode;
}
开发者ID:offtools,项目名称:qlcplus,代码行数:52,代码来源:fixture.cpp

示例6: QLCFixtureMode

void QLCFixtureMode_Test::physical()
{
    /* Verify that a QLCPhysical can be set & get for the mode */
    QLCFixtureMode* mode = new QLCFixtureMode(m_fixtureDef);
    QVERIFY(mode->physical().bulbType().isEmpty());

    QLCPhysical p;
    p.setBulbType("Foobar");
    mode->setPhysical(p);
    QVERIFY(mode->physical().bulbType() == "Foobar");

    delete mode;
}
开发者ID:Andersbakken,项目名称:qlc-svn,代码行数:13,代码来源:qlcfixturemode_test.cpp

示例7: slotLensDegreesMaxChanged

void EditMode::slotLensDegreesMaxChanged(int degrees)
{
	QLCPhysical physical = m_mode->physical();
	physical.setLensDegreesMax(degrees);
	m_mode->setPhysical(physical);
}
开发者ID:speakman,项目名称:qlc,代码行数:6,代码来源:editmode.cpp

示例8: slotLensNameChanged

void EditMode::slotLensNameChanged(const QString &name)
{
	QLCPhysical physical = m_mode->physical();
	physical.setLensName(name);
	m_mode->setPhysical(physical);
}
开发者ID:speakman,项目名称:qlc,代码行数:6,代码来源:editmode.cpp

示例9: slotDepthChanged

void EditMode::slotDepthChanged(int depth)
{
	QLCPhysical physical = m_mode->physical();
	physical.setDepth(depth);
	m_mode->setPhysical(physical);
}
开发者ID:speakman,项目名称:qlc,代码行数:6,代码来源:editmode.cpp

示例10: slotHeightChanged

void EditMode::slotHeightChanged(int height)
{
	QLCPhysical physical = m_mode->physical();
	physical.setHeight(height);
	m_mode->setPhysical(physical);
}
开发者ID:speakman,项目名称:qlc,代码行数:6,代码来源:editmode.cpp

示例11: slotWidthChanged

void EditMode::slotWidthChanged(int width)
{
	QLCPhysical physical = m_mode->physical();
	physical.setWidth(width);
	m_mode->setPhysical(physical);
}
开发者ID:speakman,项目名称:qlc,代码行数:6,代码来源:editmode.cpp

示例12: slotBulbColourTemperatureChanged

void EditMode::slotBulbColourTemperatureChanged(const QString &kelvins)
{
	QLCPhysical physical = m_mode->physical();
	physical.setBulbColourTemperature(kelvins.toInt());
	m_mode->setPhysical(physical);
}
开发者ID:speakman,项目名称:qlc,代码行数:6,代码来源:editmode.cpp

示例13: init

void EditMode::init()
{
	QString str;
	QLCPhysical physical = m_mode->physical();

	/* Channels page */
	connect(m_addChannelButton, SIGNAL(clicked()),
		this, SLOT(slotAddChannelClicked()));
	connect(m_removeChannelButton, SIGNAL(clicked()),
		this, SLOT(slotRemoveChannelClicked()));
	connect(m_raiseChannelButton, SIGNAL(clicked()),
		this, SLOT(slotRaiseChannelClicked()));
	connect(m_lowerChannelButton, SIGNAL(clicked()),
		this, SLOT(slotLowerChannelClicked()));

	m_modeNameEdit->setText(m_mode->name());
	m_channelList->header()->setResizeMode(QHeaderView::ResizeToContents);
	refreshChannelList();

	/* Physical page */
	m_bulbTypeCombo->setEditText(physical.bulbType());
	m_bulbLumensSpin->setValue(physical.bulbLumens());
	m_bulbTempCombo->setEditText(str.setNum(physical.bulbColourTemperature()));

	m_weightSpin->setValue(physical.weight());
	m_widthSpin->setValue(physical.width());
	m_heightSpin->setValue(physical.height());
	m_depthSpin->setValue(physical.depth());

	m_lensNameCombo->setEditText(physical.lensName());
	m_lensDegreesMinSpin->setValue(physical.lensDegreesMin());
	m_lensDegreesMaxSpin->setValue(physical.lensDegreesMax());

	m_focusTypeCombo->setEditText(physical.focusType());
	m_panMaxSpin->setValue(physical.focusPanMax());
	m_tiltMaxSpin->setValue(physical.focusTiltMax());

	m_powerConsumptionSpin->setValue(physical.powerConsumption());
	m_dmxConnectorCombo->setEditText(physical.dmxConnector());
}
开发者ID:speakman,项目名称:qlc,代码行数:40,代码来源:editmode.cpp

示例14: init

void EditMode::init()
{
	QString str;
	QLCPhysical physical = m_mode->physical();
	
	/* Channel buttons */
	m_addChannelButton->setIconSet(QPixmap(QString(PIXMAPS) + 
				       QString("/edit_add.png")));
	m_removeChannelButton->setIconSet(QPixmap(QString(PIXMAPS) + 
					  QString("/edit_remove.png")));
	m_raiseChannelButton->setIconSet(QPixmap(QString(PIXMAPS) + 
					 QString("/up.png")));
	m_lowerChannelButton->setIconSet(QPixmap(QString(PIXMAPS) + 
					 QString("/down.png")));
	
	/* Mode name */
	m_modeNameEdit->setText(m_mode->name());
	
	/* Channels */
	refreshChannelList();

	/* Physical properties */
	m_bulbTypeCombo->setCurrentText(physical.bulbType());
	m_bulbLumensSpin->setValue(physical.bulbLumens());
	str.sprintf("%d", physical.bulbColourTemperature());
	m_bulbTempCombo->setCurrentText(str);
	
	m_weightSpin->setValue(physical.weight());
	m_widthSpin->setValue(physical.width());
	m_heightSpin->setValue(physical.height());
	m_depthSpin->setValue(physical.depth());

	m_lensNameCombo->setCurrentText(physical.lensName());
	m_lensMinDegreesSpin->setValue(physical.lensDegreesMin());
	m_lensMaxDegreesSpin->setValue(physical.lensDegreesMax());
	
	m_focusTypeCombo->setCurrentText(physical.focusType());
	m_panMaxSpin->setValue(physical.focusPanMax());
	m_tiltMaxSpin->setValue(physical.focusTiltMax());
}
开发者ID:speakman,项目名称:qlc,代码行数:40,代码来源:editmode.cpp

示例15: slotFocusTypeChanged

void EditMode::slotFocusTypeChanged(const QString &type)
{
	QLCPhysical physical = m_mode->physical();
	physical.setFocusType(type);
	m_mode->setPhysical(physical);
}
开发者ID:speakman,项目名称:qlc,代码行数:6,代码来源:editmode.cpp


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