本文整理汇总了C++中FixtureGroup类的典型用法代码示例。如果您正苦于以下问题:C++ FixtureGroup类的具体用法?C++ FixtureGroup怎么用?C++ FixtureGroup使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FixtureGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Doc
void RGBMatrix_Test::initTestCase()
{
m_doc = new Doc(this);
QDir fxiDir(INTERNAL_FIXTUREDIR);
fxiDir.setFilter(QDir::Files);
fxiDir.setNameFilters(QStringList() << QString("*%1").arg(KExtFixture));
QVERIFY(m_doc->fixtureDefCache()->loadMap(fxiDir) == true);
QLCFixtureDef* def = m_doc->fixtureDefCache()->fixtureDef("Stairville", "LED PAR56");
QVERIFY(def != NULL);
QLCFixtureMode* mode = def->modes().first();
QVERIFY(mode != NULL);
FixtureGroup* grp = new FixtureGroup(m_doc);
grp->setName("Test Group");
grp->setSize(QSize(5, 5));
m_doc->addFixtureGroup(grp);
for (int i = 0; i < 25; i++)
{
Fixture* fxi = new Fixture(m_doc);
fxi->setFixtureDefinition(def, mode);
fxi->setAddress(i * fxi->channels());
m_doc->addFixture(fxi);
grp->assignFixture(fxi->id());
}
QVERIFY(m_doc->rgbScriptsCache()->load(QDir(INTERNAL_SCRIPTDIR)));
QVERIFY(m_doc->rgbScriptsCache()->names().size() != 0);
}
示例2: doc
void RGBMatrix::calculateColorDelta()
{
m_crDelta = 0;
m_cgDelta = 0;
m_cbDelta = 0;
m_stepCount = 0;
if (m_endColor.isValid())
{
if (doc() == NULL)
return;
FixtureGroup* grp = doc()->fixtureGroup(fixtureGroup());
QMutexLocker algorithmLocker(&m_algorithmMutex);
if (grp != NULL && m_algorithm != NULL)
{
m_stepCount = m_algorithm->rgbMapStepCount(grp->size()) - 1;
if (m_stepCount > 0)
{
m_crDelta = m_endColor.red() - m_startColor.red();
m_cgDelta = m_endColor.green() - m_startColor.green();
m_cbDelta = m_endColor.blue() - m_startColor.blue();
}
}
}
}
示例3: doc
void RGBMatrix::tap()
{
if (stopped() == false)
{
FixtureGroup* grp = doc()->fixtureGroup(fixtureGroup());
// Filter out taps that are too close to each other
if (grp != NULL && uint(m_roundTime->elapsed()) >= (duration() / 4))
roundCheck(grp->size());
}
}
示例4: algorithmLocker
RGBMap RGBMatrix::previewMap(int step)
{
RGBMap map;
QMutexLocker algorithmLocker(&m_algorithmMutex);
if (m_algorithm == NULL)
return map;
FixtureGroup* grp = doc()->fixtureGroup(fixtureGroup());
if (grp != NULL)
{
map = m_algorithm->rgbMap(grp->size(), m_stepColor.rgb(), step);
}
return map;
}
示例5: doc
void RGBMatrix::setTotalDuration(quint32 msec)
{
if (m_fixtureGroupID == FixtureGroup::invalidId() ||
m_algorithm == NULL)
return;
FixtureGroup* grp = doc()->fixtureGroup(fixtureGroup());
if (grp != NULL)
{
int steps = m_algorithm->rgbMapStepCount(grp->size());
setDuration(msec / steps);
}
}
示例6: Q_UNUSED
void RGBMatrix::preRun(MasterTimer* timer)
{
Q_UNUSED(timer);
FixtureGroup* grp = doc()->fixtureGroup(fixtureGroup());
{
QMutexLocker algorithmLocker(&m_algorithmMutex);
if (grp != NULL && m_algorithm != NULL)
{
Q_ASSERT(m_fader == NULL);
m_fader = new GenericFader(doc());
m_fader->adjustIntensity(getAttributeValue(Intensity));
// Copy direction from parent class direction
m_direction = direction();
if (m_direction == Forward)
{
m_step = 0;
m_stepColor = m_startColor.rgb();
}
else
{
m_step = m_algorithm->rgbMapStepCount(grp->size()) - 1;
if (m_endColor.isValid())
{
m_stepColor = m_endColor.rgb();
}
else
{
m_stepColor = m_startColor.rgb();
}
}
calculateColorDelta();
if (m_algorithm->type() == RGBAlgorithm::Script)
{
RGBScript *script = static_cast<RGBScript*> (m_algorithm);
QHashIterator<QString, QString> it(m_properties);
while(it.hasNext())
{
it.next();
script->setProperty(it.key(), it.value());
}
}
}
}
m_roundTime->start();
Function::preRun(timer);
}
示例7: algorithmLocker
void RGBMatrix::setTotalDuration(quint32 msec)
{
QMutexLocker algorithmLocker(&m_algorithmMutex);
if (m_algorithm == NULL)
return;
FixtureGroup* grp = doc()->fixtureGroup(fixtureGroup());
if (grp == NULL)
return;
int steps = m_algorithm->rgbMapStepCount(grp->size());
setDuration(msec / steps);
}
示例8: init
// ----------------------------------------------------------------------------
//
void ActorSelectField::init( ActorPtrArray& actors, UIDArray& selected_actor_uids )
{
if ( actors.size() == 0 )
return;
CString default_value;
CString values;
std::map<UID,CString> actor_to_id;
for ( SceneActor * actor : actors ) {
CString label;
CString id;
if ( actor->isGroup() ) {
FixtureGroup* group = m_venue->getFixtureGroup( actor->getActorUID() );
label.Format( "%s", group->getName() );
id.Format( "G%lu", group->getNumber() );
}
else {
Fixture* pf = m_venue->getFixture( actor->getActorUID() );
label.Format( "%s @ %d", pf->getFullName(), pf->getAddress() );
id.Format( "%lu", pf->getFixtureNumber() );
}
m_entries[ id ] = ActorSelectField::entry( id, label, *actor );
actor_to_id[ actor->getActorUID() ] = id;
if ( default_value.GetLength() == 0 )
default_value = id;
}
// Preseve selected actor order
for ( UID selected_uid : selected_actor_uids ) {
std::map<UID,CString>::iterator it = actor_to_id.find( selected_uid );
if ( it != actor_to_id.end() ) {
if ( values.GetLength() != 0 )
values += ",";
values.Append( (*it).second );
}
}
if ( values.GetLength() == 0 )
setValue( default_value );
else
setValue( values );
}
示例9: doc
QList <RGBMap> RGBMatrix::previewMaps()
{
QList <RGBMap> steps;
if (m_algorithm == NULL)
return steps;
FixtureGroup* grp = doc()->fixtureGroup(fixtureGroup());
if (grp != NULL)
{
int stepCount = m_algorithm->rgbMapStepCount(grp->size());
for (int i = 0; i < stepCount; i++)
steps << m_algorithm->rgbMap(grp->size(), m_stepColor.rgb(), i);
}
return steps;
}
示例10: fillFixtureGroupCombo
void RGBMatrixEditor::slotFixtureGroupChanged(quint32 id)
{
if (id == m_matrix->fixtureGroup())
{
// Update the whole chain -> maybe the fixture layout has changed
fillFixtureGroupCombo();
slotFixtureGroupActivated(m_fixtureGroupCombo->currentIndex());
}
else
{
// Just change the name of the group, nothing else is interesting at this point
int index = m_fixtureGroupCombo->findData(id);
if (index != -1)
{
FixtureGroup* grp = m_doc->fixtureGroup(id);
m_fixtureGroupCombo->setItemText(index, grp->name());
}
}
}
示例11: Q_UNUSED
void RGBMatrix::write(MasterTimer* timer, QList<Universe *> universes)
{
Q_UNUSED(timer);
Q_UNUSED(universes);
FixtureGroup* grp = doc()->fixtureGroup(fixtureGroup());
if (grp == NULL)
{
// No fixture group to control
stop();
return;
}
// No time to do anything.
if (duration() == 0)
return;
// Invalid/nonexistent script
{
QMutexLocker algorithmLocker(&m_algorithmMutex);
if (m_algorithm == NULL || m_algorithm->apiVersion() == 0)
return;
// Get new map every time when elapsed is reset to zero
if (elapsed() == 0)
{
qDebug() << "RGBMatrix stepColor:" << QString::number(m_stepColor.rgb(), 16);
RGBMap map = m_algorithm->rgbMap(grp->size(), m_stepColor.rgb(), m_step);
updateMapChannels(map, grp);
}
}
// Run the generic fader that takes care of fading in/out individual channels
m_fader->write(universes);
// Increment elapsed time
incrementElapsed();
// Check if we need to change direction, stop completely or go to next step
if (elapsed() >= duration())
roundCheck(grp->size());
}
示例12: slotSaveToSequenceClicked
void RGBMatrixEditor::slotSaveToSequenceClicked()
{
if (m_matrix == NULL || m_matrix->fixtureGroup() == FixtureGroup::invalidId())
return;
FixtureGroup* grp = m_doc->fixtureGroup(m_matrix->fixtureGroup());
if (grp != NULL && m_matrix->algorithm() != NULL)
{
bool testRunning = false;
if (m_testButton->isChecked() == true)
{
m_testButton->click();
testRunning = true;
}
else
m_previewTimer->stop();
Scene *grpScene = new Scene(m_doc);
grpScene->setName(grp->name());
QList<GroupHead> headList = grp->headList();
foreach (GroupHead head, headList)
{
Fixture *fxi = m_doc->fixture(head.fxi);
if (fxi == NULL)
continue;
QList<quint32> rgbCh = fxi->rgbChannels(head.head);
if (rgbCh.count() == 3)
{
grpScene->setValue(head.fxi, rgbCh.at(0), 0);
grpScene->setValue(head.fxi, rgbCh.at(1), 0);
grpScene->setValue(head.fxi, rgbCh.at(2), 0);
}
quint32 master = fxi->masterIntensityChannel(head.head);
if (master != QLCChannel::invalid())
grpScene->setValue(head.fxi, master, 0);
}
示例13: clearing
void Doc::clearContents()
{
emit clearing();
// Delete all function instances
QListIterator <quint32> funcit(m_functions.keys());
while (funcit.hasNext() == true)
{
Function* func = m_functions.take(funcit.next());
emit functionRemoved(func->id());
delete func;
}
// Delete all fixture instances
QListIterator <quint32> fxit(m_fixtures.keys());
while (fxit.hasNext() == true)
{
Fixture* fxi = m_fixtures.take(fxit.next());
emit fixtureRemoved(fxi->id());
delete fxi;
}
// Delete all fixture groups
QListIterator <quint32> grpit(m_fixtureGroups.keys());
while (grpit.hasNext() == true)
{
FixtureGroup* grp = m_fixtureGroups.take(grpit.next());
emit fixtureGroupRemoved(grp->id());
delete grp;
}
m_latestFunctionId = 0;
m_latestFixtureId = 0;
m_latestFixtureGroupId = 0;
m_addresses.clear();
emit cleared();
}
示例14: spy
void Doc_Test::addFixtureGroup()
{
QSignalSpy spy(m_doc, SIGNAL(fixtureGroupAdded(quint32)));
QCOMPARE(m_doc->fixtureGroups().size(), 0);
QCOMPARE(m_doc->m_latestFixtureGroupId, quint32(0));
FixtureGroup* grp = new FixtureGroup(m_doc);
QCOMPARE(m_doc->addFixtureGroup(grp), true);
QCOMPARE(grp->id(), quint32(0));
QCOMPARE(m_doc->m_latestFixtureGroupId, quint32(0));
QCOMPARE(m_doc->fixtureGroups().size(), 1);
QCOMPARE(spy.size(), 1);
QCOMPARE(spy[0].size(), 1);
QCOMPARE(spy[0][0].toUInt(), quint32(0));
QCOMPARE(m_doc->addFixtureGroup(grp, 0), false);
QCOMPARE(m_doc->fixtureGroups().size(), 1);
grp = new FixtureGroup(m_doc);
QCOMPARE(m_doc->addFixtureGroup(grp, 0), false);
QCOMPARE(m_doc->addFixtureGroup(grp, 15), true);
QCOMPARE(m_doc->m_latestFixtureGroupId, quint32(0));
QCOMPARE(m_doc->fixtureGroups().size(), 2);
QCOMPARE(spy.size(), 2);
QCOMPARE(spy[1].size(), 1);
QCOMPARE(spy[1][0].toUInt(), quint32(15));
grp = new FixtureGroup(m_doc);
QCOMPARE(m_doc->addFixtureGroup(grp), true);
QCOMPARE(grp->id(), quint32(1));
QCOMPARE(m_doc->m_latestFixtureGroupId, quint32(1));
QCOMPARE(m_doc->fixtureGroups().size(), 3);
QCOMPARE(spy.size(), 3);
QCOMPARE(spy[2].size(), 1);
QCOMPARE(spy[2][0].toUInt(), quint32(1));
}
示例15: clearing
void Doc::clearContents()
{
emit clearing();
m_clipboard->resetContents();
if (m_monitorProps != NULL)
m_monitorProps->reset();
destroyAudioCapture();
// Delete all function instances
QListIterator <quint32> funcit(m_functions.keys());
while (funcit.hasNext() == true)
{
Function* func = m_functions.take(funcit.next());
if (func == NULL)
continue;
emit functionRemoved(func->id());
delete func;
}
// Delete all fixture groups
QListIterator <quint32> grpit(m_fixtureGroups.keys());
while (grpit.hasNext() == true)
{
FixtureGroup* grp = m_fixtureGroups.take(grpit.next());
quint32 grpID = grp->id();
delete grp;
emit fixtureGroupRemoved(grpID);
}
// Delete all fixture instances
QListIterator <quint32> fxit(m_fixtures.keys());
while (fxit.hasNext() == true)
{
Fixture* fxi = m_fixtures.take(fxit.next());
quint32 fxID = fxi->id();
delete fxi;
emit fixtureRemoved(fxID);
}
// Delete all channels groups
QListIterator <quint32> grpchans(m_channelsGroups.keys());
while (grpchans.hasNext() == true)
{
ChannelsGroup* grp = m_channelsGroups.take(grpchans.next());
emit channelsGroupRemoved(grp->id());
delete grp;
}
m_orderedGroups.clear();
m_latestFunctionId = 0;
m_latestFixtureId = 0;
m_latestFixtureGroupId = 0;
m_latestChannelsGroupId = 0;
m_addresses.clear();
emit cleared();
}