Commit d6ef50b78f37806c0172c1dfe936e4e8e510ffd8
1 parent
50560e6b7a
Exists in
master
and in
2 other branches
요청 사항 반영
- 수동 요리 중 특수 조작 시 상태 문자 표시 기능 추가
Showing
3 changed files
with
102 additions
and
3 deletions
Show diff stats
app/gui/oven_control/manualcookwindow.cpp
| @@ -158,6 +158,11 @@ ManualCookWindow::ManualCookWindow(QWidget *parent, Define::Mode mode) : | @@ -158,6 +158,11 @@ ManualCookWindow::ManualCookWindow(QWidget *parent, Define::Mode mode) : | ||
| 158 | connect(oven, SIGNAL(changed(Oven*)), this, SLOT(onOvenUpdated(Oven*))); | 158 | connect(oven, SIGNAL(changed(Oven*)), this, SLOT(onOvenUpdated(Oven*))); |
| 159 | oven->setDefault(mode); | 159 | oven->setDefault(mode); |
| 160 | 160 | ||
| 161 | + ui->infoTextLabel->setAttribute(Qt::WA_TransparentForMouseEvents); | ||
| 162 | + ui->infoTextLabel->hide(); | ||
| 163 | + showInfoTextTimer.setInterval(1500); | ||
| 164 | + showInfoTextTimer.setSingleShot(true); | ||
| 165 | + | ||
| 161 | connect(&updateViewTimer, SIGNAL(timeout()), SLOT(updateView())); | 166 | connect(&updateViewTimer, SIGNAL(timeout()), SLOT(updateView())); |
| 162 | updateViewTimer.start(100); | 167 | updateViewTimer.start(100); |
| 163 | 168 | ||
| @@ -447,10 +452,27 @@ QPushButton:checked\ | @@ -447,10 +452,27 @@ QPushButton:checked\ | ||
| 447 | } | 452 | } |
| 448 | 453 | ||
| 449 | bool damper = oven->damper(); | 454 | bool damper = oven->damper(); |
| 450 | - ui->damperButton->setChecked(damper); | 455 | + if (damper != ui->damperButton->isChecked()) |
| 456 | + { | ||
| 457 | + ui->damperButton->setChecked(damper); | ||
| 458 | + | ||
| 459 | + if (damper) | ||
| 460 | + showInfoText("ON"); | ||
| 461 | + else | ||
| 462 | + showInfoText("OFF"); | ||
| 463 | + } | ||
| 451 | 464 | ||
| 452 | bool humidification = oven->humidification(); | 465 | bool humidification = oven->humidification(); |
| 453 | - ui->humidificationButton->setChecked(humidification); | 466 | + if (humidification != ui->humidificationButton->isChecked()) |
| 467 | + { | ||
| 468 | + ui->humidificationButton->setChecked(humidification); | ||
| 469 | + qDebug() << "humidification" << humidification; | ||
| 470 | + | ||
| 471 | + if (humidification) | ||
| 472 | + showInfoText("ON"); | ||
| 473 | + else | ||
| 474 | + showInfoText("OFF"); | ||
| 475 | + } | ||
| 454 | 476 | ||
| 455 | QString fanStyleSheet("\ | 477 | QString fanStyleSheet("\ |
| 456 | QPushButton { background-image: url(%1); }\ | 478 | QPushButton { background-image: url(%1); }\ |
| @@ -496,7 +518,15 @@ QPushButton:focus { background-image: url(%2); }"); | @@ -496,7 +518,15 @@ QPushButton:focus { background-image: url(%2); }"); | ||
| 496 | } | 518 | } |
| 497 | } | 519 | } |
| 498 | 520 | ||
| 499 | - ui->repeatButton->setChecked(repeat); | 521 | + if (repeat != ui->repeatButton->isChecked()) |
| 522 | + { | ||
| 523 | + ui->repeatButton->setChecked(repeat); | ||
| 524 | + | ||
| 525 | + if (repeat) | ||
| 526 | + showInfoText("ON"); | ||
| 527 | + else | ||
| 528 | + showInfoText("OFF"); | ||
| 529 | + } | ||
| 500 | 530 | ||
| 501 | if (cookDone) | 531 | if (cookDone) |
| 502 | { | 532 | { |
| @@ -512,6 +542,24 @@ QPushButton:focus { background-image: url(%2); }"); | @@ -512,6 +542,24 @@ QPushButton:focus { background-image: url(%2); }"); | ||
| 512 | else | 542 | else |
| 513 | ui->upperStack->setCurrentIndex(0); // Clock | 543 | ui->upperStack->setCurrentIndex(0); // Clock |
| 514 | } | 544 | } |
| 545 | + | ||
| 546 | + int remainingTime = showInfoTextTimer.remainingTime(); | ||
| 547 | + if (remainingTime > 500) | ||
| 548 | + { | ||
| 549 | + ui->infoTextLabel->setStyleSheet("color: rgb(255, 255, 255);"); | ||
| 550 | + ui->infoTextLabel->show(); | ||
| 551 | + } | ||
| 552 | + else if (remainingTime > 0) | ||
| 553 | + { | ||
| 554 | + ui->infoTextLabel->setStyleSheet( | ||
| 555 | + QString("color: rgba(255, 255, 255, %1);") | ||
| 556 | + .arg(qBound(0, remainingTime * 255 / 500, 255))); | ||
| 557 | + ui->infoTextLabel->show(); | ||
| 558 | + } | ||
| 559 | + else | ||
| 560 | + { | ||
| 561 | + ui->infoTextLabel->hide(); | ||
| 562 | + } | ||
| 515 | } | 563 | } |
| 516 | 564 | ||
| 517 | void ManualCookWindow::showCurrentHumidity() | 565 | void ManualCookWindow::showCurrentHumidity() |
| @@ -538,6 +586,12 @@ void ManualCookWindow::hideCurrentTemp() | @@ -538,6 +586,12 @@ void ManualCookWindow::hideCurrentTemp() | ||
| 538 | updateView(); | 586 | updateView(); |
| 539 | } | 587 | } |
| 540 | 588 | ||
| 589 | +void ManualCookWindow::showInfoText(QString text) | ||
| 590 | +{ | ||
| 591 | + ui->infoTextLabel->setText(text); | ||
| 592 | + showInfoTextTimer.start(); | ||
| 593 | +} | ||
| 594 | + | ||
| 541 | void ManualCookWindow::onOvenUpdated(Oven *oven) | 595 | void ManualCookWindow::onOvenUpdated(Oven *oven) |
| 542 | { | 596 | { |
| 543 | updateView(); | 597 | updateView(); |
| @@ -981,6 +1035,8 @@ void ManualCookWindow::on_fanButton_clicked() | @@ -981,6 +1035,8 @@ void ManualCookWindow::on_fanButton_clicked() | ||
| 981 | fan = oven->minFan(); | 1035 | fan = oven->minFan(); |
| 982 | 1036 | ||
| 983 | oven->setFan(fan); | 1037 | oven->setFan(fan); |
| 1038 | + | ||
| 1039 | + showInfoText(QString("%1").arg(fan)); | ||
| 984 | } | 1040 | } |
| 985 | 1041 | ||
| 986 | void ManualCookWindow::on_preheatButton_clicked() | 1042 | void ManualCookWindow::on_preheatButton_clicked() |
| @@ -998,17 +1054,29 @@ void ManualCookWindow::on_preheatButton_clicked() | @@ -998,17 +1054,29 @@ void ManualCookWindow::on_preheatButton_clicked() | ||
| 998 | void ManualCookWindow::on_damperButton_clicked() | 1054 | void ManualCookWindow::on_damperButton_clicked() |
| 999 | { | 1055 | { |
| 1000 | if (oven->damper()) | 1056 | if (oven->damper()) |
| 1057 | + { | ||
| 1001 | oven->closeDamper(); | 1058 | oven->closeDamper(); |
| 1059 | + showInfoText("OFF"); | ||
| 1060 | + } | ||
| 1002 | else | 1061 | else |
| 1062 | + { | ||
| 1003 | oven->openDamper(); | 1063 | oven->openDamper(); |
| 1064 | + showInfoText("ON"); | ||
| 1065 | + } | ||
| 1004 | } | 1066 | } |
| 1005 | 1067 | ||
| 1006 | void ManualCookWindow::on_humidificationButton_clicked() | 1068 | void ManualCookWindow::on_humidificationButton_clicked() |
| 1007 | { | 1069 | { |
| 1008 | if (oven->humidification()) | 1070 | if (oven->humidification()) |
| 1071 | + { | ||
| 1009 | oven->stopHumidification(); | 1072 | oven->stopHumidification(); |
| 1073 | + showInfoText("OFF"); | ||
| 1074 | + } | ||
| 1010 | else | 1075 | else |
| 1076 | + { | ||
| 1011 | oven->startHumidification(5); | 1077 | oven->startHumidification(5); |
| 1078 | + showInfoText("ON"); | ||
| 1079 | + } | ||
| 1012 | } | 1080 | } |
| 1013 | 1081 | ||
| 1014 | void ManualCookWindow::on_repeatButton_clicked() | 1082 | void ManualCookWindow::on_repeatButton_clicked() |
| @@ -1016,11 +1084,13 @@ void ManualCookWindow::on_repeatButton_clicked() | @@ -1016,11 +1084,13 @@ void ManualCookWindow::on_repeatButton_clicked() | ||
| 1016 | if (repeat) | 1084 | if (repeat) |
| 1017 | { | 1085 | { |
| 1018 | repeat = false; | 1086 | repeat = false; |
| 1087 | + showInfoText("OFF"); | ||
| 1019 | updateView(); | 1088 | updateView(); |
| 1020 | } | 1089 | } |
| 1021 | else | 1090 | else |
| 1022 | { | 1091 | { |
| 1023 | repeat = true; | 1092 | repeat = true; |
| 1093 | + showInfoText("ON"); | ||
| 1024 | updateView(); | 1094 | updateView(); |
| 1025 | 1095 | ||
| 1026 | repeatSetting.mode = oven->mode(); | 1096 | repeatSetting.mode = oven->mode(); |
app/gui/oven_control/manualcookwindow.h
| @@ -41,6 +41,7 @@ private slots: | @@ -41,6 +41,7 @@ private slots: | ||
| 41 | void hideCurrentHumidity(); | 41 | void hideCurrentHumidity(); |
| 42 | void showCurrentTemp(); | 42 | void showCurrentTemp(); |
| 43 | void hideCurrentTemp(); | 43 | void hideCurrentTemp(); |
| 44 | + void showInfoText(QString text); | ||
| 44 | 45 | ||
| 45 | void onOvenUpdated(Oven *oven); | 46 | void onOvenUpdated(Oven *oven); |
| 46 | 47 | ||
| @@ -107,6 +108,7 @@ private: | @@ -107,6 +108,7 @@ private: | ||
| 107 | 108 | ||
| 108 | QTimer showCurrentHumidityTimer; | 109 | QTimer showCurrentHumidityTimer; |
| 109 | QTimer showCurrentTempTimer; | 110 | QTimer showCurrentTempTimer; |
| 111 | + QTimer showInfoTextTimer; | ||
| 110 | 112 | ||
| 111 | int humidity; | 113 | int humidity; |
| 112 | int temp; | 114 | int temp; |
app/gui/oven_control/manualcookwindow.ui
| @@ -1300,6 +1300,32 @@ QPushButton:checked:focus | @@ -1300,6 +1300,32 @@ QPushButton:checked:focus | ||
| 1300 | <string notr="true">background-image: url(:/images/line/manual_button.png);</string> | 1300 | <string notr="true">background-image: url(:/images/line/manual_button.png);</string> |
| 1301 | </property> | 1301 | </property> |
| 1302 | </widget> | 1302 | </widget> |
| 1303 | + <widget class="QLabel" name="infoTextLabel"> | ||
| 1304 | + <property name="geometry"> | ||
| 1305 | + <rect> | ||
| 1306 | + <x>0</x> | ||
| 1307 | + <y>720</y> | ||
| 1308 | + <width>900</width> | ||
| 1309 | + <height>600</height> | ||
| 1310 | + </rect> | ||
| 1311 | + </property> | ||
| 1312 | + <property name="font"> | ||
| 1313 | + <font> | ||
| 1314 | + <pointsize>48</pointsize> | ||
| 1315 | + <weight>75</weight> | ||
| 1316 | + <bold>true</bold> | ||
| 1317 | + </font> | ||
| 1318 | + </property> | ||
| 1319 | + <property name="styleSheet"> | ||
| 1320 | + <string notr="true">color: rgba(255, 255, 255, 255);</string> | ||
| 1321 | + </property> | ||
| 1322 | + <property name="text"> | ||
| 1323 | + <string>ON</string> | ||
| 1324 | + </property> | ||
| 1325 | + <property name="alignment"> | ||
| 1326 | + <set>Qt::AlignCenter</set> | ||
| 1327 | + </property> | ||
| 1328 | + </widget> | ||
| 1303 | <zorder>sysLine_8</zorder> | 1329 | <zorder>sysLine_8</zorder> |
| 1304 | <zorder>sysLine_7</zorder> | 1330 | <zorder>sysLine_7</zorder> |
| 1305 | <zorder>sysLine_9</zorder> | 1331 | <zorder>sysLine_9</zorder> |
| @@ -1334,6 +1360,7 @@ QPushButton:checked:focus | @@ -1334,6 +1360,7 @@ QPushButton:checked:focus | ||
| 1334 | <zorder>humiditySlider</zorder> | 1360 | <zorder>humiditySlider</zorder> |
| 1335 | <zorder>timeSlider</zorder> | 1361 | <zorder>timeSlider</zorder> |
| 1336 | <zorder>interTempSlider</zorder> | 1362 | <zorder>interTempSlider</zorder> |
| 1363 | + <zorder>infoTextLabel</zorder> | ||
| 1337 | </widget> | 1364 | </widget> |
| 1338 | </widget> | 1365 | </widget> |
| 1339 | <customwidgets> | 1366 | <customwidgets> |