5353#include < QTimer>
5454#include < QToolButton>
5555#include < QToolTip>
56- #include < QSerialPort>
5756
5857#ifdef _WIN32
5958#include < dshow.h>
@@ -184,12 +183,10 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) {
184183 m_tabBar->addSimpleTab (tr (" Settings" ));
185184 m_tabBar->addSimpleTab (tr (" Options" ));
186185 m_tabBar->addSimpleTab (tr (" Light" ));
187- m_tabBar->addSimpleTab (tr (" Motion" ));
188186 m_tabBarContainer = new TabBarContainter (this );
189187 m_mainControlsPage = new QFrame (this );
190188 m_cameraSettingsPage = new QFrame (this );
191189 m_optionsPage = new QFrame (this );
192- m_motionPage = new QFrame (this );
193190 m_lightPage = new QFrame (this );
194191
195192 // **********************
@@ -853,44 +850,22 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) {
853850 if (m_stopMotion->m_light ->m_screenCount < 3 ) m_screen3Box->hide ();
854851 if (m_stopMotion->m_light ->m_screenCount < 2 ) m_screen2Box->hide ();
855852
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-
875853 QScrollArea *mainArea = makeChooserPageWithoutScrollBar (m_mainControlsPage);
876854 QScrollArea *settingsArea =
877855 makeChooserPageWithoutScrollBar (m_cameraSettingsPage);
878856 QScrollArea *optionsArea = makeChooserPageWithoutScrollBar (m_optionsPage);
879857 QScrollArea *lightArea = makeChooserPageWithoutScrollBar (m_lightPage);
880- QScrollArea *motionArea = makeChooserPageWithoutScrollBar (m_motionPage);
881858
882859 mainArea->setVerticalScrollBarPolicy (Qt::ScrollBarAsNeeded);
883860 settingsArea->setVerticalScrollBarPolicy (Qt::ScrollBarAsNeeded);
884861 optionsArea->setVerticalScrollBarPolicy (Qt::ScrollBarAsNeeded);
885862 lightArea->setVerticalScrollBarPolicy (Qt::ScrollBarAsNeeded);
886- motionArea->setVerticalScrollBarPolicy (Qt::ScrollBarAsNeeded);
887863
888864 m_stackedChooser = new QStackedWidget (this );
889865 m_stackedChooser->addWidget (mainArea);
890866 m_stackedChooser->addWidget (settingsArea);
891867 m_stackedChooser->addWidget (optionsArea);
892868 m_stackedChooser->addWidget (lightArea);
893- m_stackedChooser->addWidget (motionArea);
894869 m_stackedChooser->setFocusPolicy (Qt::NoFocus);
895870
896871 QFrame *opacityFrame = new QFrame ();
@@ -1218,10 +1193,6 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) {
12181193 ret = ret && connect (m_stopMotion->m_light , SIGNAL (blackCaptureSignal (bool )),
12191194 this , SLOT (onBlackCaptureSignal (bool )));
12201195
1221- // Serial Port Connections
1222- ret = ret && connect (m_controlDeviceCombo, SIGNAL (currentIndexChanged (int )),
1223- this , SLOT (serialPortChanged (int )));
1224-
12251196 // Time Lapse
12261197 ret = ret && connect (m_timerCB, SIGNAL (toggled (bool )), this ,
12271198 SLOT (onIntervalTimerCBToggled (bool )));
@@ -1265,6 +1236,7 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) {
12651236 onSceneSwitched ();
12661237 m_stopMotion->setToNextNewLevel ();
12671238 m_saveInFileFld->setPath (m_stopMotion->getFilePath ());
1239+ updateLightsEnabled ();
12681240
12691241#ifndef _WIN32
12701242 m_directShowCB->hide ();
@@ -1322,9 +1294,7 @@ void StopMotionController::onBlackScreenForCaptureChanged(int checked) {
13221294void StopMotionController::onBlackCaptureSignal (bool on) {
13231295 m_blackScreenForCapture->blockSignals (true );
13241296 m_blackScreenForCapture->setChecked (on);
1325- m_screen1Box->setDisabled (on);
1326- m_screen2Box->setDisabled (on);
1327- m_screen3Box->setDisabled (on);
1297+ updateLightsEnabled ();
13281298 m_blackScreenForCapture->blockSignals (false );
13291299}
13301300
@@ -1396,6 +1366,7 @@ void StopMotionController::onScreen3ColorChanged(TPixel32 color) {
13961366void StopMotionController::onScreen1OverlayChanged (bool on) {
13971367 m_screen1Box->blockSignals (true );
13981368 m_screen1Box->setChecked (on);
1369+ updateLightsEnabled ();
13991370 m_screen1Box->blockSignals (false );
14001371}
14011372
@@ -1404,6 +1375,7 @@ void StopMotionController::onScreen1OverlayChanged(bool on) {
14041375void StopMotionController::onScreen2OverlayChanged (bool on) {
14051376 m_screen2Box->blockSignals (true );
14061377 m_screen2Box->setChecked (on);
1378+ updateLightsEnabled ();
14071379 m_screen2Box->blockSignals (false );
14081380}
14091381
@@ -1412,6 +1384,7 @@ void StopMotionController::onScreen2OverlayChanged(bool on) {
14121384void StopMotionController::onScreen3OverlayChanged (bool on) {
14131385 m_screen3Box->blockSignals (true );
14141386 m_screen3Box->setChecked (on);
1387+ updateLightsEnabled ();
14151388 m_screen3Box->blockSignals (false );
14161389}
14171390
@@ -1430,6 +1403,24 @@ void StopMotionController::onTestLightsTimeout() {
14301403
14311404// -----------------------------------------------------------------------------
14321405
1406+ void StopMotionController::updateLightsEnabled () {
1407+ bool enabled = true ;
1408+ if (m_blackScreenForCapture->isChecked ()) {
1409+ enabled = false ;
1410+ }
1411+ m_screen1Box->setEnabled (enabled);
1412+ m_screen2Box->setEnabled (enabled);
1413+ m_screen3Box->setEnabled (enabled);
1414+ if (m_blackScreenForCapture->isChecked () || m_screen1Box->isChecked () ||
1415+ m_screen2Box->isChecked () || m_screen3Box->isChecked ()) {
1416+ m_testLightsButton->setEnabled (true );
1417+ } else {
1418+ m_testLightsButton->setEnabled (false );
1419+ }
1420+ }
1421+
1422+ // -----------------------------------------------------------------------------
1423+
14331424void StopMotionController::onPlaceOnXSheetChanged (int checked) {
14341425 m_stopMotion->setPlaceOnXSheet (checked);
14351426}
@@ -2760,10 +2751,4 @@ void StopMotionController::onSceneSwitched() {
27602751
27612752// -----------------------------------------------------------------------------
27622753
2763- void StopMotionController::serialPortChanged (int index) {
2764- m_stopMotion->m_serial ->setSerialPort (m_controlDeviceCombo->currentText ());
2765- }
2766-
2767- // -----------------------------------------------------------------------------
2768-
27692754void StopMotionController::updateStopMotion () {}
0 commit comments