Commit f31d412c6f342286578ac5382e3679034d4be388
1 parent
0c0962857e
Exists in
master
and in
2 other branches
수동 요리 기능 추가
- 요리 완료 시 문 열림 애니메이션 표출 - 문 열면 애니메이션을 숨기고 시계 표출
Showing
3 changed files
with
73 additions
and
14 deletions
Show diff stats
app/gui/oven_control/manualcookwindow.cpp
| ... | ... | @@ -240,15 +240,26 @@ void ManualCookWindow::keyReleaseEvent(QKeyEvent *event) |
| 240 | 240 | |
| 241 | 241 | void ManualCookWindow::setupAnimation() |
| 242 | 242 | { |
| 243 | - ui->openDoorAnimation->load(":/images/animation/door_big_09.png"); | |
| 244 | - ui->openDoorAnimation->load(":/images/animation/door_big_08.png"); | |
| 245 | - ui->openDoorAnimation->load(":/images/animation/door_big_07.png"); | |
| 246 | - ui->openDoorAnimation->load(":/images/animation/door_big_06.png"); | |
| 247 | - ui->openDoorAnimation->load(":/images/animation/door_big_05.png"); | |
| 248 | - ui->openDoorAnimation->load(":/images/animation/door_big_04.png"); | |
| 249 | - ui->openDoorAnimation->load(":/images/animation/door_big_03.png"); | |
| 250 | - ui->openDoorAnimation->load(":/images/animation/door_big_02.png"); | |
| 243 | + ui->closeDoorAnimation->load(":/images/animation/door_big_09.png"); | |
| 244 | + ui->closeDoorAnimation->load(":/images/animation/door_big_08.png"); | |
| 245 | + ui->closeDoorAnimation->load(":/images/animation/door_big_07.png"); | |
| 246 | + ui->closeDoorAnimation->load(":/images/animation/door_big_06.png"); | |
| 247 | + ui->closeDoorAnimation->load(":/images/animation/door_big_05.png"); | |
| 248 | + ui->closeDoorAnimation->load(":/images/animation/door_big_04.png"); | |
| 249 | + ui->closeDoorAnimation->load(":/images/animation/door_big_03.png"); | |
| 250 | + ui->closeDoorAnimation->load(":/images/animation/door_big_02.png"); | |
| 251 | + ui->closeDoorAnimation->load(":/images/animation/door_big_01.png"); | |
| 252 | + ui->closeDoorAnimation->start(300); | |
| 253 | + | |
| 251 | 254 | ui->openDoorAnimation->load(":/images/animation/door_big_01.png"); |
| 255 | + ui->openDoorAnimation->load(":/images/animation/door_big_02.png"); | |
| 256 | + ui->openDoorAnimation->load(":/images/animation/door_big_03.png"); | |
| 257 | + ui->openDoorAnimation->load(":/images/animation/door_big_04.png"); | |
| 258 | + ui->openDoorAnimation->load(":/images/animation/door_big_05.png"); | |
| 259 | + ui->openDoorAnimation->load(":/images/animation/door_big_06.png"); | |
| 260 | + ui->openDoorAnimation->load(":/images/animation/door_big_07.png"); | |
| 261 | + ui->openDoorAnimation->load(":/images/animation/door_big_08.png"); | |
| 262 | + ui->openDoorAnimation->load(":/images/animation/door_big_09.png"); | |
| 252 | 263 | ui->openDoorAnimation->start(300); |
| 253 | 264 | } |
| 254 | 265 | |
| ... | ... | @@ -475,10 +486,20 @@ QPushButton:focus { background-image: url(%2); }"); |
| 475 | 486 | |
| 476 | 487 | ui->repeatButton->setChecked(repeat); |
| 477 | 488 | |
| 478 | - if (oven->paused() && !oven->cooldown() && oven->door()) | |
| 479 | - ui->upperStack->setCurrentIndex(1); | |
| 489 | + if (done) | |
| 490 | + { | |
| 491 | + if (oven->door()) | |
| 492 | + ui->upperStack->setCurrentIndex(0); // Clock | |
| 493 | + else | |
| 494 | + ui->upperStack->setCurrentIndex(2); // Open Door | |
| 495 | + } | |
| 480 | 496 | else |
| 481 | - ui->upperStack->setCurrentIndex(0); | |
| 497 | + { | |
| 498 | + if (oven->paused() && !oven->cooldown() && oven->door()) | |
| 499 | + ui->upperStack->setCurrentIndex(1); // Close Door | |
| 500 | + else | |
| 501 | + ui->upperStack->setCurrentIndex(0); // Clock | |
| 502 | + } | |
| 482 | 503 | } |
| 483 | 504 | |
| 484 | 505 | void ManualCookWindow::showCurrentHumidity() |
| ... | ... | @@ -510,7 +531,10 @@ void ManualCookWindow::onOvenUpdated(Oven *oven) |
| 510 | 531 | updateView(); |
| 511 | 532 | |
| 512 | 533 | if (oven->interTempEnabled() && oven->currentInterTemp() >= oven->interTemp()) |
| 534 | + { | |
| 535 | + done = true; | |
| 513 | 536 | stop(); |
| 537 | + } | |
| 514 | 538 | |
| 515 | 539 | if (repeat && !oven->cooking()) |
| 516 | 540 | { |
| ... | ... | @@ -530,10 +554,13 @@ void ManualCookWindow::onOvenUpdated(Oven *oven) |
| 530 | 554 | || oven->time() == 0) |
| 531 | 555 | { |
| 532 | 556 | lastCheckedCooking = oven->cooking(); |
| 533 | - emit done(); | |
| 557 | + done = true; | |
| 534 | 558 | } |
| 535 | 559 | } |
| 536 | 560 | |
| 561 | + if (done && oven->door()) | |
| 562 | + done = false; | |
| 563 | + | |
| 537 | 564 | lastCheckedCooking = oven->cooking(); |
| 538 | 565 | |
| 539 | 566 | if (oven->paused() && oven->door()) |
| ... | ... | @@ -568,6 +595,8 @@ void ManualCookWindow::start() |
| 568 | 595 | |
| 569 | 596 | if (oven->time() > 0) |
| 570 | 597 | { |
| 598 | + done = false; | |
| 599 | + | |
| 571 | 600 | SoundPlayer::playStart(); |
| 572 | 601 | |
| 573 | 602 | if (startCookingTimer.isActive()) | ... | ... |
app/gui/oven_control/manualcookwindow.h
| ... | ... | @@ -27,7 +27,6 @@ protected: |
| 27 | 27 | |
| 28 | 28 | signals: |
| 29 | 29 | void cookStopRequested(); |
| 30 | - void done(); | |
| 31 | 30 | |
| 32 | 31 | public slots: |
| 33 | 32 | |
| ... | ... | @@ -135,6 +134,7 @@ private: |
| 135 | 134 | QTimer monitor3; |
| 136 | 135 | bool monitorTriggered; |
| 137 | 136 | |
| 137 | + bool done; | |
| 138 | 138 | |
| 139 | 139 | ManualCookSetting repeatSetting; |
| 140 | 140 | bool repeat; | ... | ... |
app/gui/oven_control/manualcookwindow.ui
| ... | ... | @@ -136,7 +136,7 @@ height: 33px; |
| 136 | 136 | <property name="styleSheet"> |
| 137 | 137 | <string notr="true">#closeDoorWidget { background-image: url(:/images/clock/background.png); }</string> |
| 138 | 138 | </property> |
| 139 | - <widget class="AnimatedImageBox" name="openDoorAnimation"> | |
| 139 | + <widget class="AnimatedImageBox" name="closeDoorAnimation"> | |
| 140 | 140 | <property name="geometry"> |
| 141 | 141 | <rect> |
| 142 | 142 | <x>366</x> |
| ... | ... | @@ -160,6 +160,36 @@ height: 33px; |
| 160 | 160 | </property> |
| 161 | 161 | </widget> |
| 162 | 162 | </widget> |
| 163 | + <widget class="QWidget" name="openDoorWidget"> | |
| 164 | + <property name="styleSheet"> | |
| 165 | + <string notr="true">#openDoorWidget { background-image: url(:/images/clock/background.png); }</string> | |
| 166 | + </property> | |
| 167 | + <widget class="QLabel" name="label_7"> | |
| 168 | + <property name="geometry"> | |
| 169 | + <rect> | |
| 170 | + <x>430</x> | |
| 171 | + <y>170</y> | |
| 172 | + <width>85</width> | |
| 173 | + <height>24</height> | |
| 174 | + </rect> | |
| 175 | + </property> | |
| 176 | + <property name="pixmap"> | |
| 177 | + <pixmap resource="resources.qrc">:/images/animation/open_door_arrow.png</pixmap> | |
| 178 | + </property> | |
| 179 | + </widget> | |
| 180 | + <widget class="AnimatedImageBox" name="openDoorAnimation"> | |
| 181 | + <property name="geometry"> | |
| 182 | + <rect> | |
| 183 | + <x>366</x> | |
| 184 | + <y>20</y> | |
| 185 | + <width>251</width> | |
| 186 | + <height>292</height> | |
| 187 | + </rect> | |
| 188 | + </property> | |
| 189 | + </widget> | |
| 190 | + <zorder>openDoorAnimation</zorder> | |
| 191 | + <zorder>label_7</zorder> | |
| 192 | + </widget> | |
| 163 | 193 | </widget> |
| 164 | 194 | <widget class="QPushButton" name="combiButton"> |
| 165 | 195 | <property name="geometry"> | ... | ... |