Commit 347c46873604d5e5dfb2d8115a34753338927bf5
1 parent
f5daa9571a
Exists in
master
and in
2 other branches
done 시그널을 안 쓰는 줄 알았는데, 아니었음. 복원함
Showing
2 changed files
with
14 additions
and
9 deletions
Show diff stats
app/gui/oven_control/manualcookwindow.cpp
| @@ -27,7 +27,8 @@ | @@ -27,7 +27,8 @@ | ||
| 27 | ManualCookWindow::ManualCookWindow(QWidget *parent, Define::Mode mode) : | 27 | ManualCookWindow::ManualCookWindow(QWidget *parent, Define::Mode mode) : |
| 28 | QMainWindow(parent), | 28 | QMainWindow(parent), |
| 29 | ui(new Ui::ManualCookWindow), | 29 | ui(new Ui::ManualCookWindow), |
| 30 | - repeat(false) | 30 | + repeat(false), |
| 31 | + cookDone(false) | ||
| 31 | { | 32 | { |
| 32 | ui->setupUi(this); | 33 | ui->setupUi(this); |
| 33 | 34 | ||
| @@ -486,7 +487,7 @@ QPushButton:focus { background-image: url(%2); }"); | @@ -486,7 +487,7 @@ QPushButton:focus { background-image: url(%2); }"); | ||
| 486 | 487 | ||
| 487 | ui->repeatButton->setChecked(repeat); | 488 | ui->repeatButton->setChecked(repeat); |
| 488 | 489 | ||
| 489 | - if (done) | 490 | + if (cookDone) |
| 490 | { | 491 | { |
| 491 | if (oven->door()) | 492 | if (oven->door()) |
| 492 | ui->upperStack->setCurrentIndex(0); // Clock | 493 | ui->upperStack->setCurrentIndex(0); // Clock |
| @@ -532,7 +533,7 @@ void ManualCookWindow::onOvenUpdated(Oven *oven) | @@ -532,7 +533,7 @@ void ManualCookWindow::onOvenUpdated(Oven *oven) | ||
| 532 | 533 | ||
| 533 | if (oven->interTempEnabled() && oven->currentInterTemp() >= oven->interTemp()) | 534 | if (oven->interTempEnabled() && oven->currentInterTemp() >= oven->interTemp()) |
| 534 | { | 535 | { |
| 535 | - done = true; | 536 | + cookDone = true; |
| 536 | stop(); | 537 | stop(); |
| 537 | } | 538 | } |
| 538 | 539 | ||
| @@ -549,17 +550,20 @@ void ManualCookWindow::onOvenUpdated(Oven *oven) | @@ -549,17 +550,20 @@ void ManualCookWindow::onOvenUpdated(Oven *oven) | ||
| 549 | 550 | ||
| 550 | updateView(); | 551 | updateView(); |
| 551 | } | 552 | } |
| 552 | - else if (lastCheckedCooking && !oven->cooking()){ | 553 | + else if (lastCheckedCooking && !oven->cooking()) |
| 554 | + { | ||
| 553 | if ((oven->interTempEnabled() && oven->currentInterTemp() >= oven->interTemp()) | 555 | if ((oven->interTempEnabled() && oven->currentInterTemp() >= oven->interTemp()) |
| 554 | || oven->time() == 0) | 556 | || oven->time() == 0) |
| 555 | { | 557 | { |
| 556 | lastCheckedCooking = oven->cooking(); | 558 | lastCheckedCooking = oven->cooking(); |
| 557 | - done = true; | 559 | + cookDone = true; |
| 560 | + | ||
| 561 | + emit done(); | ||
| 558 | } | 562 | } |
| 559 | } | 563 | } |
| 560 | 564 | ||
| 561 | - if (done && oven->door()) | ||
| 562 | - done = false; | 565 | + if (cookDone && oven->door()) |
| 566 | + cookDone = false; | ||
| 563 | 567 | ||
| 564 | lastCheckedCooking = oven->cooking(); | 568 | lastCheckedCooking = oven->cooking(); |
| 565 | 569 | ||
| @@ -595,7 +599,7 @@ void ManualCookWindow::start() | @@ -595,7 +599,7 @@ void ManualCookWindow::start() | ||
| 595 | 599 | ||
| 596 | if (oven->time() > 0) | 600 | if (oven->time() > 0) |
| 597 | { | 601 | { |
| 598 | - done = false; | 602 | + cookDone = false; |
| 599 | 603 | ||
| 600 | SoundPlayer::playStart(); | 604 | SoundPlayer::playStart(); |
| 601 | 605 |
app/gui/oven_control/manualcookwindow.h
| @@ -27,6 +27,7 @@ protected: | @@ -27,6 +27,7 @@ protected: | ||
| 27 | 27 | ||
| 28 | signals: | 28 | signals: |
| 29 | void cookStopRequested(); | 29 | void cookStopRequested(); |
| 30 | + void done(); | ||
| 30 | 31 | ||
| 31 | public slots: | 32 | public slots: |
| 32 | 33 | ||
| @@ -134,7 +135,7 @@ private: | @@ -134,7 +135,7 @@ private: | ||
| 134 | QTimer monitor3; | 135 | QTimer monitor3; |
| 135 | bool monitorTriggered; | 136 | bool monitorTriggered; |
| 136 | 137 | ||
| 137 | - bool done; | 138 | + bool cookDone; |
| 138 | 139 | ||
| 139 | ManualCookSetting repeatSetting; | 140 | ManualCookSetting repeatSetting; |
| 140 | bool repeat; | 141 | bool repeat; |