Monitor::Monitor(QWidget* parent, Doc* doc, Qt::WindowFlags f) : QWidget(parent, f) , m_doc(doc) , m_toolBar(NULL) , m_scrollArea(NULL) , m_monitorWidget(NULL) { Q_ASSERT(doc != NULL); m_props = m_doc->monitorProperties(); /* Master layout for toolbar and scroll area */ new QVBoxLayout(this); initView(); /* Listen to fixture additions and changes from Doc */ connect(m_doc, SIGNAL(fixtureAdded(quint32)), this, SLOT(slotFixtureAdded(quint32))); connect(m_doc, SIGNAL(fixtureChanged(quint32)), this, SLOT(slotFixtureChanged(quint32))); connect(m_doc, SIGNAL(fixtureRemoved(quint32)), this, SLOT(slotFixtureRemoved(quint32))); connect(m_doc->inputOutputMap(), SIGNAL(universesWritten(int, const QByteArray&)), this, SLOT(slotUniversesWritten(int, const QByteArray&))); }
void SimpleDesk::initUniverseSliders() { qDebug() << Q_FUNC_INFO; quint32 start = (m_universePageSpin->value() - 1) * m_channelsPerPage; for (quint32 i = 0; i < m_channelsPerPage; i++) { ConsoleChannel* slider = NULL; const Fixture* fxi = m_doc->fixture(m_doc->fixtureForAddress(start + i)); if (fxi == NULL) slider = new ConsoleChannel(this, m_doc, Fixture::invalidId(), i, false); else { uint ch = (start + i) - fxi->universeAddress(); slider = new ConsoleChannel(this, m_doc, fxi->id(), ch, false); } m_universeGroup->layout()->addWidget(slider); m_universeSliders << slider; connect(slider, SIGNAL(valueChanged(quint32,quint32,uchar)), this, SLOT(slotUniverseSliderValueChanged(quint32,quint32,uchar))); } connect(m_doc, SIGNAL(fixtureAdded(quint32)), this, SLOT(slotUpdateUniverseSliders())); connect(m_doc, SIGNAL(fixtureRemoved(quint32)), this, SLOT(slotUpdateUniverseSliders())); connect(m_doc, SIGNAL(fixtureChanged(quint32)), this, SLOT(slotUpdateUniverseSliders())); }
void MonitorDmxMode::disconnectSignals() { disconnect(doc(), SIGNAL(fixtureAdded(quint32)), this, SLOT(slotFixtureAdded(quint32))); disconnect(doc(), SIGNAL(fixtureChanged(quint32)), this, SLOT(slotFixtureChanged(quint32))); disconnect(doc(), SIGNAL(fixtureRemoved(quint32)), this, SLOT(slotFixtureRemoved(quint32))); disconnect(doc()->inputOutputMap(), SIGNAL(universesWritten(int, const QByteArray&)), this, SLOT(slotUniversesWritten(int, const QByteArray&))); }
void Doc::slotFixtureChanged(quint32 id) { /* Keep track of fixture addresses */ Fixture* fxi = fixture(id); for (uint i = fxi->universeAddress(); i < fxi->universeAddress() + fxi->channels(); i++) { m_addresses[i] = id; } setModified(); emit fixtureChanged(id); }
void MonitorDmxMode::connectSignals() { /* Listen to fixture additions and changes from Doc */ connect(doc(), SIGNAL(fixtureAdded(quint32)), this, SLOT(slotFixtureAdded(quint32))); connect(doc(), SIGNAL(fixtureChanged(quint32)), this, SLOT(slotFixtureChanged(quint32))); connect(doc(), SIGNAL(fixtureRemoved(quint32)), this, SLOT(slotFixtureRemoved(quint32))); connect(doc()->inputOutputMap(), SIGNAL(universesWritten(int, const QByteArray&)), this, SLOT(slotUniversesWritten(int, const QByteArray&))); }
Monitor::Monitor(QWidget* parent, Qt::WindowFlags f) : QWidget(parent, f) { /* Master layout for toolbar and scroll area */ new QVBoxLayout(this); /* Scroll area that contains the monitor widget */ m_scrollArea = new QScrollArea(this); m_scrollArea->setWidgetResizable(true); layout()->addWidget(m_scrollArea); /* Monitor widget that contains all MonitorFixtures */ m_monitorWidget = new QWidget(m_scrollArea); m_monitorWidget->setBackgroundRole(QPalette::Dark); m_monitorLayout = new MonitorLayout(m_monitorWidget); m_monitorLayout->setSpacing(1); m_monitorLayout->setMargin(1); /* Load global settings */ loadSettings(); /* Create toolbar */ initToolBar(); /* Create a bunch of MonitorFixtures for each fixture */ for (t_fixture_id i = 0; i < KFixtureArraySize; i++) { Fixture* fxi = _app->doc()->fixture(i); if (fxi != NULL) createMonitorFixture(fxi); } /* Show the master container widgets */ m_scrollArea->setWidget(m_monitorWidget); m_monitorWidget->show(); m_scrollArea->show(); /* Listen to Document changes */ connect(_app, SIGNAL(documentChanged(Doc*)), this, SLOT(slotDocumentChanged(Doc*))); /* Listen to fixture additions and changes from Doc */ connect(_app->doc(), SIGNAL(fixtureAdded(t_fixture_id)), this, SLOT(slotFixtureAdded(t_fixture_id))); connect(_app->doc(), SIGNAL(fixtureChanged(t_fixture_id)), this, SLOT(slotFixtureChanged(t_fixture_id))); m_timer = startTimer(1000 / 50); QWidget::show(); }
Monitor::Monitor(QWidget* parent, Doc* doc, Qt::WindowFlags f) : QWidget(parent, f) , m_doc(doc) , m_props(NULL) , m_toolBar(NULL) , m_scrollArea(NULL) , m_monitorWidget(NULL) , m_monitorLayout(NULL) , m_currentUniverse(Universe::invalid()) , m_splitter(NULL) , m_graphicsView(NULL) , m_fixtureItemEditor(NULL) , m_gridWSpin(NULL) , m_gridHSpin(NULL) , m_unitsCombo(NULL) , m_labelsAction(NULL) { Q_ASSERT(doc != NULL); m_props = m_doc->monitorProperties(); /* Master layout for toolbar and scroll area */ new QVBoxLayout(this); initView(); /* Listen to fixture additions and changes from Doc */ connect(m_doc, SIGNAL(fixtureAdded(quint32)), this, SLOT(slotFixtureAdded(quint32))); connect(m_doc, SIGNAL(fixtureChanged(quint32)), this, SLOT(slotFixtureChanged(quint32))); connect(m_doc, SIGNAL(fixtureRemoved(quint32)), this, SLOT(slotFixtureRemoved(quint32))); connect(m_doc->masterTimer(), SIGNAL(functionStarted(quint32)), this, SLOT(slotFunctionStarted(quint32))); connect(m_doc->inputOutputMap(), SIGNAL(universesWritten(int, const QByteArray&)), this, SLOT(slotUniversesWritten(int, const QByteArray&))); }
void EFXEditor::initGeneralPage() { connect(m_nameEdit, SIGNAL(textEdited(const QString&)), this, SLOT(slotNameEdited(const QString&))); connect(m_tree, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(slotFixtureItemChanged(QTreeWidgetItem*,int))); connect(m_addFixtureButton, SIGNAL(clicked()), this, SLOT(slotAddFixtureClicked())); connect(m_removeFixtureButton, SIGNAL(clicked()), this, SLOT(slotRemoveFixtureClicked())); connect(m_raiseFixtureButton, SIGNAL(clicked()), this, SLOT(slotRaiseFixtureClicked())); connect(m_lowerFixtureButton, SIGNAL(clicked()), this, SLOT(slotLowerFixtureClicked())); connect(m_parallelRadio, SIGNAL(toggled(bool)), this, SLOT(slotParallelRadioToggled(bool))); connect(m_serialRadio, SIGNAL(toggled(bool)), this, SLOT(slotSerialRadioToggled(bool))); connect(m_asymmetricRadio, SIGNAL(toggled(bool)), this, SLOT(slotAsymmetricRadioToggled(bool))); // Test slots connect(m_testButton, SIGNAL(clicked()), this, SLOT(slotTestClicked())); connect(m_raiseFixtureButton, SIGNAL(clicked()), this, SLOT(slotRestartTest())); connect(m_lowerFixtureButton, SIGNAL(clicked()), this, SLOT(slotRestartTest())); connect(m_parallelRadio, SIGNAL(toggled(bool)), this, SLOT(slotRestartTest())); connect(m_serialRadio, SIGNAL(toggled(bool)), this, SLOT(slotRestartTest())); connect(m_asymmetricRadio, SIGNAL(toggled(bool)), this, SLOT(slotRestartTest())); // Doc connect(m_doc, SIGNAL(fixtureRemoved(quint32)), this, SLOT(slotFixtureRemoved())); connect(m_doc, SIGNAL(fixtureChanged(quint32)), this, SLOT(slotFixtureChanged())); /* Set the EFX's name to the name field */ m_nameEdit->setText(m_efx->name()); m_nameEdit->setSelection(0, m_nameEdit->text().length()); /* Resize columns to fit contents */ m_tree->header()->setResizeMode(QHeaderView::ResizeToContents); /* Put all of the EFX's fixtures to the tree view */ updateFixtureTree(); /* Set propagation mode */ if (m_efx->propagationMode() == EFX::Serial) m_serialRadio->setChecked(true); else if (m_efx->propagationMode() == EFX::Asymmetric) m_asymmetricRadio->setChecked(true); else m_parallelRadio->setChecked(true); /* Disable test button if we're in operate mode */ if (m_doc->mode() == Doc::Operate) m_testButton->setEnabled(false); }