本文整理汇总了C++中Fixture::channelNumber方法的典型用法代码示例。如果您正苦于以下问题:C++ Fixture::channelNumber方法的具体用法?C++ Fixture::channelNumber怎么用?C++ Fixture::channelNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fixture
的用法示例。
在下文中一共展示了Fixture::channelNumber方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: qDebug
void MainView2D::createFixtureItem(quint32 fxID, quint16 headIndex, quint16 linkedIndex,
QVector3D pos, bool mmCoords)
{
if (isEnabled() == false)
return;
if (m_gridItem == NULL)
initialize2DProperties();
qDebug() << "[MainView2D] Creating fixture with ID" << fxID << headIndex << linkedIndex << "pos:" << pos;
Fixture *fixture = m_doc->fixture(fxID);
if (fixture == NULL)
return;
quint32 itemID = FixtureUtils::fixtureItemID(fxID, headIndex, linkedIndex);
QLCFixtureMode *fxMode = fixture->fixtureMode();
QQuickItem *newFixtureItem = qobject_cast<QQuickItem*>(fixtureComponent->create());
quint32 itemFlags = m_monProps->fixtureFlags(fxID, headIndex, linkedIndex);
newFixtureItem->setParentItem(m_gridItem);
newFixtureItem->setProperty("itemID", itemID);
if (itemFlags & MonitorProperties::HiddenFlag)
newFixtureItem->setProperty("visible", false);
if (fxMode != NULL && fixture->type() != QLCFixtureDef::Dimmer)
{
QLCPhysical phy = fxMode->physical();
//qDebug() << "Current mode fixture heads:" << fxMode->heads().count();
newFixtureItem->setProperty("headsNumber", fxMode->heads().count());
if (fixture->channelNumber(QLCChannel::Pan, QLCChannel::MSB) != QLCChannel::invalid())
{
int panDeg = phy.focusPanMax();
if (panDeg == 0) panDeg = 360;
newFixtureItem->setProperty("panMaxDegrees", panDeg);
}
if (fixture->channelNumber(QLCChannel::Tilt, QLCChannel::MSB) != QLCChannel::invalid())
{
int tiltDeg = phy.focusTiltMax();
if (tiltDeg == 0) tiltDeg = 270;
newFixtureItem->setProperty("tiltMaxDegrees", tiltDeg);
}
}
QPointF itemPos;
QSizeF size = FixtureUtils::item2DDimension(fixture->type() == QLCFixtureDef::Dimmer ? NULL : fxMode,
m_monProps->pointOfView());
if (mmCoords == false && (pos.x() != 0 || pos.y() != 0))
{
float gridUnits = m_monProps->gridUnits() == MonitorProperties::Meters ? 1000.0 : 304.8;
itemPos.setX((pos.x() * gridUnits) / m_cellPixels);
itemPos.setY((pos.y() * gridUnits) / m_cellPixels);
}
if (m_monProps->containsItem(fxID, headIndex, linkedIndex))
{
itemPos = FixtureUtils::item2DPosition(m_monProps, m_monProps->pointOfView(), pos);
newFixtureItem->setProperty("rotation",
FixtureUtils::item2DRotation(m_monProps->pointOfView(),
m_monProps->fixtureRotation(fxID, headIndex, linkedIndex)));
}
else
{
itemPos = FixtureUtils::available2DPosition(m_doc, m_monProps->pointOfView(),
QRectF(itemPos.x(), itemPos.y(), size.width(), size.height()));
// add the new fixture to the Doc monitor properties
QVector3D newPos = FixtureUtils::item3DPosition(m_monProps, itemPos, 1000.0);
m_monProps->setFixturePosition(fxID, headIndex, linkedIndex, newPos);
m_monProps->setFixtureFlags(fxID, headIndex, linkedIndex, 0);
Tardis::instance()->enqueueAction(Tardis::FixtureSetPosition, itemID, QVariant(QVector3D(0, 0, 0)), QVariant(newPos));
}
newFixtureItem->setProperty("mmXPos", itemPos.x());
newFixtureItem->setProperty("mmYPos", itemPos.y());
newFixtureItem->setProperty("mmWidth", size.width());
newFixtureItem->setProperty("mmHeight", size.height());
newFixtureItem->setProperty("fixtureName", fixture->name());
// and finally add the new item to the items map
m_itemsMap[itemID] = newFixtureItem;
QByteArray values;
updateFixture(fixture, values);
}