5353#include < QTimer>
5454#include < QToolButton>
5555#include < QToolTip>
56- #include < QSerialPort>
5756
5857#ifdef _WIN32
5958#include < dshow.h>
@@ -189,7 +188,6 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) {
189188 m_mainControlsPage = new QFrame (this );
190189 m_cameraSettingsPage = new QFrame (this );
191190 m_optionsPage = new QFrame (this );
192- m_motionPage = new QFrame (this );
193191 m_lightPage = new QFrame (this );
194192
195193 // **********************
@@ -853,44 +851,22 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) {
853851 if (m_stopMotion->m_light ->m_screenCount < 3 ) m_screen3Box->hide ();
854852 if (m_stopMotion->m_light ->m_screenCount < 2 ) m_screen2Box->hide ();
855853
856- QVBoxLayout *motionOutsideLayout = new QVBoxLayout;
857- // QGridLayout* motionInsideLayout = new QGridLayout;
858- m_controlDeviceCombo = new QComboBox (this );
859- m_controlDeviceCombo->addItems (
860- m_stopMotion->m_serial ->getAvailableSerialPorts ());
861-
862- QGroupBox *motionBox = new QGroupBox (tr (" Motion Control" ), this );
863- QGridLayout *motionLayout = new QGridLayout;
864- motionLayout->addWidget (new QLabel (tr (" Port: " )), 0 , 0 , Qt::AlignRight);
865- motionLayout->addWidget (m_controlDeviceCombo, 0 , 1 , Qt::AlignLeft);
866- motionLayout->setColumnStretch (1 , 30 );
867- motionBox->setLayout (motionLayout);
868- motionBox->setSizePolicy (QSizePolicy::Minimum, QSizePolicy::Maximum);
869- motionOutsideLayout->addWidget (motionBox, Qt::AlignCenter);
870- motionOutsideLayout->addStretch ();
871-
872- // motionOutsideLayout->addLayout(motionInsideLayout);
873- m_motionPage->setLayout (motionOutsideLayout);
874-
875854 QScrollArea *mainArea = makeChooserPageWithoutScrollBar (m_mainControlsPage);
876855 QScrollArea *settingsArea =
877856 makeChooserPageWithoutScrollBar (m_cameraSettingsPage);
878857 QScrollArea *optionsArea = makeChooserPageWithoutScrollBar (m_optionsPage);
879858 QScrollArea *lightArea = makeChooserPageWithoutScrollBar (m_lightPage);
880- QScrollArea *motionArea = makeChooserPageWithoutScrollBar (m_motionPage);
881859
882860 mainArea->setVerticalScrollBarPolicy (Qt::ScrollBarAsNeeded);
883861 settingsArea->setVerticalScrollBarPolicy (Qt::ScrollBarAsNeeded);
884862 optionsArea->setVerticalScrollBarPolicy (Qt::ScrollBarAsNeeded);
885863 lightArea->setVerticalScrollBarPolicy (Qt::ScrollBarAsNeeded);
886- motionArea->setVerticalScrollBarPolicy (Qt::ScrollBarAsNeeded);
887864
888865 m_stackedChooser = new QStackedWidget (this );
889866 m_stackedChooser->addWidget (mainArea);
890867 m_stackedChooser->addWidget (settingsArea);
891868 m_stackedChooser->addWidget (optionsArea);
892869 m_stackedChooser->addWidget (lightArea);
893- m_stackedChooser->addWidget (motionArea);
894870 m_stackedChooser->setFocusPolicy (Qt::NoFocus);
895871
896872 QFrame *opacityFrame = new QFrame ();
@@ -1218,10 +1194,6 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) {
12181194 ret = ret && connect (m_stopMotion->m_light , SIGNAL (blackCaptureSignal (bool )),
12191195 this , SLOT (onBlackCaptureSignal (bool )));
12201196
1221- // Serial Port Connections
1222- ret = ret && connect (m_controlDeviceCombo, SIGNAL (currentIndexChanged (int )),
1223- this , SLOT (serialPortChanged (int )));
1224-
12251197 // Time Lapse
12261198 ret = ret && connect (m_timerCB, SIGNAL (toggled (bool )), this ,
12271199 SLOT (onIntervalTimerCBToggled (bool )));
@@ -1265,6 +1237,7 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) {
12651237 onSceneSwitched ();
12661238 m_stopMotion->setToNextNewLevel ();
12671239 m_saveInFileFld->setPath (m_stopMotion->getFilePath ());
1240+ updateLightsEnabled ();
12681241
12691242#ifndef _WIN32
12701243 m_directShowCB->hide ();
@@ -1322,9 +1295,7 @@ void StopMotionController::onBlackScreenForCaptureChanged(int checked) {
13221295void StopMotionController::onBlackCaptureSignal (bool on) {
13231296 m_blackScreenForCapture->blockSignals (true );
13241297 m_blackScreenForCapture->setChecked (on);
1325- m_screen1Box->setDisabled (on);
1326- m_screen2Box->setDisabled (on);
1327- m_screen3Box->setDisabled (on);
1298+ updateLightsEnabled ();
13281299 m_blackScreenForCapture->blockSignals (false );
13291300}
13301301
@@ -1396,6 +1367,7 @@ void StopMotionController::onScreen3ColorChanged(TPixel32 color) {
13961367void StopMotionController::onScreen1OverlayChanged (bool on) {
13971368 m_screen1Box->blockSignals (true );
13981369 m_screen1Box->setChecked (on);
1370+ updateLightsEnabled ();
13991371 m_screen1Box->blockSignals (false );
14001372}
14011373
@@ -1404,6 +1376,7 @@ void StopMotionController::onScreen1OverlayChanged(bool on) {
14041376void StopMotionController::onScreen2OverlayChanged (bool on) {
14051377 m_screen2Box->blockSignals (true );
14061378 m_screen2Box->setChecked (on);
1379+ updateLightsEnabled ();
14071380 m_screen2Box->blockSignals (false );
14081381}
14091382
@@ -1412,6 +1385,7 @@ void StopMotionController::onScreen2OverlayChanged(bool on) {
14121385void StopMotionController::onScreen3OverlayChanged (bool on) {
14131386 m_screen3Box->blockSignals (true );
14141387 m_screen3Box->setChecked (on);
1388+ updateLightsEnabled ();
14151389 m_screen3Box->blockSignals (false );
14161390}
14171391
@@ -1430,6 +1404,24 @@ void StopMotionController::onTestLightsTimeout() {
14301404
14311405// -----------------------------------------------------------------------------
14321406
1407+ void StopMotionController::updateLightsEnabled () {
1408+ bool enabled = true ;
1409+ if (m_blackScreenForCapture->isChecked ()) {
1410+ enabled = false ;
1411+ }
1412+ m_screen1Box->setEnabled (enabled);
1413+ m_screen2Box->setEnabled (enabled);
1414+ m_screen3Box->setEnabled (enabled);
1415+ if (m_blackScreenForCapture->isChecked () || m_screen1Box->isChecked () ||
1416+ m_screen2Box->isChecked () || m_screen3Box->isChecked ()) {
1417+ m_testLightsButton->setEnabled (true );
1418+ } else {
1419+ m_testLightsButton->setEnabled (false );
1420+ }
1421+ }
1422+
1423+ // -----------------------------------------------------------------------------
1424+
14331425void StopMotionController::onPlaceOnXSheetChanged (int checked) {
14341426 m_stopMotion->setPlaceOnXSheet (checked);
14351427}
@@ -2760,10 +2752,4 @@ void StopMotionController::onSceneSwitched() {
27602752
27612753// -----------------------------------------------------------------------------
27622754
2763- void StopMotionController::serialPortChanged (int index) {
2764- m_stopMotion->m_serial ->setSerialPort (m_controlDeviceCombo->currentText ());
2765- }
2766-
2767- // -----------------------------------------------------------------------------
2768-
27692755void StopMotionController::updateStopMotion () {}
0 commit comments