Commit 61ba89b34de788721827889e1ff9baf57370f324
1 parent
05f2a75527
Exists in
master
and in
2 other branches
GUI V0.1.6
Showing
16 changed files
with
293 additions
and
58 deletions
Show diff stats
app/gui/oven_control/animatedimagebox.cpp
app/gui/oven_control/images/animation/medium_ani_c01.png
75.2 KB
app/gui/oven_control/images/animation/medium_ani_c02.png
78.2 KB
app/gui/oven_control/images/animation/medium_ani_c03.png
80.6 KB
app/gui/oven_control/images/animation/medium_ani_c04.png
82.3 KB
app/gui/oven_control/images/animation/pull_01.png
75.2 KB
app/gui/oven_control/images/animation/pull_02.png
78.2 KB
app/gui/oven_control/images/animation/pull_03.png
80.6 KB
app/gui/oven_control/images/animation/pull_04.png
82.3 KB
app/gui/oven_control/preheatpopup.cpp
| @@ -4,7 +4,9 @@ | @@ -4,7 +4,9 @@ | ||
| 4 | PreheatPopup::PreheatPopup(QWidget *parent, Oven *oven) : | 4 | PreheatPopup::PreheatPopup(QWidget *parent, Oven *oven) : |
| 5 | QWidget(parent), | 5 | QWidget(parent), |
| 6 | ui(new Ui::PreheatPopup), | 6 | ui(new Ui::PreheatPopup), |
| 7 | - oven(oven) | 7 | + oven(oven), |
| 8 | + showingCurrentHumidity(false), | ||
| 9 | + showingCurrentTemp(false) | ||
| 8 | { | 10 | { |
| 9 | ui->setupUi(this); | 11 | ui->setupUi(this); |
| 10 | 12 | ||
| @@ -12,7 +14,15 @@ PreheatPopup::PreheatPopup(QWidget *parent, Oven *oven) : | @@ -12,7 +14,15 @@ PreheatPopup::PreheatPopup(QWidget *parent, Oven *oven) : | ||
| 12 | 14 | ||
| 13 | connect(oven, SIGNAL(changed(Oven*)), SLOT(updateView())); | 15 | connect(oven, SIGNAL(changed(Oven*)), SLOT(updateView())); |
| 14 | 16 | ||
| 15 | - oven->startPreheating(); | 17 | + showCurrentHumidityTimer.setSingleShot(true); |
| 18 | + showCurrentHumidityTimer.setInterval(3000); | ||
| 19 | + connect(&showCurrentHumidityTimer, SIGNAL(timeout()), SLOT(showCurrentHumidity())); | ||
| 20 | + | ||
| 21 | + showCurrentTempTimer.setSingleShot(true); | ||
| 22 | + showCurrentTempTimer.setInterval(3000); | ||
| 23 | + connect(&showCurrentTempTimer, SIGNAL(timeout()), SLOT(showCurrentTemp())); | ||
| 24 | + | ||
| 25 | + start(); | ||
| 16 | } | 26 | } |
| 17 | 27 | ||
| 18 | PreheatPopup::~PreheatPopup() | 28 | PreheatPopup::~PreheatPopup() |
| @@ -30,22 +40,89 @@ void PreheatPopup::updateView() | @@ -30,22 +40,89 @@ void PreheatPopup::updateView() | ||
| 30 | else | 40 | else |
| 31 | ui->timeLabel->setText(QString().sprintf("%d<span style=\"font-size:11pt;\">초</span>", time)); | 41 | ui->timeLabel->setText(QString().sprintf("%d<span style=\"font-size:11pt;\">초</span>", time)); |
| 32 | 42 | ||
| 43 | + int curInterTemp = oven->currentInterTemp(); | ||
| 33 | if (oven->interTempEnabled()) | 44 | if (oven->interTempEnabled()) |
| 34 | { | 45 | { |
| 35 | int interTemp = oven->interTemp(); | 46 | int interTemp = oven->interTemp(); |
| 36 | - ui->interTempLabel->setText(QString().sprintf("%d<span style=\"font-size:11pt;\">℃</span>", interTemp)); | 47 | + ui->interTempLabel->setText(QString().sprintf("%d<span style=\"font-size:11pt;\">℃ / %d</span><span style=\"font-size:9pt;\">℃</span>", curInterTemp, interTemp)); |
| 37 | } | 48 | } |
| 38 | else | 49 | else |
| 39 | - ui->interTempLabel->setText("<span style=\"font-size:11pt;\">℃</span>"); | 50 | + ui->interTempLabel->setText(QString().sprintf("%d<span style=\"font-size:11pt;\">℃</span>", curInterTemp)); |
| 51 | + | ||
| 52 | + int humidity; | ||
| 53 | + if (showingCurrentHumidity) | ||
| 54 | + humidity = oven->currentHumidity(); | ||
| 55 | + else | ||
| 56 | + humidity = oven->humidity(); | ||
| 57 | + | ||
| 58 | + int temp; | ||
| 59 | + if (showingCurrentTemp) | ||
| 60 | + temp = oven->currentTemp(); | ||
| 61 | + else | ||
| 62 | + temp = oven->temp(); | ||
| 63 | + | ||
| 64 | + ui->humidityLabel->setText(QString().sprintf("%d%%", humidity)); | ||
| 65 | + ui->heatLabel->setText(QString().sprintf("%d℃", temp)); | ||
| 66 | +} | ||
| 67 | + | ||
| 68 | +void PreheatPopup::start() | ||
| 69 | +{ | ||
| 70 | + oven->startPreheating(); | ||
| 71 | +} | ||
| 72 | + | ||
| 73 | +void PreheatPopup::stop() | ||
| 74 | +{ | ||
| 75 | + oven->stopPreheating(); | ||
| 76 | +} | ||
| 77 | + | ||
| 78 | +void PreheatPopup::showCurrentHumidity() | ||
| 79 | +{ | ||
| 80 | + showingCurrentHumidity = true; | ||
| 40 | 81 | ||
| 82 | + updateView(); | ||
| 83 | +} | ||
| 84 | + | ||
| 85 | +void PreheatPopup::showCurrentTemp() | ||
| 86 | +{ | ||
| 87 | + showingCurrentTemp = true; | ||
| 88 | + | ||
| 89 | + updateView(); | ||
| 41 | } | 90 | } |
| 42 | 91 | ||
| 43 | void PreheatPopup::on_closeButton_clicked() | 92 | void PreheatPopup::on_closeButton_clicked() |
| 44 | { | 93 | { |
| 94 | + stop(); | ||
| 45 | close(); | 95 | close(); |
| 46 | } | 96 | } |
| 47 | 97 | ||
| 48 | void PreheatPopup::on_closeButton_2_clicked() | 98 | void PreheatPopup::on_closeButton_2_clicked() |
| 49 | { | 99 | { |
| 100 | + stop(); | ||
| 50 | close(); | 101 | close(); |
| 51 | } | 102 | } |
| 103 | + | ||
| 104 | +void PreheatPopup::on_humidityGaugeButton_pressed() | ||
| 105 | +{ | ||
| 106 | + showCurrentHumidityTimer.start(); | ||
| 107 | +} | ||
| 108 | + | ||
| 109 | +void PreheatPopup::on_humidityGaugeButton_released() | ||
| 110 | +{ | ||
| 111 | + showCurrentHumidityTimer.stop(); | ||
| 112 | + showingCurrentHumidity = false; | ||
| 113 | + | ||
| 114 | + updateView(); | ||
| 115 | +} | ||
| 116 | + | ||
| 117 | +void PreheatPopup::on_heatGaugeButton_pressed() | ||
| 118 | +{ | ||
| 119 | + showCurrentTempTimer.start(); | ||
| 120 | +} | ||
| 121 | + | ||
| 122 | +void PreheatPopup::on_heatGaugeButton_released() | ||
| 123 | +{ | ||
| 124 | + showCurrentTempTimer.stop(); | ||
| 125 | + showingCurrentTemp = false; | ||
| 126 | + | ||
| 127 | + updateView(); | ||
| 128 | +} |
app/gui/oven_control/preheatpopup.h
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | #define PREHEATPOPUP_H | 2 | #define PREHEATPOPUP_H |
| 3 | 3 | ||
| 4 | #include <QWidget> | 4 | #include <QWidget> |
| 5 | +#include <QTimer> | ||
| 5 | 6 | ||
| 6 | #include "oven.h" | 7 | #include "oven.h" |
| 7 | 8 | ||
| @@ -19,13 +20,31 @@ public: | @@ -19,13 +20,31 @@ public: | ||
| 19 | 20 | ||
| 20 | private slots: | 21 | private slots: |
| 21 | void updateView(); | 22 | void updateView(); |
| 23 | + void start(); | ||
| 24 | + void stop(); | ||
| 25 | + | ||
| 26 | + void showCurrentHumidity(); | ||
| 27 | + void showCurrentTemp(); | ||
| 22 | 28 | ||
| 23 | void on_closeButton_clicked(); | 29 | void on_closeButton_clicked(); |
| 24 | void on_closeButton_2_clicked(); | 30 | void on_closeButton_2_clicked(); |
| 25 | 31 | ||
| 32 | + void on_humidityGaugeButton_pressed(); | ||
| 33 | + | ||
| 34 | + void on_humidityGaugeButton_released(); | ||
| 35 | + | ||
| 36 | + void on_heatGaugeButton_pressed(); | ||
| 37 | + | ||
| 38 | + void on_heatGaugeButton_released(); | ||
| 39 | + | ||
| 26 | private: | 40 | private: |
| 27 | Ui::PreheatPopup *ui; | 41 | Ui::PreheatPopup *ui; |
| 28 | Oven *oven; | 42 | Oven *oven; |
| 43 | + | ||
| 44 | + QTimer showCurrentHumidityTimer; | ||
| 45 | + QTimer showCurrentTempTimer; | ||
| 46 | + bool showingCurrentHumidity; | ||
| 47 | + bool showingCurrentTemp; | ||
| 29 | }; | 48 | }; |
| 30 | 49 | ||
| 31 | #endif // PREHEATPOPUP_H | 50 | #endif // PREHEATPOPUP_H |
app/gui/oven_control/preheatpopup.ui
| @@ -216,7 +216,7 @@ | @@ -216,7 +216,7 @@ | ||
| 216 | <string/> | 216 | <string/> |
| 217 | </property> | 217 | </property> |
| 218 | <property name="pixmap"> | 218 | <property name="pixmap"> |
| 219 | - <pixmap>:/images/images/auto/sys_icon_05.png</pixmap> | 219 | + <pixmap resource="resources.qrc">:/images/cook_step_type/sys_icon_05.png</pixmap> |
| 220 | </property> | 220 | </property> |
| 221 | <property name="alignment"> | 221 | <property name="alignment"> |
| 222 | <set>Qt::AlignCenter</set> | 222 | <set>Qt::AlignCenter</set> |
| @@ -417,12 +417,8 @@ | @@ -417,12 +417,8 @@ | ||
| 417 | </rect> | 417 | </rect> |
| 418 | </property> | 418 | </property> |
| 419 | <property name="styleSheet"> | 419 | <property name="styleSheet"> |
| 420 | - <string notr="true">QPushButton { | ||
| 421 | -border-image: url(:/images/images/auto/window_icon_03.png); | ||
| 422 | -} | ||
| 423 | -QPushButton::pressed { | ||
| 424 | -border-image: url(:/images/images/auto/window_icon_03_ov.png); | ||
| 425 | -}</string> | 420 | + <string notr="true">QPushButton { border-image: url(:/images/symbol/info.png); } |
| 421 | +QPushButton::pressed { border-image: url(:/images/symbol/info_ov.png); }</string> | ||
| 426 | </property> | 422 | </property> |
| 427 | <property name="text"> | 423 | <property name="text"> |
| 428 | <string/> | 424 | <string/> |
| @@ -589,7 +585,7 @@ border-image: url(:/images/images/auto/btn_01_ov.png); | @@ -589,7 +585,7 @@ border-image: url(:/images/images/auto/btn_01_ov.png); | ||
| 589 | <string/> | 585 | <string/> |
| 590 | </property> | 586 | </property> |
| 591 | <property name="pixmap"> | 587 | <property name="pixmap"> |
| 592 | - <pixmap>:/images/images/auto/window_icon_01.png</pixmap> | 588 | + <pixmap resource="resources.qrc">:/images/symbol/time.png</pixmap> |
| 593 | </property> | 589 | </property> |
| 594 | <property name="alignment"> | 590 | <property name="alignment"> |
| 595 | <set>Qt::AlignCenter</set> | 591 | <set>Qt::AlignCenter</set> |
| @@ -651,7 +647,7 @@ border-image: url(:/images/images/auto/btn_01_ov.png); | @@ -651,7 +647,7 @@ border-image: url(:/images/images/auto/btn_01_ov.png); | ||
| 651 | <string/> | 647 | <string/> |
| 652 | </property> | 648 | </property> |
| 653 | <property name="pixmap"> | 649 | <property name="pixmap"> |
| 654 | - <pixmap>:/images/images/auto/sys_icon_05.png</pixmap> | 650 | + <pixmap resource="resources.qrc">:/images/cook_step_type/sys_icon_05.png</pixmap> |
| 655 | </property> | 651 | </property> |
| 656 | <property name="alignment"> | 652 | <property name="alignment"> |
| 657 | <set>Qt::AlignCenter</set> | 653 | <set>Qt::AlignCenter</set> |
| @@ -754,13 +750,13 @@ border-image: url(:/images/images/auto/btn_01_ov.png); | @@ -754,13 +750,13 @@ border-image: url(:/images/images/auto/btn_01_ov.png); | ||
| 754 | <string/> | 750 | <string/> |
| 755 | </property> | 751 | </property> |
| 756 | <property name="pixmap"> | 752 | <property name="pixmap"> |
| 757 | - <pixmap>:/images/images/auto/window_icon_02.png</pixmap> | 753 | + <pixmap resource="resources.qrc">:/images/symbol/core_temp.png</pixmap> |
| 758 | </property> | 754 | </property> |
| 759 | <property name="alignment"> | 755 | <property name="alignment"> |
| 760 | <set>Qt::AlignCenter</set> | 756 | <set>Qt::AlignCenter</set> |
| 761 | </property> | 757 | </property> |
| 762 | </widget> | 758 | </widget> |
| 763 | - <widget class="QLabel" name="label"> | 759 | + <widget class="Line" name="line"> |
| 764 | <property name="geometry"> | 760 | <property name="geometry"> |
| 765 | <rect> | 761 | <rect> |
| 766 | <x>110</x> | 762 | <x>110</x> |
| @@ -769,14 +765,11 @@ border-image: url(:/images/images/auto/btn_01_ov.png); | @@ -769,14 +765,11 @@ border-image: url(:/images/images/auto/btn_01_ov.png); | ||
| 769 | <height>1</height> | 765 | <height>1</height> |
| 770 | </rect> | 766 | </rect> |
| 771 | </property> | 767 | </property> |
| 772 | - <property name="text"> | ||
| 773 | - <string/> | ||
| 774 | - </property> | ||
| 775 | - <property name="pixmap"> | ||
| 776 | - <pixmap>:/images/images/manual/015_center_temp_line_w.png</pixmap> | 768 | + <property name="orientation"> |
| 769 | + <enum>Qt::Horizontal</enum> | ||
| 777 | </property> | 770 | </property> |
| 778 | </widget> | 771 | </widget> |
| 779 | - <widget class="QLabel" name="label_2"> | 772 | + <widget class="Line" name="line_2"> |
| 780 | <property name="geometry"> | 773 | <property name="geometry"> |
| 781 | <rect> | 774 | <rect> |
| 782 | <x>110</x> | 775 | <x>110</x> |
| @@ -785,11 +778,8 @@ border-image: url(:/images/images/auto/btn_01_ov.png); | @@ -785,11 +778,8 @@ border-image: url(:/images/images/auto/btn_01_ov.png); | ||
| 785 | <height>1</height> | 778 | <height>1</height> |
| 786 | </rect> | 779 | </rect> |
| 787 | </property> | 780 | </property> |
| 788 | - <property name="text"> | ||
| 789 | - <string/> | ||
| 790 | - </property> | ||
| 791 | - <property name="pixmap"> | ||
| 792 | - <pixmap>:/images/images/manual/015_center_temp_line_w.png</pixmap> | 781 | + <property name="orientation"> |
| 782 | + <enum>Qt::Horizontal</enum> | ||
| 793 | </property> | 783 | </property> |
| 794 | </widget> | 784 | </widget> |
| 795 | </widget> | 785 | </widget> |
| @@ -827,6 +817,8 @@ border-image: url(:/images/images/auto/btn_01_ov.png); | @@ -827,6 +817,8 @@ border-image: url(:/images/images/auto/btn_01_ov.png); | ||
| 827 | <container>1</container> | 817 | <container>1</container> |
| 828 | </customwidget> | 818 | </customwidget> |
| 829 | </customwidgets> | 819 | </customwidgets> |
| 830 | - <resources/> | 820 | + <resources> |
| 821 | + <include location="resources.qrc"/> | ||
| 822 | + </resources> | ||
| 831 | <connections/> | 823 | <connections/> |
| 832 | </ui> | 824 | </ui> |
app/gui/oven_control/resources.qrc
| @@ -12,10 +12,6 @@ | @@ -12,10 +12,6 @@ | ||
| 12 | <file>images/animation/ani_c_04.png</file> | 12 | <file>images/animation/ani_c_04.png</file> |
| 13 | <file>images/animation/medium_ani_b01.png</file> | 13 | <file>images/animation/medium_ani_b01.png</file> |
| 14 | <file>images/animation/medium_ani_b02.png</file> | 14 | <file>images/animation/medium_ani_b02.png</file> |
| 15 | - <file>images/animation/medium_ani_c01.png</file> | ||
| 16 | - <file>images/animation/medium_ani_c02.png</file> | ||
| 17 | - <file>images/animation/medium_ani_c03.png</file> | ||
| 18 | - <file>images/animation/medium_ani_c04.png</file> | ||
| 19 | <file>images/animation/medium_ani_d01.png</file> | 15 | <file>images/animation/medium_ani_d01.png</file> |
| 20 | <file>images/animation/medium_ani_d02.png</file> | 16 | <file>images/animation/medium_ani_d02.png</file> |
| 21 | <file>images/animation/medium_ani_d03.png</file> | 17 | <file>images/animation/medium_ani_d03.png</file> |
| @@ -390,5 +386,9 @@ | @@ -390,5 +386,9 @@ | ||
| 390 | <file>images/slider_icon/clean_ov.png</file> | 386 | <file>images/slider_icon/clean_ov.png</file> |
| 391 | <file>images/slider_icon/management.png</file> | 387 | <file>images/slider_icon/management.png</file> |
| 392 | <file>images/slider_icon/management_ov.png</file> | 388 | <file>images/slider_icon/management_ov.png</file> |
| 389 | + <file>images/animation/pull_01.png</file> | ||
| 390 | + <file>images/animation/pull_02.png</file> | ||
| 391 | + <file>images/animation/pull_03.png</file> | ||
| 392 | + <file>images/animation/pull_04.png</file> | ||
| 393 | </qresource> | 393 | </qresource> |
| 394 | </RCC> | 394 | </RCC> |
app/gui/oven_control/washwindow.cpp
| @@ -7,7 +7,11 @@ WashWindow::WashWindow(QWidget *parent, UdpHandler *udp) : | @@ -7,7 +7,11 @@ WashWindow::WashWindow(QWidget *parent, UdpHandler *udp) : | ||
| 7 | QMainWindow(parent), | 7 | QMainWindow(parent), |
| 8 | ui(new Ui::WashWindow), | 8 | ui(new Ui::WashWindow), |
| 9 | udp(udp), | 9 | udp(udp), |
| 10 | - started(false) | 10 | + selected(false), |
| 11 | + opened(false), | ||
| 12 | + started(false), | ||
| 13 | + run(false), | ||
| 14 | + type(0) | ||
| 11 | { | 15 | { |
| 12 | ui->setupUi(this); | 16 | ui->setupUi(this); |
| 13 | 17 | ||
| @@ -18,10 +22,8 @@ WashWindow::WashWindow(QWidget *parent, UdpHandler *udp) : | @@ -18,10 +22,8 @@ WashWindow::WashWindow(QWidget *parent, UdpHandler *udp) : | ||
| 18 | udp->turnOff(TG_SYSTEM); | 22 | udp->turnOff(TG_SYSTEM); |
| 19 | connect(udp, SIGNAL(changed()), SLOT(onChanged())); | 23 | connect(udp, SIGNAL(changed()), SLOT(onChanged())); |
| 20 | 24 | ||
| 21 | - ui->animation->load(":/images/animation/wash_01.png"); | ||
| 22 | - ui->animation->load(":/images/animation/wash_02.png"); | ||
| 23 | - ui->animation->load(":/images/animation/wash_03.png"); | ||
| 24 | ui->animation->load(":/images/animation/wash_04.png"); | 25 | ui->animation->load(":/images/animation/wash_04.png"); |
| 26 | + ui->closeDoorArrow->hide(); | ||
| 25 | 27 | ||
| 26 | QSignalMapper *sm = new QSignalMapper(this); | 28 | QSignalMapper *sm = new QSignalMapper(this); |
| 27 | connect(sm, SIGNAL(mapped(int)), SLOT(start(int))); | 29 | connect(sm, SIGNAL(mapped(int)), SLOT(start(int))); |
| @@ -38,6 +40,9 @@ WashWindow::WashWindow(QWidget *parent, UdpHandler *udp) : | @@ -38,6 +40,9 @@ WashWindow::WashWindow(QWidget *parent, UdpHandler *udp) : | ||
| 38 | connect(ui->washButton_4, SIGNAL(clicked()), sm, SLOT(map())); | 40 | connect(ui->washButton_4, SIGNAL(clicked()), sm, SLOT(map())); |
| 39 | connect(ui->washButton_5, SIGNAL(clicked()), sm, SLOT(map())); | 41 | connect(ui->washButton_5, SIGNAL(clicked()), sm, SLOT(map())); |
| 40 | 42 | ||
| 43 | + returnToClockTimer.setSingleShot(true); | ||
| 44 | + returnToClockTimer.setInterval(10 * 1000); | ||
| 45 | + connect(&returnToClockTimer, SIGNAL(timeout()), SLOT(returnToClock())); | ||
| 41 | } | 46 | } |
| 42 | 47 | ||
| 43 | WashWindow::~WashWindow() | 48 | WashWindow::~WashWindow() |
| @@ -47,21 +52,28 @@ WashWindow::~WashWindow() | @@ -47,21 +52,28 @@ WashWindow::~WashWindow() | ||
| 47 | 52 | ||
| 48 | void WashWindow::start(int type) | 53 | void WashWindow::start(int type) |
| 49 | { | 54 | { |
| 50 | - if (started) | 55 | + if (selected) |
| 51 | return; | 56 | return; |
| 52 | 57 | ||
| 53 | if (type < 1 || type > 5) | 58 | if (type < 1 || type > 5) |
| 54 | return; | 59 | return; |
| 55 | 60 | ||
| 56 | - started = true; | 61 | + selected = true; |
| 57 | 62 | ||
| 58 | - udp->set(TG_OVEN_MODE, 2); | ||
| 59 | - udp->set(TG_CLEAN_TYPE, type); | ||
| 60 | - udp->turnOn(TG_SYSTEM); | ||
| 61 | - udp->turnOn(TG_CLEANING); | 63 | + this->type = type; |
| 64 | + | ||
| 65 | + returnToClockTimer.stop(); | ||
| 62 | 66 | ||
| 63 | - ui->upperStack->setCurrentIndex(1); | 67 | + ui->animation->clear(); |
| 68 | + ui->animation->load(":/images/animation/pull_01.png"); | ||
| 69 | + ui->animation->load(":/images/animation/pull_02.png"); | ||
| 70 | + ui->animation->load(":/images/animation/pull_03.png"); | ||
| 71 | + ui->animation->load(":/images/animation/pull_04.png"); | ||
| 72 | + ui->animation->show(); | ||
| 64 | ui->animation->start(300); | 73 | ui->animation->start(300); |
| 74 | + | ||
| 75 | + udp->set(TG_OVEN_MODE, 2); | ||
| 76 | + udp->turnOn(TG_SYSTEM); | ||
| 65 | } | 77 | } |
| 66 | 78 | ||
| 67 | void WashWindow::stop() | 79 | void WashWindow::stop() |
| @@ -69,20 +81,130 @@ void WashWindow::stop() | @@ -69,20 +81,130 @@ void WashWindow::stop() | ||
| 69 | udp->turnOff(TG_CLEANING); | 81 | udp->turnOff(TG_CLEANING); |
| 70 | } | 82 | } |
| 71 | 83 | ||
| 84 | +void WashWindow::returnToClock() | ||
| 85 | +{ | ||
| 86 | + ui->upperStack->setCurrentIndex(0); | ||
| 87 | +} | ||
| 88 | + | ||
| 72 | void WashWindow::onChanged() | 89 | void WashWindow::onChanged() |
| 73 | { | 90 | { |
| 74 | - if (!started) | 91 | + if (!selected) |
| 75 | return; | 92 | return; |
| 76 | 93 | ||
| 77 | - oven_control_t control; | ||
| 78 | -// oven_state_t state; | ||
| 79 | - udp->fillControl(control); | ||
| 80 | -// udp->fillData(state); | ||
| 81 | - | ||
| 82 | - ui->washStepGauge->setMaximum(control.clean_total); | ||
| 83 | - ui->washStepGauge->setValue(control.clean_step); | ||
| 84 | - ui->washStepCountLabel->setText(QString().sprintf("%d/%d", control.clean_step, control.clean_total)); | ||
| 85 | - ui->washStepTypeLabel->setText("세척 공정 진행"); | 94 | + oven_state_t state; |
| 95 | + udp->fillData(state); | ||
| 96 | + | ||
| 97 | + if (!opened) | ||
| 98 | + { | ||
| 99 | + if (state.door_state) | ||
| 100 | + { | ||
| 101 | + opened = true; | ||
| 102 | + | ||
| 103 | + ui->animation->clear(); | ||
| 104 | + | ||
| 105 | + ui->animation->load(":/images/animation/door_big_09.png"); | ||
| 106 | + ui->animation->load(":/images/animation/door_big_08.png"); | ||
| 107 | + ui->animation->load(":/images/animation/door_big_07.png"); | ||
| 108 | + ui->animation->load(":/images/animation/door_big_06.png"); | ||
| 109 | + ui->animation->load(":/images/animation/door_big_05.png"); | ||
| 110 | + ui->animation->load(":/images/animation/door_big_04.png"); | ||
| 111 | + ui->animation->load(":/images/animation/door_big_03.png"); | ||
| 112 | + ui->animation->load(":/images/animation/door_big_02.png"); | ||
| 113 | + ui->animation->load(":/images/animation/door_big_01.png"); | ||
| 114 | + ui->closeDoorArrow->show(); | ||
| 115 | + } | ||
| 116 | + } | ||
| 117 | + else if (!started) | ||
| 118 | + { | ||
| 119 | + if (!state.door_state) | ||
| 120 | + { | ||
| 121 | + started = true; | ||
| 122 | + | ||
| 123 | + ui->closeDoorArrow->hide(); | ||
| 124 | + ui->animation->clear(); | ||
| 125 | + | ||
| 126 | + ui->animation->load(":/images/animation/wash_01.png"); | ||
| 127 | + ui->animation->load(":/images/animation/wash_02.png"); | ||
| 128 | + ui->animation->load(":/images/animation/wash_03.png"); | ||
| 129 | + ui->animation->load(":/images/animation/wash_04.png"); | ||
| 130 | + ui->washStepGauge->setValue(0); | ||
| 131 | + ui->washStepTypeLabel->setText(""); | ||
| 132 | + ui->washStepCountLabel->setText(""); | ||
| 133 | + | ||
| 134 | + ui->upperStack->setCurrentIndex(1); | ||
| 135 | + | ||
| 136 | + udp->set(TG_CLEAN_TYPE, type); | ||
| 137 | + udp->turnOn(TG_CLEANING); | ||
| 138 | + } | ||
| 139 | + } | ||
| 140 | + else if (state.cleaning_sate) | ||
| 141 | + { | ||
| 142 | + if (!run) | ||
| 143 | + run = true; | ||
| 144 | + | ||
| 145 | + oven_control_t control; | ||
| 146 | + udp->fillControl(control); | ||
| 147 | + | ||
| 148 | + if (control.clean_total != 0 && control.clean_step != 0 && control.clean_step_type != 0) | ||
| 149 | + { | ||
| 150 | + ui->washStepGauge->setMaximum(control.clean_total); | ||
| 151 | + ui->washStepGauge->setValue(control.clean_step); | ||
| 152 | + ui->washStepCountLabel->setText(QString().sprintf("%d/%d", control.clean_step, control.clean_total)); | ||
| 153 | + | ||
| 154 | + switch (control.clean_step_type) | ||
| 155 | + { | ||
| 156 | + case 1: | ||
| 157 | + ui->washStepTypeLabel->setText("내부 헹굼"); | ||
| 158 | + break; | ||
| 159 | + case 2: | ||
| 160 | + ui->washStepTypeLabel->setText("Steam Generator Tank 급수"); | ||
| 161 | + break; | ||
| 162 | + case 3: | ||
| 163 | + ui->washStepTypeLabel->setText("Inner Tank 팬 사이드 세척"); | ||
| 164 | + break; | ||
| 165 | + case 4: | ||
| 166 | + ui->washStepTypeLabel->setText("Inner Tank 불림"); | ||
| 167 | + break; | ||
| 168 | + case 5: | ||
| 169 | + ui->washStepTypeLabel->setText("Inner Tank 강 세척"); | ||
| 170 | + break; | ||
| 171 | + case 6: | ||
| 172 | + ui->washStepTypeLabel->setText("Inner Tank 상부 세척"); | ||
| 173 | + break; | ||
| 174 | + case 7: | ||
| 175 | + ui->washStepTypeLabel->setText("Inner Tank 스팀 세척"); | ||
| 176 | + break; | ||
| 177 | + case 8: | ||
| 178 | + ui->washStepTypeLabel->setText("드레인 탱크 헹굼"); | ||
| 179 | + break; | ||
| 180 | + case 9: | ||
| 181 | + ui->washStepTypeLabel->setText("세제 세척수 만들기"); | ||
| 182 | + break; | ||
| 183 | + case 10: | ||
| 184 | + ui->washStepTypeLabel->setText("세제 세척수 헹굼"); | ||
| 185 | + break; | ||
| 186 | + case 11: | ||
| 187 | + ui->washStepTypeLabel->setText("드레인 탱크 헹굼수 채움"); | ||
| 188 | + break; | ||
| 189 | + } | ||
| 190 | + } | ||
| 191 | + } | ||
| 192 | + else if (run) | ||
| 193 | + { | ||
| 194 | + ui->washStepTypeLabel->setText("세척이 종료되었습니다"); | ||
| 195 | + ui->washStepCountLabel->setText(""); | ||
| 196 | + | ||
| 197 | + ui->animation->stop(); | ||
| 198 | + ui->animation->clear(); | ||
| 199 | + ui->animation->load(":/images/animation/wash_04.png"); | ||
| 200 | + | ||
| 201 | + returnToClockTimer.start(); | ||
| 202 | + | ||
| 203 | + selected = false; | ||
| 204 | + opened = false; | ||
| 205 | + started = false; | ||
| 206 | + run = false; | ||
| 207 | + } | ||
| 86 | } | 208 | } |
| 87 | 209 | ||
| 88 | void WashWindow::on_backButton_clicked() | 210 | void WashWindow::on_backButton_clicked() |
app/gui/oven_control/washwindow.h
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | #define WASHWINDOW_H | 2 | #define WASHWINDOW_H |
| 3 | 3 | ||
| 4 | #include <QMainWindow> | 4 | #include <QMainWindow> |
| 5 | +#include <QTimer> | ||
| 5 | 6 | ||
| 6 | #include "udphandler.h" | 7 | #include "udphandler.h" |
| 7 | 8 | ||
| @@ -20,6 +21,7 @@ public: | @@ -20,6 +21,7 @@ public: | ||
| 20 | private slots: | 21 | private slots: |
| 21 | void start(int type); | 22 | void start(int type); |
| 22 | void stop(); | 23 | void stop(); |
| 24 | + void returnToClock(); | ||
| 23 | void onChanged(); | 25 | void onChanged(); |
| 24 | void on_backButton_clicked(); | 26 | void on_backButton_clicked(); |
| 25 | 27 | ||
| @@ -27,7 +29,13 @@ private: | @@ -27,7 +29,13 @@ private: | ||
| 27 | Ui::WashWindow *ui; | 29 | Ui::WashWindow *ui; |
| 28 | UdpHandler *udp; | 30 | UdpHandler *udp; |
| 29 | 31 | ||
| 32 | + bool selected; | ||
| 33 | + bool opened; | ||
| 30 | bool started; | 34 | bool started; |
| 35 | + bool run; | ||
| 36 | + int type; | ||
| 37 | + | ||
| 38 | + QTimer returnToClockTimer; | ||
| 31 | }; | 39 | }; |
| 32 | 40 | ||
| 33 | #endif // WASHWINDOW_H | 41 | #endif // WASHWINDOW_H |
app/gui/oven_control/washwindow.ui
| @@ -87,16 +87,14 @@ border: none; | @@ -87,16 +87,14 @@ border: none; | ||
| 87 | </widget> | 87 | </widget> |
| 88 | <widget class="QWidget" name="progressContainer"> | 88 | <widget class="QWidget" name="progressContainer"> |
| 89 | <property name="styleSheet"> | 89 | <property name="styleSheet"> |
| 90 | - <string notr="true">QWidget#progressContainer { | ||
| 91 | -background-image: url(:/images/images/config/001_01_background_time.png); | ||
| 92 | -}</string> | 90 | + <string notr="true">#progressContainer { background-image: url(:/images/clock/background.png); }</string> |
| 93 | </property> | 91 | </property> |
| 94 | <widget class="WashStepGauge" name="washStepGauge" native="true"> | 92 | <widget class="WashStepGauge" name="washStepGauge" native="true"> |
| 95 | <property name="geometry"> | 93 | <property name="geometry"> |
| 96 | <rect> | 94 | <rect> |
| 97 | - <x>242</x> | 95 | + <x>184</x> |
| 98 | <y>320</y> | 96 | <y>320</y> |
| 99 | - <width>415</width> | 97 | + <width>532</width> |
| 100 | <height>58</height> | 98 | <height>58</height> |
| 101 | </rect> | 99 | </rect> |
| 102 | </property> | 100 | </property> |
| @@ -923,6 +921,22 @@ QPushButton:pressed { image: url(:/images/slider_icon/clean_ov.png); }</string> | @@ -923,6 +921,22 @@ QPushButton:pressed { image: url(:/images/slider_icon/clean_ov.png); }</string> | ||
| 923 | <string/> | 921 | <string/> |
| 924 | </property> | 922 | </property> |
| 925 | </widget> | 923 | </widget> |
| 924 | + <widget class="QLabel" name="closeDoorArrow"> | ||
| 925 | + <property name="geometry"> | ||
| 926 | + <rect> | ||
| 927 | + <x>420</x> | ||
| 928 | + <y>710</y> | ||
| 929 | + <width>85</width> | ||
| 930 | + <height>24</height> | ||
| 931 | + </rect> | ||
| 932 | + </property> | ||
| 933 | + <property name="text"> | ||
| 934 | + <string/> | ||
| 935 | + </property> | ||
| 936 | + <property name="pixmap"> | ||
| 937 | + <pixmap resource="resources.qrc">:/images/animation/close_door_arrow.png</pixmap> | ||
| 938 | + </property> | ||
| 939 | + </widget> | ||
| 926 | </widget> | 940 | </widget> |
| 927 | </widget> | 941 | </widget> |
| 928 | <customwidgets> | 942 | <customwidgets> |
| @@ -944,6 +958,8 @@ QPushButton:pressed { image: url(:/images/slider_icon/clean_ov.png); }</string> | @@ -944,6 +958,8 @@ QPushButton:pressed { image: url(:/images/slider_icon/clean_ov.png); }</string> | ||
| 944 | <container>1</container> | 958 | <container>1</container> |
| 945 | </customwidget> | 959 | </customwidget> |
| 946 | </customwidgets> | 960 | </customwidgets> |
| 947 | - <resources/> | 961 | + <resources> |
| 962 | + <include location="resources.qrc"/> | ||
| 963 | + </resources> | ||
| 948 | <connections/> | 964 | <connections/> |
| 949 | </ui> | 965 | </ui> |