Commit d6ef50b78f37806c0172c1dfe936e4e8e510ffd8

Authored by 김태훈
1 parent 50560e6b7a
Exists in master and in 2 other branches fhd, fhd-demo

요청 사항 반영

- 수동 요리 중 특수 조작 시 상태 문자 표시 기능 추가
app/gui/oven_control/manualcookwindow.cpp
... ... @@ -158,6 +158,11 @@ ManualCookWindow::ManualCookWindow(QWidget *parent, Define::Mode mode) :
158 158 connect(oven, SIGNAL(changed(Oven*)), this, SLOT(onOvenUpdated(Oven*)));
159 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 166 connect(&updateViewTimer, SIGNAL(timeout()), SLOT(updateView()));
162 167 updateViewTimer.start(100);
163 168  
... ... @@ -447,10 +452,27 @@ QPushButton:checked\
447 452 }
448 453  
449 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 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 477 QString fanStyleSheet("\
456 478 QPushButton { background-image: url(%1); }\
... ... @@ -496,7 +518,15 @@ QPushButton:focus { background-image: url(%2); }&quot;);
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 531 if (cookDone)
502 532 {
... ... @@ -512,6 +542,24 @@ QPushButton:focus { background-image: url(%2); }&quot;);
512 542 else
513 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 565 void ManualCookWindow::showCurrentHumidity()
... ... @@ -538,6 +586,12 @@ void ManualCookWindow::hideCurrentTemp()
538 586 updateView();
539 587 }
540 588  
  589 +void ManualCookWindow::showInfoText(QString text)
  590 +{
  591 + ui->infoTextLabel->setText(text);
  592 + showInfoTextTimer.start();
  593 +}
  594 +
541 595 void ManualCookWindow::onOvenUpdated(Oven *oven)
542 596 {
543 597 updateView();
... ... @@ -981,6 +1035,8 @@ void ManualCookWindow::on_fanButton_clicked()
981 1035 fan = oven->minFan();
982 1036  
983 1037 oven->setFan(fan);
  1038 +
  1039 + showInfoText(QString("%1").arg(fan));
984 1040 }
985 1041  
986 1042 void ManualCookWindow::on_preheatButton_clicked()
... ... @@ -998,17 +1054,29 @@ void ManualCookWindow::on_preheatButton_clicked()
998 1054 void ManualCookWindow::on_damperButton_clicked()
999 1055 {
1000 1056 if (oven->damper())
  1057 + {
1001 1058 oven->closeDamper();
  1059 + showInfoText("OFF");
  1060 + }
1002 1061 else
  1062 + {
1003 1063 oven->openDamper();
  1064 + showInfoText("ON");
  1065 + }
1004 1066 }
1005 1067  
1006 1068 void ManualCookWindow::on_humidificationButton_clicked()
1007 1069 {
1008 1070 if (oven->humidification())
  1071 + {
1009 1072 oven->stopHumidification();
  1073 + showInfoText("OFF");
  1074 + }
1010 1075 else
  1076 + {
1011 1077 oven->startHumidification(5);
  1078 + showInfoText("ON");
  1079 + }
1012 1080 }
1013 1081  
1014 1082 void ManualCookWindow::on_repeatButton_clicked()
... ... @@ -1016,11 +1084,13 @@ void ManualCookWindow::on_repeatButton_clicked()
1016 1084 if (repeat)
1017 1085 {
1018 1086 repeat = false;
  1087 + showInfoText("OFF");
1019 1088 updateView();
1020 1089 }
1021 1090 else
1022 1091 {
1023 1092 repeat = true;
  1093 + showInfoText("ON");
1024 1094 updateView();
1025 1095  
1026 1096 repeatSetting.mode = oven->mode();
... ...
app/gui/oven_control/manualcookwindow.h
... ... @@ -41,6 +41,7 @@ private slots:
41 41 void hideCurrentHumidity();
42 42 void showCurrentTemp();
43 43 void hideCurrentTemp();
  44 + void showInfoText(QString text);
44 45  
45 46 void onOvenUpdated(Oven *oven);
46 47  
... ... @@ -107,6 +108,7 @@ private:
107 108  
108 109 QTimer showCurrentHumidityTimer;
109 110 QTimer showCurrentTempTimer;
  111 + QTimer showInfoTextTimer;
110 112  
111 113 int humidity;
112 114 int temp;
... ...
app/gui/oven_control/manualcookwindow.ui
... ... @@ -1300,6 +1300,32 @@ QPushButton:checked:focus
1300 1300 <string notr="true">background-image: url(:/images/line/manual_button.png);</string>
1301 1301 </property>
1302 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 1329 <zorder>sysLine_8</zorder>
1304 1330 <zorder>sysLine_7</zorder>
1305 1331 <zorder>sysLine_9</zorder>
... ... @@ -1334,6 +1360,7 @@ QPushButton:checked:focus
1334 1360 <zorder>humiditySlider</zorder>
1335 1361 <zorder>timeSlider</zorder>
1336 1362 <zorder>interTempSlider</zorder>
  1363 + <zorder>infoTextLabel</zorder>
1337 1364 </widget>
1338 1365 </widget>
1339 1366 <customwidgets>
... ...