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&))); }
int FixtureManager::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: slotFixtureAdded((*reinterpret_cast< quint32(*)>(_a[1]))); break; case 1: slotFixtureRemoved((*reinterpret_cast< quint32(*)>(_a[1]))); break; case 2: slotModeChanged((*reinterpret_cast< Doc::Mode(*)>(_a[1]))); break; case 3: slotSelectionChanged(); break; case 4: slotDoubleClicked((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1]))); break; case 5: slotAdd(); break; case 6: slotRemove(); break; case 7: slotProperties(); break; case 8: slotContextMenuRequested((*reinterpret_cast< const QPoint(*)>(_a[1]))); break; default: ; } _id -= 9; } return _id; }
int Monitor::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: channelStyleChanged((*reinterpret_cast< Monitor::ChannelStyle(*)>(_a[1]))); break; case 1: valueStyleChanged((*reinterpret_cast< Monitor::ValueStyle(*)>(_a[1]))); break; case 2: slotChooseFont(); break; case 3: slotChannelStyleTriggered(); break; case 4: slotValueStyleTriggered(); break; case 5: slotFixtureAdded((*reinterpret_cast< quint32(*)>(_a[1]))); break; case 6: slotFixtureChanged((*reinterpret_cast< quint32(*)>(_a[1]))); break; case 7: slotFixtureRemoved((*reinterpret_cast< quint32(*)>(_a[1]))); break; case 8: slotTimeout(); break; default: ; } _id -= 9; } return _id; }
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); }
VCSlider::VCSlider(QWidget* parent, Doc* doc) : VCWidget(parent, doc) { /* Set the class name "VCSlider" as the object name as well */ setObjectName(VCSlider::staticMetaObject.className()); m_hbox = NULL; m_topLabel = NULL; m_slider = NULL; m_bottomLabel = NULL; m_valueDisplayStyle = ExactValue; m_levelLowLimit = 0; m_levelHighLimit = UCHAR_MAX; m_levelValue = 0; m_levelValueChanged = false; m_monitorEnabled = false; m_monitorValue = 0; m_playbackFunction = Function::invalidId(); m_playbackValue = 0; m_playbackValueChanged = false; m_widgetMode = WSlider; setType(VCWidget::SliderWidget); setCaption(QString()); setFrameStyle(KVCFrameStyleSunken); /* Main VBox */ new QVBoxLayout(this); /* Top label */ m_topLabel = new QLabel(this); m_topLabel->setAlignment(Qt::AlignHCenter); layout()->addWidget(m_topLabel); /* Slider's HBox |stretch|slider|stretch| */ m_hbox = new QHBoxLayout(); /* Put stretchable space before the slider (to its left side) */ m_hbox->addStretch(); /* The slider */ m_slider = new ClickAndGoSlider(this); m_hbox->addWidget(m_slider); m_slider->setRange(0, 255); m_slider->setPageStep(1); m_slider->setInvertedAppearance(false); m_slider->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); m_slider->setMinimumWidth(32); m_slider->setMaximumWidth(80); m_slider->setStyleSheet(CNG_DEFAULT_STYLE); connect(m_slider, SIGNAL(valueChanged(int)), this, SLOT(slotSliderMoved(int))); m_externalMovement = false; /* Put stretchable space after the slider (to its right side) */ m_hbox->addStretch(); layout()->addItem(m_hbox); /* Click & Go button */ m_cngType = ClickAndGoWidget::None; m_cngButton = new QToolButton(this); m_cngButton->setFixedSize(48, 48); m_cngButton->setIconSize(QSize(42, 42)); m_menu = new QMenu(this); QWidgetAction* action = new QWidgetAction(this); m_cngWidget = new ClickAndGoWidget(); action->setDefaultWidget(m_cngWidget); m_menu->addAction(action); m_cngButton->setMenu(m_menu); m_cngButton->setPopupMode(QToolButton::InstantPopup); layout()->addWidget(m_cngButton); layout()->setAlignment(m_cngButton, Qt::AlignHCenter); m_cngButton->hide(); connect(m_cngWidget, SIGNAL(levelChanged(uchar)), this, SLOT(slotClickAndGoLevelChanged(uchar))); connect(m_cngWidget, SIGNAL(colorChanged(QRgb)), this, SLOT(slotClickAndGoColorChanged(QRgb))); connect(m_cngWidget, SIGNAL(levelAndPresetChanged(uchar,QImage)), this, SLOT(slotClickAndGoLevelAndPresetChanged(uchar, QImage))); connect(this, SIGNAL(monitorDMXValueChanged(int)), this, SLOT(slotMonitorDMXValueChanged(int))); /* Bottom label */ m_bottomLabel = new QLabel(this); layout()->addWidget(m_bottomLabel); m_bottomLabel->setAlignment(Qt::AlignCenter); m_bottomLabel->setWordWrap(true); m_bottomLabel->hide(); setMinimumSize(20, 20); QSettings settings; QVariant var = settings.value(SETTINGS_SLIDER_SIZE); if (var.isValid() == true) resize(var.toSize()); else resize(VCSlider::defaultSize); /* Initialize to playback mode by default */ setInvertedAppearance(false); m_sliderMode = SliderMode(-1); // avoid use of uninitialized value setSliderMode(Playback); /* Update the slider according to current mode */ slotModeChanged(m_doc->mode()); setLiveEdit(m_liveEdit); /* Listen to fixture removals so that LevelChannels can be removed when they no longer point to an existing fixture->channel */ connect(m_doc, SIGNAL(fixtureRemoved(quint32)), this, SLOT(slotFixtureRemoved(quint32))); }
VCSlider::VCSlider(QWidget* parent, Doc* doc, OutputMap* outputMap, InputMap* inputMap, MasterTimer* masterTimer) : VCWidget(parent, doc, outputMap, inputMap, masterTimer) { /* Set the class name "VCSlider" as the object name as well */ setObjectName(VCSlider::staticMetaObject.className()); m_hbox = NULL; m_topLabel = NULL; m_slider = NULL; m_bottomLabel = NULL; m_tapButton = NULL; m_sliderMode = Bus; m_valueDisplayStyle = ExactValue; m_levelLowLimit = 0; m_levelHighLimit = UCHAR_MAX; m_bus = Bus::defaultFade(); m_busLowLimit = KDefaultBusLowLimit; m_busHighLimit = KDefaultBusHighLimit; m_levelValue = 0; m_levelValueChanged = false; m_playbackFunction = Function::invalidId(); m_playbackValue = 0; m_playbackValueChanged = false; m_time = NULL; setCaption(QString()); setFrameStyle(KVCFrameStyleSunken); /* Main VBox */ new QVBoxLayout(this); /* Top label */ m_topLabel = new QLabel(this); layout()->addWidget(m_topLabel); m_topLabel->setAlignment(Qt::AlignHCenter); /* Slider's HBox |stretch|slider|stretch| */ m_hbox = new QHBoxLayout(); layout()->addItem(m_hbox); /* Put stretchable space before the slider (to its left side) */ m_hbox->addStretch(); /* The slider */ m_slider = new QSlider(this); m_slider->setStyle(App::saneStyle()); m_hbox->addWidget(m_slider); m_slider->setRange(KDefaultBusLowLimit * MasterTimer::frequency(), KDefaultBusHighLimit * MasterTimer::frequency()); m_slider->setPageStep(1); m_slider->setInvertedAppearance(false); connect(m_slider, SIGNAL(valueChanged(int)), this, SLOT(slotSliderMoved(int))); m_externalMovement = false; /* Put stretchable space after the slider (to its right side) */ m_hbox->addStretch(); /* Tap button */ m_tapButton = new QPushButton(this); layout()->addWidget(m_tapButton); connect(m_tapButton, SIGNAL(clicked()), this, SLOT(slotTapButtonClicked())); m_time = new QTime(); /* Bottom label */ m_bottomLabel = new QLabel(this); layout()->addWidget(m_bottomLabel); m_bottomLabel->setAlignment(Qt::AlignCenter); m_bottomLabel->hide(); setMinimumSize(VCSlider::defaultSize); resize(VCSlider::defaultSize); /* Initialize to bus mode by default */ setInvertedAppearance(true); setBus(Bus::defaultFade()); setSliderMode(Bus); /* Update the slider according to current mode */ slotModeChanged(mode()); /* Listen to fixture removals so that LevelChannels can be removed when they no longer point to an existing fixture->channel */ connect(m_doc, SIGNAL(fixtureRemoved(quint32)), this, SLOT(slotFixtureRemoved(quint32))); }
void ChannelsGroup::init() { connect(m_doc, SIGNAL(fixtureRemoved(quint32)), this, SLOT(slotFixtureRemoved(quint32))); }