Commit 213c241355801c7a51e9222d5a15fc5b12ad7178
1 parent
bed08d5f8a
Exists in
master
and in
2 other branches
수동 요리 반복 추가
Showing
3 changed files
with
87 additions
and
16 deletions
Show diff stats
app/gui/oven_control/manualcookwindow.cpp
| @@ -19,7 +19,8 @@ | @@ -19,7 +19,8 @@ | ||
| 19 | 19 | ||
| 20 | ManualCookWindow::ManualCookWindow(QWidget *parent, Define::Mode mode) : | 20 | ManualCookWindow::ManualCookWindow(QWidget *parent, Define::Mode mode) : |
| 21 | QMainWindow(parent), | 21 | QMainWindow(parent), |
| 22 | - ui(new Ui::ManualCookWindow) | 22 | + ui(new Ui::ManualCookWindow), |
| 23 | + repeat(false) | ||
| 23 | { | 24 | { |
| 24 | ui->setupUi(this); | 25 | ui->setupUi(this); |
| 25 | 26 | ||
| @@ -43,15 +44,15 @@ ManualCookWindow::ManualCookWindow(QWidget *parent, Define::Mode mode) : | @@ -43,15 +44,15 @@ ManualCookWindow::ManualCookWindow(QWidget *parent, Define::Mode mode) : | ||
| 43 | connect(ui->interTempSlider, SIGNAL(sliderMoved(int)), this, SLOT(updateLabels())); | 44 | connect(ui->interTempSlider, SIGNAL(sliderMoved(int)), this, SLOT(updateLabels())); |
| 44 | 45 | ||
| 45 | startCookingTimer.setSingleShot(true); | 46 | startCookingTimer.setSingleShot(true); |
| 46 | - startCookingTimer.setInterval(3000); | 47 | + startCookingTimer.setInterval(2000); |
| 47 | connect(&startCookingTimer, SIGNAL(timeout()), SLOT(start())); | 48 | connect(&startCookingTimer, SIGNAL(timeout()), SLOT(start())); |
| 48 | 49 | ||
| 49 | showCurrentHumidityTimer.setSingleShot(true); | 50 | showCurrentHumidityTimer.setSingleShot(true); |
| 50 | - showCurrentHumidityTimer.setInterval(3000); | 51 | + showCurrentHumidityTimer.setInterval(2000); |
| 51 | connect(&showCurrentHumidityTimer, SIGNAL(timeout()), SLOT(showCurrentHumidity())); | 52 | connect(&showCurrentHumidityTimer, SIGNAL(timeout()), SLOT(showCurrentHumidity())); |
| 52 | 53 | ||
| 53 | showCurrentTempTimer.setSingleShot(true); | 54 | showCurrentTempTimer.setSingleShot(true); |
| 54 | - showCurrentTempTimer.setInterval(3000); | 55 | + showCurrentTempTimer.setInterval(2000); |
| 55 | connect(&showCurrentTempTimer, SIGNAL(timeout()), SLOT(showCurrentTemp())); | 56 | connect(&showCurrentTempTimer, SIGNAL(timeout()), SLOT(showCurrentTemp())); |
| 56 | 57 | ||
| 57 | oven->setDefault(mode); | 58 | oven->setDefault(mode); |
| @@ -115,6 +116,22 @@ void ManualCookWindow::checkTime() | @@ -115,6 +116,22 @@ void ManualCookWindow::checkTime() | ||
| 115 | { | 116 | { |
| 116 | oven->stopCooking(); | 117 | oven->stopCooking(); |
| 117 | } | 118 | } |
| 119 | + | ||
| 120 | + if (repeat && !oven->cooking()) | ||
| 121 | + { | ||
| 122 | + repeat = false; | ||
| 123 | + | ||
| 124 | + ui->repeatButton->setStyleSheet("\ | ||
| 125 | +QPushButton { background-image: url(:/images/manual_button/repeat.png); }\ | ||
| 126 | +QPushButton:pressed { background-image: url(:/images/manual_button/repeat_ov.png); }"); | ||
| 127 | + | ||
| 128 | + oven->setMode(repeatSetting.mode); | ||
| 129 | + oven->setHumidity(repeatSetting.humidity); | ||
| 130 | + oven->setTemp(repeatSetting.temp); | ||
| 131 | + oven->setTime(repeatSetting.time); | ||
| 132 | + oven->setInterTempEnabled(repeatSetting.coreTempEnabled); | ||
| 133 | + oven->setInterTemp(repeatSetting.coreTemp); | ||
| 134 | + } | ||
| 118 | } | 135 | } |
| 119 | 136 | ||
| 120 | void ManualCookWindow::showCurrentHumidity() | 137 | void ManualCookWindow::showCurrentHumidity() |
| @@ -300,6 +317,19 @@ QPushButton:pressed {\ | @@ -300,6 +317,19 @@ QPushButton:pressed {\ | ||
| 300 | else | 317 | else |
| 301 | ui->upperStack->setCurrentIndex(0); | 318 | ui->upperStack->setCurrentIndex(0); |
| 302 | 319 | ||
| 320 | + if (oven->cooking() || oven->cooldown() || oven->preheating()) | ||
| 321 | + { | ||
| 322 | + ui->reserveButton->hide(); | ||
| 323 | + ui->favoriteButton->hide(); | ||
| 324 | + ui->repeatButton->show(); | ||
| 325 | + } | ||
| 326 | + else | ||
| 327 | + { | ||
| 328 | + ui->reserveButton->show(); | ||
| 329 | + ui->favoriteButton->show(); | ||
| 330 | + ui->repeatButton->hide(); | ||
| 331 | + } | ||
| 332 | + | ||
| 303 | updateLabels(); | 333 | updateLabels(); |
| 304 | } | 334 | } |
| 305 | 335 | ||
| @@ -442,7 +472,26 @@ void ManualCookWindow::on_humidificationButton_clicked() | @@ -442,7 +472,26 @@ void ManualCookWindow::on_humidificationButton_clicked() | ||
| 442 | 472 | ||
| 443 | void ManualCookWindow::on_repeatButton_clicked() | 473 | void ManualCookWindow::on_repeatButton_clicked() |
| 444 | { | 474 | { |
| 445 | - | 475 | + if (repeat) |
| 476 | + { | ||
| 477 | + repeat = false; | ||
| 478 | + ui->repeatButton->setStyleSheet("\ | ||
| 479 | +QPushButton { background-image: url(:/images/manual_button/repeat.png); }\ | ||
| 480 | +QPushButton:pressed { background-image: url(:/images/manual_button/repeat_ov.png); }"); | ||
| 481 | + } | ||
| 482 | + else | ||
| 483 | + { | ||
| 484 | + repeat = true; | ||
| 485 | + ui->repeatButton->setStyleSheet("\ | ||
| 486 | +QPushButton { background-image: url(:/images/manual_button/repeat_ov.png); }\ | ||
| 487 | +QPushButton:pressed { background-image: url(:/images/manual_button/repeat.png); }"); | ||
| 488 | + repeatSetting.mode = oven->mode(); | ||
| 489 | + repeatSetting.humidity = oven->humidity(); | ||
| 490 | + repeatSetting.temp= oven->temp(); | ||
| 491 | + repeatSetting.time = oven->time(); | ||
| 492 | + repeatSetting.coreTempEnabled = oven->interTempEnabled(); | ||
| 493 | + repeatSetting.coreTemp = oven->interTemp(); | ||
| 494 | + } | ||
| 446 | } | 495 | } |
| 447 | 496 | ||
| 448 | void ManualCookWindow::on_cooldownButton_clicked() | 497 | void ManualCookWindow::on_cooldownButton_clicked() |
| @@ -456,10 +505,29 @@ void ManualCookWindow::on_cooldownButton_clicked() | @@ -456,10 +505,29 @@ void ManualCookWindow::on_cooldownButton_clicked() | ||
| 456 | 505 | ||
| 457 | void ManualCookWindow::on_reserveButton_clicked() | 506 | void ManualCookWindow::on_reserveButton_clicked() |
| 458 | { | 507 | { |
| 459 | - | ||
| 460 | -} | ||
| 461 | - | ||
| 462 | -void ManualCookWindow::on_favoritesButton_clicked() | 508 | +// if (isReserved) |
| 509 | +// { | ||
| 510 | +// isReserved = false; | ||
| 511 | +// ui->reserveButton->setStyleSheet("\ | ||
| 512 | +//QPushButton { background-image: url(:/images/manual_button/reserve.png); }\ | ||
| 513 | +//QPushButton:pressed { background-image: url(:/images/manual_button/reserve_ov.png); }"); | ||
| 514 | +// } | ||
| 515 | +// else | ||
| 516 | +// { | ||
| 517 | +// isReserved = true; | ||
| 518 | +// ui->reserveButton->setStyleSheet("\ | ||
| 519 | +//QPushButton { background-image: url(:/images/manual_button/reserve_ov.png); }\ | ||
| 520 | +//QPushButton:pressed { background-image: url(:/images/manual_button/reserve.png); }"); | ||
| 521 | +// reserved.mode = oven->mode(); | ||
| 522 | +// reserved.humidity = oven->humidity(); | ||
| 523 | +// reserved.temp= oven->temp(); | ||
| 524 | +// reserved.time = oven->time(); | ||
| 525 | +// reserved.coreTempEnabled = oven->interTempEnabled(); | ||
| 526 | +// reserved.coreTemp = oven->interTemp(); | ||
| 527 | +// } | ||
| 528 | +} | ||
| 529 | + | ||
| 530 | +void ManualCookWindow::on_favoriteButton_clicked() | ||
| 463 | { | 531 | { |
| 464 | if (oven->cooking()) | 532 | if (oven->cooking()) |
| 465 | return; | 533 | return; |
app/gui/oven_control/manualcookwindow.h
| @@ -57,7 +57,7 @@ private slots: | @@ -57,7 +57,7 @@ private slots: | ||
| 57 | void on_repeatButton_clicked(); | 57 | void on_repeatButton_clicked(); |
| 58 | void on_cooldownButton_clicked(); | 58 | void on_cooldownButton_clicked(); |
| 59 | void on_reserveButton_clicked(); | 59 | void on_reserveButton_clicked(); |
| 60 | - void on_favoritesButton_clicked(); | 60 | + void on_favoriteButton_clicked(); |
| 61 | void on_goBackStackButton_clicked(); | 61 | void on_goBackStackButton_clicked(); |
| 62 | void on_goFrontStackButton_clicked(); | 62 | void on_goFrontStackButton_clicked(); |
| 63 | 63 | ||
| @@ -82,6 +82,9 @@ private: | @@ -82,6 +82,9 @@ private: | ||
| 82 | 82 | ||
| 83 | bool showCurrentHumidity_ = false; | 83 | bool showCurrentHumidity_ = false; |
| 84 | bool showCurrentTemp_ = false; | 84 | bool showCurrentTemp_ = false; |
| 85 | + | ||
| 86 | + ManualCookSetting repeatSetting; | ||
| 87 | + bool repeat; | ||
| 85 | }; | 88 | }; |
| 86 | 89 | ||
| 87 | #endif // MANUALCOOKWINDOW_H | 90 | #endif // MANUALCOOKWINDOW_H |
app/gui/oven_control/manualcookwindow.ui
| @@ -249,7 +249,7 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/config_ov.png); }</s | @@ -249,7 +249,7 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/config_ov.png); }</s | ||
| 249 | <string/> | 249 | <string/> |
| 250 | </property> | 250 | </property> |
| 251 | </widget> | 251 | </widget> |
| 252 | - <widget class="QPushButton" name="favoriteButton"> | 252 | + <widget class="QPushButton" name="favoritesButton"> |
| 253 | <property name="geometry"> | 253 | <property name="geometry"> |
| 254 | <rect> | 254 | <rect> |
| 255 | <x>402</x> | 255 | <x>402</x> |
| @@ -942,7 +942,7 @@ QPushButton:pressed { background-image: url(:/images/manual_button/cooldown_ov.p | @@ -942,7 +942,7 @@ QPushButton:pressed { background-image: url(:/images/manual_button/cooldown_ov.p | ||
| 942 | <bool>true</bool> | 942 | <bool>true</bool> |
| 943 | </property> | 943 | </property> |
| 944 | </widget> | 944 | </widget> |
| 945 | - <widget class="QPushButton" name="favoritesButton"> | 945 | + <widget class="QPushButton" name="favoriteButton"> |
| 946 | <property name="geometry"> | 946 | <property name="geometry"> |
| 947 | <rect> | 947 | <rect> |
| 948 | <x>336</x> | 948 | <x>336</x> |
| @@ -1249,14 +1249,14 @@ QPushButton:pressed { image: url(:/images/slider_icon/time_ov.png); }</string> | @@ -1249,14 +1249,14 @@ QPushButton:pressed { image: url(:/images/slider_icon/time_ov.png); }</string> | ||
| 1249 | <container>1</container> | 1249 | <container>1</container> |
| 1250 | </customwidget> | 1250 | </customwidget> |
| 1251 | <customwidget> | 1251 | <customwidget> |
| 1252 | - <class>AnimatedImageBox</class> | 1252 | + <class>WashWarnIcon</class> |
| 1253 | <extends>QLabel</extends> | 1253 | <extends>QLabel</extends> |
| 1254 | - <header>animatedimagebox.h</header> | 1254 | + <header>washwarnicon.h</header> |
| 1255 | </customwidget> | 1255 | </customwidget> |
| 1256 | <customwidget> | 1256 | <customwidget> |
| 1257 | - <class>WashWarnIcon</class> | 1257 | + <class>AnimatedImageBox</class> |
| 1258 | <extends>QLabel</extends> | 1258 | <extends>QLabel</extends> |
| 1259 | - <header>washwarnicon.h</header> | 1259 | + <header>animatedimagebox.h</header> |
| 1260 | </customwidget> | 1260 | </customwidget> |
| 1261 | </customwidgets> | 1261 | </customwidgets> |
| 1262 | <resources> | 1262 | <resources> |