Commit 10d2268c2891a8b6dfc2552240ad25497f8ee85b
1 parent
a128c1aad7
Exists in
master
and in
2 other branches
V1.5.01
요청 사항 반영 - 실행 알람 시인성 강화
Showing
4 changed files
with
61 additions
and
34 deletions
Show diff stats
app/gui/oven_control/define.h
app/gui/oven_control/manualcookwindow.cpp
@@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
4 | #include <QSignalMapper> | 4 | #include <QSignalMapper> |
5 | #include <QTimer> | 5 | #include <QTimer> |
6 | #include <QtDebug> | 6 | #include <QtDebug> |
7 | +#include <QGraphicsDropShadowEffect> | ||
7 | 8 | ||
8 | #include "soundplayer.h" | 9 | #include "soundplayer.h" |
9 | #include "preheatpopup.h" | 10 | #include "preheatpopup.h" |
@@ -158,9 +159,14 @@ ManualCookWindow::ManualCookWindow(QWidget *parent, Define::Mode mode) : | @@ -158,9 +159,14 @@ ManualCookWindow::ManualCookWindow(QWidget *parent, Define::Mode mode) : | ||
158 | connect(oven, SIGNAL(changed(Oven*)), this, SLOT(onOvenUpdated(Oven*))); | 159 | connect(oven, SIGNAL(changed(Oven*)), this, SLOT(onOvenUpdated(Oven*))); |
159 | oven->setDefault(mode); | 160 | oven->setDefault(mode); |
160 | 161 | ||
162 | + QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect(this); | ||
163 | + effect->setBlurRadius(10); | ||
164 | + effect->setOffset(3, 3); | ||
165 | + | ||
161 | ui->infoTextLabel->setAttribute(Qt::WA_TransparentForMouseEvents); | 166 | ui->infoTextLabel->setAttribute(Qt::WA_TransparentForMouseEvents); |
167 | + ui->infoTextLabel->setGraphicsEffect(effect); | ||
162 | ui->infoTextLabel->hide(); | 168 | ui->infoTextLabel->hide(); |
163 | - showInfoTextTimer.setInterval(1500); | 169 | + showInfoTextTimer.setInterval(1000); |
164 | showInfoTextTimer.setSingleShot(true); | 170 | showInfoTextTimer.setSingleShot(true); |
165 | 171 | ||
166 | connect(&updateViewTimer, SIGNAL(timeout()), SLOT(updateView())); | 172 | connect(&updateViewTimer, SIGNAL(timeout()), SLOT(updateView())); |
@@ -457,9 +463,9 @@ QPushButton:checked\ | @@ -457,9 +463,9 @@ QPushButton:checked\ | ||
457 | ui->damperButton->setChecked(damper); | 463 | ui->damperButton->setChecked(damper); |
458 | 464 | ||
459 | if (damper) | 465 | if (damper) |
460 | - showInfoText("ON"); | 466 | + showInfoText("ON", ":/images/manual_button/damper_open.png"); |
461 | else | 467 | else |
462 | - showInfoText("OFF"); | 468 | + showInfoText("OFF", ":/images/manual_button/damper_close.png"); |
463 | } | 469 | } |
464 | 470 | ||
465 | bool humidification = oven->humidification(); | 471 | bool humidification = oven->humidification(); |
@@ -469,9 +475,9 @@ QPushButton:checked\ | @@ -469,9 +475,9 @@ QPushButton:checked\ | ||
469 | qDebug() << "humidification" << humidification; | 475 | qDebug() << "humidification" << humidification; |
470 | 476 | ||
471 | if (humidification) | 477 | if (humidification) |
472 | - showInfoText("ON"); | 478 | + showInfoText("ON", ":/images/manual_button/side_nozzle_open.png"); |
473 | else | 479 | else |
474 | - showInfoText("OFF"); | 480 | + showInfoText("OFF", ":/images/manual_button/side_nozzle_close.png"); |
475 | } | 481 | } |
476 | 482 | ||
477 | QString fanStyleSheet("\ | 483 | QString fanStyleSheet("\ |
@@ -523,9 +529,9 @@ QPushButton:focus { background-image: url(%2); }"); | @@ -523,9 +529,9 @@ QPushButton:focus { background-image: url(%2); }"); | ||
523 | ui->repeatButton->setChecked(repeat); | 529 | ui->repeatButton->setChecked(repeat); |
524 | 530 | ||
525 | if (repeat) | 531 | if (repeat) |
526 | - showInfoText("ON"); | 532 | + showInfoText("ON", ":/images/manual_button/repeat_ov.png"); |
527 | else | 533 | else |
528 | - showInfoText("OFF"); | 534 | + showInfoText("OFF", ":/images/manual_button/repeat.png"); |
529 | } | 535 | } |
530 | 536 | ||
531 | if (cookDone) | 537 | if (cookDone) |
@@ -544,22 +550,10 @@ QPushButton:focus { background-image: url(%2); }"); | @@ -544,22 +550,10 @@ QPushButton:focus { background-image: url(%2); }"); | ||
544 | } | 550 | } |
545 | 551 | ||
546 | int remainingTime = showInfoTextTimer.remainingTime(); | 552 | 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))); | 553 | + if (remainingTime > 0) |
557 | ui->infoTextLabel->show(); | 554 | ui->infoTextLabel->show(); |
558 | - } | ||
559 | else | 555 | else |
560 | - { | ||
561 | ui->infoTextLabel->hide(); | 556 | ui->infoTextLabel->hide(); |
562 | - } | ||
563 | } | 557 | } |
564 | 558 | ||
565 | void ManualCookWindow::showCurrentHumidity() | 559 | void ManualCookWindow::showCurrentHumidity() |
@@ -586,9 +580,14 @@ void ManualCookWindow::hideCurrentTemp() | @@ -586,9 +580,14 @@ void ManualCookWindow::hideCurrentTemp() | ||
586 | updateView(); | 580 | updateView(); |
587 | } | 581 | } |
588 | 582 | ||
589 | -void ManualCookWindow::showInfoText(QString text) | 583 | +void ManualCookWindow::showInfoText(QString text, QString icon) |
590 | { | 584 | { |
591 | - ui->infoTextLabel->setText(text); | 585 | + |
586 | + QString textTemplate = QString( | ||
587 | + "<img src=\"%2\" />" | ||
588 | + "<span> %1</span>").arg(text).arg(icon); | ||
589 | + | ||
590 | + ui->infoTextLabel->setText(textTemplate); | ||
592 | showInfoTextTimer.start(); | 591 | showInfoTextTimer.start(); |
593 | } | 592 | } |
594 | 593 | ||
@@ -1036,7 +1035,30 @@ void ManualCookWindow::on_fanButton_clicked() | @@ -1036,7 +1035,30 @@ void ManualCookWindow::on_fanButton_clicked() | ||
1036 | 1035 | ||
1037 | oven->setFan(fan); | 1036 | oven->setFan(fan); |
1038 | 1037 | ||
1039 | - showInfoText(QString("%1").arg(fan)); | 1038 | + QString text = QString("%1").arg(fan); |
1039 | + QString icon; | ||
1040 | + switch (fan) | ||
1041 | + { | ||
1042 | + case 1: | ||
1043 | + icon = ":/images/manual_button/fan_1.png"; | ||
1044 | + break; | ||
1045 | + case 2: | ||
1046 | + icon = ":/images/manual_button/fan_2.png"; | ||
1047 | + break; | ||
1048 | + case 3: | ||
1049 | + icon = ":/images/manual_button/fan_3.png"; | ||
1050 | + break; | ||
1051 | + case 4: | ||
1052 | + icon = ":/images/manual_button/fan_4.png"; | ||
1053 | + break; | ||
1054 | + case 5: | ||
1055 | + icon = ":/images/manual_button/fan_5.png"; | ||
1056 | + break; | ||
1057 | + default: | ||
1058 | + break; | ||
1059 | + } | ||
1060 | + | ||
1061 | + showInfoText(text, icon); | ||
1040 | } | 1062 | } |
1041 | 1063 | ||
1042 | void ManualCookWindow::on_preheatButton_clicked() | 1064 | void ManualCookWindow::on_preheatButton_clicked() |
@@ -1056,12 +1078,12 @@ void ManualCookWindow::on_damperButton_clicked() | @@ -1056,12 +1078,12 @@ void ManualCookWindow::on_damperButton_clicked() | ||
1056 | if (oven->damper()) | 1078 | if (oven->damper()) |
1057 | { | 1079 | { |
1058 | oven->closeDamper(); | 1080 | oven->closeDamper(); |
1059 | - showInfoText("OFF"); | 1081 | + showInfoText("OFF", ":/images/manual_button/damper_close.png"); |
1060 | } | 1082 | } |
1061 | else | 1083 | else |
1062 | { | 1084 | { |
1063 | oven->openDamper(); | 1085 | oven->openDamper(); |
1064 | - showInfoText("ON"); | 1086 | + showInfoText("ON", ":/images/manual_button/damper_open.png"); |
1065 | } | 1087 | } |
1066 | } | 1088 | } |
1067 | 1089 | ||
@@ -1070,12 +1092,12 @@ void ManualCookWindow::on_humidificationButton_clicked() | @@ -1070,12 +1092,12 @@ void ManualCookWindow::on_humidificationButton_clicked() | ||
1070 | if (oven->humidification()) | 1092 | if (oven->humidification()) |
1071 | { | 1093 | { |
1072 | oven->stopHumidification(); | 1094 | oven->stopHumidification(); |
1073 | - showInfoText("OFF"); | 1095 | + showInfoText("OFF", ":/images/manual_button/side_nozzle_close.png"); |
1074 | } | 1096 | } |
1075 | else | 1097 | else |
1076 | { | 1098 | { |
1077 | oven->startHumidification(5); | 1099 | oven->startHumidification(5); |
1078 | - showInfoText("ON"); | 1100 | + showInfoText("ON", ":/images/manual_button/side_nozzle_open.png"); |
1079 | } | 1101 | } |
1080 | } | 1102 | } |
1081 | 1103 | ||
@@ -1084,13 +1106,13 @@ void ManualCookWindow::on_repeatButton_clicked() | @@ -1084,13 +1106,13 @@ void ManualCookWindow::on_repeatButton_clicked() | ||
1084 | if (repeat) | 1106 | if (repeat) |
1085 | { | 1107 | { |
1086 | repeat = false; | 1108 | repeat = false; |
1087 | - showInfoText("OFF"); | 1109 | + showInfoText("OFF", ":/images/manual_button/repeat.png"); |
1088 | updateView(); | 1110 | updateView(); |
1089 | } | 1111 | } |
1090 | else | 1112 | else |
1091 | { | 1113 | { |
1092 | repeat = true; | 1114 | repeat = true; |
1093 | - showInfoText("ON"); | 1115 | + showInfoText("ON", ":/images/manual_button/repeat_ov.png"); |
1094 | updateView(); | 1116 | updateView(); |
1095 | 1117 | ||
1096 | repeatSetting.mode = oven->mode(); | 1118 | repeatSetting.mode = oven->mode(); |
app/gui/oven_control/manualcookwindow.h
@@ -41,7 +41,7 @@ private slots: | @@ -41,7 +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 | + void showInfoText(QString text, QString icon); |
45 | 45 | ||
46 | void onOvenUpdated(Oven *oven); | 46 | void onOvenUpdated(Oven *oven); |
47 | 47 |
app/gui/oven_control/manualcookwindow.ui
@@ -1311,16 +1311,21 @@ QPushButton:checked:focus | @@ -1311,16 +1311,21 @@ QPushButton:checked:focus | ||
1311 | </property> | 1311 | </property> |
1312 | <property name="font"> | 1312 | <property name="font"> |
1313 | <font> | 1313 | <font> |
1314 | - <pointsize>48</pointsize> | 1314 | + <pointsize>52</pointsize> |
1315 | <weight>75</weight> | 1315 | <weight>75</weight> |
1316 | <bold>true</bold> | 1316 | <bold>true</bold> |
1317 | </font> | 1317 | </font> |
1318 | </property> | 1318 | </property> |
1319 | <property name="styleSheet"> | 1319 | <property name="styleSheet"> |
1320 | - <string notr="true">color: rgba(255, 255, 255, 255);</string> | 1320 | + <string notr="true">background-image: url(:/images/error/background.png); |
1321 | +background-repeat: no-repeat; | ||
1322 | +background-position: center center; | ||
1323 | +border-radius: 40px; | ||
1324 | +color: rgba(255, 255, 255, 255); | ||
1325 | +margin: 200px 300px;</string> | ||
1321 | </property> | 1326 | </property> |
1322 | <property name="text"> | 1327 | <property name="text"> |
1323 | - <string>ON</string> | 1328 | + <string><img src=":/images/manual_button/fan_1.png"/><span>1</span></string> |
1324 | </property> | 1329 | </property> |
1325 | <property name="alignment"> | 1330 | <property name="alignment"> |
1326 | <set>Qt::AlignCenter</set> | 1331 | <set>Qt::AlignCenter</set> |