Skip to content

Commit b8a5ba5

Browse files
committed
fix
1 parent 744203a commit b8a5ba5

File tree

9 files changed

+33
-193
lines changed

9 files changed

+33
-193
lines changed

toonz/sources/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ find_package(Qt5 REQUIRED
253253
LinguistTools
254254
Multimedia
255255
MultimediaWidgets
256-
SerialPort
257256
)
258257

259258
set(QT_MINIMUM_VERSION 5.5.0)

toonz/sources/stopmotion/canon.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,10 +1328,10 @@ EdsError Canon::handlePropertyEvent(EdsPropertyEvent event,
13281328
EdsError Canon::handleStateEvent(EdsStateEvent event, EdsUInt32 parameter,
13291329
EdsVoid* context) {
13301330
if (event == kEdsStateEvent_Shutdown) {
1331-
instance()->m_sessionOpen = false;
1332-
instance()->releaseCamera();
1331+
instance()->m_sessionOpen = false;
1332+
instance()->releaseCamera();
13331333
if (instance()->m_sessionOpen && instance()->getCameraCount() > 0) {
1334-
//instance()->closeCameraSession();
1334+
// instance()->closeCameraSession();
13351335
}
13361336
StopMotion::instance()->m_liveViewStatus = 0;
13371337
emit(instance()->canonCameraChanged(QString("")));

toonz/sources/stopmotion/stopmotion.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ StopMotion::StopMotion() {
207207

208208
m_webcam = new Webcam();
209209
m_canon = Canon::instance();
210-
m_serial = new StopMotionSerial();
211210
m_light = new StopMotionLight();
212211

213212
m_alwaysLiveView = StopMotionAlwaysLiveView;
@@ -309,7 +308,7 @@ void StopMotion::onSceneSwitched() {
309308
setXSheetFrameNumber(xsh->getFrameCount() + 1);
310309
loadXmlFile();
311310
buildLiveViewMap(sl);
312-
m_sl = sl;
311+
m_sl = sl;
313312
found = true;
314313
break;
315314
}
@@ -1001,7 +1000,6 @@ void StopMotion::setXSheetFrameNumber(int frameNumber) {
10011000
TApp::instance()->getCurrentFrame()->setFrame(frameNumber - 1);
10021001
loadLineUpImage();
10031002
emit(xSheetFrameNumberChanged(m_xSheetFrameNumber));
1004-
m_serial->sendSerialData();
10051003
TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
10061004
}
10071005

toonz/sources/stopmotion/stopmotion.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "webcam.h"
2121
#include "jpgconverter.h"
2222
#include "canon.h"
23-
#include "stopmotionserial.h"
2423
#include "stopmotionlight.h"
2524

2625
#include "toonz/txshsimplelevel.h"
@@ -78,7 +77,6 @@ class StopMotion : public QObject { // Singleton
7877

7978
Webcam* m_webcam;
8079
Canon* m_canon;
81-
StopMotionSerial* m_serial;
8280
StopMotionLight* m_light;
8381

8482
bool m_usingWebcam = false;

toonz/sources/stopmotion/stopmotioncontroller.cpp

Lines changed: 23 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
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) {
13221295
void 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) {
13961367
void 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) {
14041376
void 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) {
14121385
void 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+
14331425
void 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-
27692755
void StopMotionController::updateStopMotion() {}

toonz/sources/stopmotion/stopmotioncontroller.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ class StopMotionController final : public QWidget {
6767
QFrame *m_mainControlsPage;
6868
QFrame *m_cameraSettingsPage;
6969
QFrame *m_optionsPage;
70-
QFrame *m_motionPage;
7170
QFrame *m_lightPage;
7271
QFrame *m_dslrFrame;
7372
QFrame *m_webcamFrame;
@@ -123,6 +122,7 @@ class StopMotionController final : public QWidget {
123122
// void mousePressEvent(QMouseEvent *event) override;
124123
// void keyPressEvent(QKeyEvent *event);
125124
void keyPressEvent(QKeyEvent *event) override;
125+
void updateLightsEnabled();
126126

127127
protected slots:
128128
void refreshCameraList(QString activeCamera = "");
@@ -164,9 +164,6 @@ protected slots:
164164
void onNextXSheetFrame();
165165
void setToCurrentXSheetFrame();
166166

167-
// motion control
168-
void serialPortChanged(int);
169-
170167
// time lapse
171168
void onIntervalTimerCBToggled(bool);
172169
void onIntervalSliderValueChanged(bool);

toonz/sources/stopmotion/stopmotionserial.cpp

Lines changed: 0 additions & 106 deletions
This file was deleted.

toonz/sources/stopmotion/stopmotionserial.h

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)