本文整理汇总了C++中Fixture类的典型用法代码示例。如果您正苦于以下问题:C++ Fixture类的具体用法?C++ Fixture怎么用?C++ Fixture使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Fixture类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: title
/*********************************************************************
* Status
*********************************************************************/
QString ChannelsGroup::status(Doc *doc) const
{
QString info;
QString title("<TR><TD CLASS='hilite' COLSPAN='3'><CENTER>%1</CENTER></TD></TR>");
info += "<TABLE COLS='3' WIDTH='100%'>";
// Fixture title
info += title.arg(name());
/********************************************************************
* Channels
********************************************************************/
// Title row
info += QString("<TR><TD CLASS='subhi'>%1</TD>").arg(tr("Fixture"));
info += QString("<TD CLASS='subhi'>%1</TD>").arg(tr("Channel"));
info += QString("<TD CLASS='subhi'>%1</TD></TR>").arg(tr("Description"));
foreach (SceneValue value, m_channels)
{
Fixture *fixture = doc->fixture(value.fxi);
if (fixture == NULL)
return QString();
const QLCFixtureMode *mode = fixture->fixtureMode();
QString chInfo("<TR><TD>%1</TD><TD>%2</TD><TD>%3</TD></TR>");
if (mode != NULL)
{
info += chInfo.arg(fixture->name()).arg(value.channel + 1)
.arg(mode->channels().at(value.channel)->name());
}
else
{
info += chInfo.arg(fixture->name()).arg(value.channel + 1)
.arg(QString(tr("Channel %1")).arg(value.channel));
}
}
示例2: TEST
TEST(BLEReturnLongSysExData, MultipleData)
{
using testing::ElementsAreArray;
using testing::_;
using testing::Args;
Fixture f;
static uint8_t longSysEx1[9] =
{
0x80, 0x80, 0xf0, 0x47, 0x7f, 0x15, 0x5c, 0x00, 0x01
};
static uint8_t longSysEx2[9] =
{
0x80, 0x21, 0x46, 0x47, 0x7f, 0x15, 0x5c, 0x80, 0xf7
};
static uint8_t sysExResult[14] =
{ 0xf0, 0x47, 0x7f, 0x15, 0x5c, 0x00, 0x01, 0x21, 0x46,
0x47, 0x7f, 0x15, 0x5c, 0xf7
};
EXPECT_CALL(f.getMock(), SendSysEx(_,_,0)).With(Args<0,1>(ElementsAreArray(sysExResult)));
f.parseDataArray(longSysEx1, 9);
f.parseDataArray(longSysEx2, 9);
}
示例3: TEST
TEST(ChgrpTest, testSimpleChgrp ) {
Fixture f;
ExperimenterGroupPtr g1 = f.newGroup();
ExperimenterGroupPtr g2 = f.newGroup();
ExperimenterPtr user = f.newUser(g1);
f.addExperimenter(g2, user);
client_ptr c = f.login(user->getOmeName()->getValue());
ServiceFactoryPrx sf = c->getSession();
IAdminPrx admin = sf->getAdminService();
ASSERT_EQ(g1->getId()->getValue(), admin->getEventContext()->groupId);
IQueryPrx iquery = sf->getQueryService();
IUpdatePrx iupdate = sf->getUpdateService();
ImagePtr image = new ImageI();
image->setName( rstring("testSimpleChgrp") );
image->setAcquisitionDate( rtime(0) );
image = ImagePtr::dynamicCast( iupdate->saveAndReturnObject( image ) );
std::map<string, string> options;
ChgrpPtr chgrp = new Chgrp();
chgrp->type = "/Image";
chgrp->id = image->getId()->getValue();
chgrp->grp = g2->getId()->getValue();
chgrp->options = options;
HandlePrx handle = sf->submit( chgrp );
CmdCallbackIPtr cb = new CmdCallbackI(c, handle);
ResponsePtr rsp = cb->loop(10, 500);
ERRPtr err = ERRPtr::dynamicCast(rsp);
if (err) {
FAIL() << "ERR returned";
}
}
示例4: doc
void FadeChannel_Test::group()
{
Doc doc(this);
FadeChannel fc;
// Only a channel given, no fixture at the address -> intensity
fc.setChannel(2);
QCOMPARE(fc.group(&doc), QLCChannel::Intensity);
Fixture* fxi = new Fixture(&doc);
fxi->setAddress(10);
fxi->setChannels(5);
doc.addFixture(fxi);
// Fixture and channel given, fixture is a dimmer -> intensity
fc.setFixture(&doc, fxi->id());
QCOMPARE(fc.group(&doc), QLCChannel::Intensity);
QDir dir(INTERNAL_FIXTUREDIR);
dir.setFilter(QDir::Files);
dir.setNameFilters(QStringList() << QString("*%1").arg(KExtFixture));
QVERIFY(doc.fixtureDefCache()->load(dir) == true);
QLCFixtureDef* def = doc.fixtureDefCache()->fixtureDef("Futurelight", "DJScan250");
QVERIFY(def != NULL);
QLCFixtureMode* mode = def->modes().first();
QVERIFY(mode != NULL);
fxi = new Fixture(&doc);
fxi->setAddress(0);
fxi->setFixtureDefinition(def, mode);
doc.addFixture(fxi);
// Fixture and channel given, but channel is beyond fixture's channels -> intensity
fc.setFixture(&doc, fxi->id());
fc.setChannel(50);
QCOMPARE(fc.group(&doc), QLCChannel::Intensity);
// Only a channel given, no fixture given but a fixture occupies the address.
// Check that reverse address -> fixture lookup works.
fc.setFixture(&doc, Fixture::invalidId());
fc.setChannel(2);
QCOMPARE(fc.group(&doc), QLCChannel::Colour);
// Fixture and channel given, but fixture doesn't exist -> intensity
fc.setFixture(&doc, 12345);
fc.setChannel(2);
QCOMPARE(fc.group(&doc), QLCChannel::Intensity);
}
示例5: addFixture
void FunctionWizard::addFixture(quint32 fxi_id)
{
Fixture* fxi = _app->doc()->fixture(fxi_id);
Q_ASSERT(fxi != NULL);
QTreeWidgetItem* item = new QTreeWidgetItem(m_fixtureTree);
item->setText(KColumnName, fxi->name());
item->setData(KColumnID, Qt::UserRole, fxi_id);
QStringList caps;
if (!IntensityGenerator::findChannels(fxi, QLCChannel::Colour).isEmpty())
caps << QLCChannel::groupToString(QLCChannel::Colour);
if (!IntensityGenerator::findChannels(fxi, QLCChannel::Gobo).isEmpty())
caps << QLCChannel::groupToString(QLCChannel::Gobo);
if (!IntensityGenerator::findChannels(fxi, QLCChannel::Shutter).isEmpty())
caps << QLCChannel::groupToString(QLCChannel::Shutter);
if (!IntensityGenerator::findChannels(fxi, QLCChannel::Intensity).isEmpty())
caps << QLCChannel::groupToString(QLCChannel::Intensity);
item->setText(KColumnCaps, caps.join(", "));
}
示例6: grp1
void FixtureGroup_Test::copy()
{
FixtureGroup grp1(m_doc);
grp1.setSize(QSize(4, 4));
grp1.setName("Pertti Pasanen");
grp1.setId(99);
for (quint32 id = 0; id < 16; id++)
{
Fixture* fxi = new Fixture(m_doc);
fxi->setChannels(1);
m_doc->addFixture(fxi);
grp1.assignFixture(fxi->id());
}
QCOMPARE(grp1.fixtureList().size(), 16);
FixtureGroup grp2(m_doc);
grp2.copyFrom(&grp1);
QCOMPARE(grp2.size(), QSize(4, 4));
QCOMPARE(grp2.name(), QString("Pertti Pasanen"));
QVERIFY(grp2.id() != quint32(99)); // ID must not be copied
QCOMPARE(grp2.fixtureList().size(), 16);
for (quint32 id = 0; id < 16; id++)
QVERIFY(grp2.fixtureList().contains(id) == true);
}
示例7: array
void EFXFixture_Test::start()
{
UniverseArray array(512 * 4);
MasterTimerStub mts(m_doc, array);
EFX e(m_doc);
e.setFadeInSpeed(1000);
e.setFadeOutSpeed(2000);
EFXFixture* ef = new EFXFixture(&e);
ef->setFixture(0);
e.addFixture(ef);
Fixture* fxi = m_doc->fixture(0);
QVERIFY(fxi != NULL);
e.preRun(&mts);
// Fade intensity == 0, no need to do fade-in
ef->setFadeIntensity(0);
ef->start(&mts, &array);
QCOMPARE(e.m_fader->m_channels.size(), 0);
ef->m_started = false;
// Fade intensity > 0, need to do fade-in
ef->setFadeIntensity(1);
ef->start(&mts, &array);
QCOMPARE(e.m_fader->m_channels.size(), 1);
FadeChannel fc;
fc.setFixture(fxi->id());
fc.setChannel(fxi->masterIntensityChannel());
QVERIFY(e.m_fader->m_channels.contains(fc) == true);
QCOMPARE(e.m_fader->m_channels[fc].fadeTime(), uint(1000));
e.postRun(&mts, &array);
}
示例8: QVERIFY
void EFXFixture_Test::setPoint8bit()
{
const QLCFixtureDef* def = m_doc->fixtureDefCache()->fixtureDef("Futurelight", "DJScan250");
QVERIFY(def != NULL);
const QLCFixtureMode* mode = def->modes().first();
QVERIFY(mode != NULL);
Fixture* fxi = new Fixture(m_doc);
fxi->setFixtureDefinition(def, mode);
m_doc->addFixture(fxi);
EFX e(m_doc);
EFXFixture ef(&e);
ef.setFixture(fxi->id());
UniverseArray array(512 * 4);
ef.setPoint(&array, 5.4, 1.5); // PMSB: 5, PLSB: 0.4, TMSB: 1 (102), TLSB: 0.5(127)
QVERIFY(array.preGMValues()[0] == (char) 5);
QVERIFY(array.preGMValues()[1] == (char) 1);
QVERIFY(array.preGMValues()[2] == (char) 0); /* No LSB channels */
QVERIFY(array.preGMValues()[3] == (char) 0); /* No LSB channels */
m_doc->deleteFixture(fxi->id());
}
示例9: doc
void FixtureGroup::assignFixture(quint32 id, const QLCPoint& pt)
{
Fixture* fxi = doc()->fixture(id);
Q_ASSERT(fxi != NULL);
QLCPoint tmp = pt;
for (int i = 0; i < fxi->heads(); i++)
{
if (pt.isNull())
{
assignHead(pt, GroupHead(fxi->id(), i));
}
else
{
assignHead(tmp, GroupHead(fxi->id(), i));
tmp.setX(tmp.x() + 1);
if (tmp.x() >= size().width())
{
tmp.setX(0);
tmp.setY(tmp.y() + 1);
}
}
}
}
示例10: m_uid
// ----------------------------------------------------------------------------
//
SceneActor::SceneActor( Venue* venue, FixtureGroup *fg ) :
m_uid( fg->getUID() ),
m_group( true ),
m_channels(0)
{
reset_channel_values();
if ( fg->getNumChannelValues() > 0 ) {
m_channels = fg->getNumChannelValues();
fg->getChannelValues( m_channel_values );
}
else {
Fixture* pf = venue->getGroupRepresentative( fg->getUID() );
if ( pf != NULL ) { // Make sure this is not an empty group
m_channels = pf->getNumChannels();
// Copy channel defaults
for ( channel_t channel=0; channel < m_channels; channel++ ) {
m_channel_values[ channel ] = pf->getChannel( channel )->getDefaultValue();
}
}
}
}
示例11: tcase_run_checked_setup
static TestResult *
tcase_run_checked_setup (SRunner * sr, TCase * tc)
{
TestResult *tr = NULL;
List *l;
Fixture *f;
enum fork_status fstat = srunner_fork_status (sr);
l = tc->ch_sflst;
if (fstat == CK_FORK) {
send_ctx_info (CK_CTX_SETUP);
}
for (list_front (l); !list_at_end (l); list_advance (l)) {
if (fstat == CK_NOFORK) {
send_ctx_info (CK_CTX_SETUP);
}
f = list_val (l);
f->fun ();
/* Stop the setup and return the failure if nofork mode. */
if (fstat == CK_NOFORK) {
tr = receive_result_info_nofork (tc->name, "checked_setup", 0);
if (tr->rtype != CK_PASS) {
break;
}
free (tr->file);
free (tr->msg);
free (tr);
tr = NULL;
}
}
return tr;
}
示例12: slotChannelStyleChanged
void MonitorFixture::slotChannelStyleChanged(Monitor::ChannelStyle style)
{
QString str;
int i = 0;
m_channelStyle = style;
/* Check that this MonitorFixture represents a fixture */
if (m_fixture == Fixture::invalidId())
return;
Fixture* fxi = m_doc->fixture(m_fixture);
Q_ASSERT(fxi != NULL);
/* Start channel numbering from this fixture's address */
if (style == Monitor::DMXChannels)
i = fxi->address() + 1;
else
i = 1;
QListIterator <QLabel*> it(m_channelLabels);
while (it.hasNext() == true)
it.next()->setText(str.sprintf("<B>%.3d</B>", i++));
}
示例13: Doc
/** Test scene running with bus value 1 (takes two cycles) */
void Scene_Test::writeBusOne()
{
Doc* doc = new Doc(this, m_cache);
Bus::instance()->setValue(Bus::defaultFade(), 1);
Fixture* fxi = new Fixture(doc);
fxi->setAddress(0);
fxi->setUniverse(0);
fxi->setChannels(10);
doc->addFixture(fxi);
Scene* s1 = new Scene(doc);
s1->setName("First");
s1->setValue(fxi->id(), 0, 255);
s1->setValue(fxi->id(), 1, 127);
s1->setValue(fxi->id(), 2, 0);
doc->addFunction(s1);
s1->arm();
QByteArray uni(4 * 512, 0);
MasterTimerStub* mts = new MasterTimerStub(this, NULL, uni);
QVERIFY(s1->stopped() == true);
mts->startFunction(s1);
QVERIFY(s1->stopped() == false);
QVERIFY(uni[0] == (char) 0);
QVERIFY(uni[1] == (char) 0);
QVERIFY(uni[2] == (char) 0);
s1->write(mts, &uni);
QVERIFY(s1->stopped() == false);
QVERIFY(uni[0] == (char) 127);
QVERIFY(uni[1] == (char) 63);
QVERIFY(uni[2] == (char) 0);
s1->write(mts, &uni);
QVERIFY(s1->stopped() == true);
QVERIFY(uni[0] == (char) 255);
QVERIFY(uni[1] == (char) 127);
QVERIFY(uni[2] == (char) 0);
mts->stopFunction(s1);
QVERIFY(s1->stopped() == true);
QVERIFY(uni[0] == (char) 255);
QVERIFY(uni[1] == (char) 127);
QVERIFY(uni[2] == (char) 0);
s1->disarm();
delete mts;
delete doc;
}
示例14: Fixture
void Chaser_Test::quickChaser()
{
Fixture* fxi = new Fixture(m_doc);
fxi->setAddress(0);
fxi->setUniverse(0);
fxi->setChannels(1);
m_doc->addFixture(fxi);
Chaser* c = new Chaser(m_doc);
// A really quick chaser
c->setDuration(0);
m_doc->addFunction(c);
Scene* s1 = new Scene(m_doc);
s1->setValue(fxi->id(), 0, 255);
m_doc->addFunction(s1);
c->addStep(s1->id());
Scene* s2 = new Scene(m_doc);
s2->setValue(fxi->id(), 0, 127);
m_doc->addFunction(s2);
c->addStep(s2->id());
MasterTimer timer(m_doc);
QVERIFY(c->isRunning() == false);
QVERIFY(c->stopped() == true);
c->start(&timer, FunctionParent::master());
timer.timerTick();
for (uint i = 0; i < 12; ++i)
{
timer.timerTick();
QVERIFY(c->isRunning() == true);
QVERIFY(c->stopped() == false);
// always one function running while the other is not
QVERIFY(s1->isRunning() == true || s2->isRunning() == true);
QVERIFY(s1->stopped() == true || s2->stopped() == true);
}
c->stop(FunctionParent::master());
timer.timerTick();
QVERIFY(c->isRunning() == false);
QVERIFY(c->stopped() == true);
QVERIFY(s1->isRunning() == false);
QVERIFY(s1->stopped() == true);
QVERIFY(s2->isRunning() == false);
QVERIFY(s2->stopped() == true);
}
示例15: doc
void IntensityGenerator_Test::sequenceScenes()
{
Doc doc(this, m_fixtureDefCache);
QList <Fixture*> fixtures;
Fixture* fxi = new Fixture(&doc);
fxi->setChannels(4);
fixtures << fxi;
Fixture* fxi2 = new Fixture(&doc);
const QLCFixtureDef* def = m_fixtureDefCache.fixtureDef("Futurelight", "DJScan250");
Q_ASSERT(def != NULL);
Q_ASSERT(def->modes().first() != NULL);
Q_ASSERT(def->modes().first()->channels().size() == 6);
fxi2->setFixtureDefinition(def, def->modes().first());
fixtures << fxi2;
QList <Scene*> scenes = IntensityGenerator::sequenceScenes(fixtures, &doc);
QCOMPARE(scenes.size(), 5);
QCOMPARE(scenes[0]->values().size(), 1);
QCOMPARE(scenes[0]->values()[0].fxi, fxi->id());
QCOMPARE(scenes[0]->values()[0].channel, quint32(0));
QCOMPARE(scenes[0]->values()[0].value, uchar(UCHAR_MAX));
QCOMPARE(scenes[1]->values().size(), 1);
QCOMPARE(scenes[1]->values()[0].fxi, fxi->id());
QCOMPARE(scenes[1]->values()[0].channel, quint32(1));
QCOMPARE(scenes[1]->values()[0].value, uchar(UCHAR_MAX));
QCOMPARE(scenes[2]->values().size(), 1);
QCOMPARE(scenes[2]->values()[0].fxi, fxi->id());
QCOMPARE(scenes[2]->values()[0].channel, quint32(2));
QCOMPARE(scenes[2]->values()[0].value, uchar(UCHAR_MAX));
QCOMPARE(scenes[3]->values().size(), 1);
QCOMPARE(scenes[3]->values()[0].fxi, fxi->id());
QCOMPARE(scenes[3]->values()[0].channel, quint32(3));
QCOMPARE(scenes[3]->values()[0].value, uchar(UCHAR_MAX));
QCOMPARE(scenes[4]->values().size(), 1);
QCOMPARE(scenes[4]->values()[0].fxi, fxi->id());
QCOMPARE(scenes[4]->values()[0].channel, quint32(5));
QCOMPARE(scenes[4]->values()[0].value, uchar(128));
}