Commit 71bc74deb31b5686feae15cfaed5fbfba8a38c1e
1 parent
e064d04c8d
Exists in
master
and in
2 other branches
스팀 통 세척 추가
Showing
5 changed files
with
430 additions
and
3 deletions
Show diff stats
app/gui/oven_control/config.cpp
... | ... | @@ -18,6 +18,7 @@ |
18 | 18 | #include "confighalfenergydlg.h" |
19 | 19 | #include "config1digitsetdlg.h" |
20 | 20 | #include "configdutywashdlg.h" |
21 | +#include "configsteamwashdlg.h" | |
21 | 22 | #include "fileprocessor.h" |
22 | 23 | #include "backlight.h" |
23 | 24 | #include "udphandler.h" |
... | ... | @@ -536,6 +537,9 @@ void Config::execConfigWindow(QWidget *parent, Define::ConfigType idx){ |
536 | 537 | case config_demo_mode: |
537 | 538 | dlg = new ConfigDemoModeDlg(parent); |
538 | 539 | break; |
540 | + case config_steam_wash: | |
541 | + dlg = new ConfigSteamWashDlg(parent); | |
542 | + break; | |
539 | 543 | default: |
540 | 544 | dlg=NULL; |
541 | 545 | } | ... | ... |
app/gui/oven_control/configsteamwashdlg.cpp
... | ... | @@ -0,0 +1,193 @@ |
1 | +#include "configsteamwashdlg.h" | |
2 | +#include "ui_configsteamwashdlg.h" | |
3 | + | |
4 | +#include "udphandler.h" | |
5 | + | |
6 | +ConfigSteamWashDlg::ConfigSteamWashDlg(QWidget *parent) : | |
7 | + QDialog(parent), | |
8 | + ui(new Ui::ConfigSteamWashDlg) | |
9 | +{ | |
10 | + ui->setupUi(this); | |
11 | + | |
12 | + setWindowFlags(Qt::FramelessWindowHint); | |
13 | + setAttribute(Qt::WA_NoSystemBackground); | |
14 | + setAttribute(Qt::WA_TranslucentBackground); | |
15 | + setAttribute(Qt::WA_DeleteOnClose); | |
16 | + setFocus(); | |
17 | + | |
18 | + qApp->setActiveWindow(this); | |
19 | + | |
20 | + UdpHandler *udp = UdpHandler::getInstance(); | |
21 | + connect(udp, SIGNAL(changed()), SLOT(onChanged())); | |
22 | + | |
23 | + updateView(); | |
24 | +} | |
25 | + | |
26 | +ConfigSteamWashDlg::~ConfigSteamWashDlg() | |
27 | +{ | |
28 | + delete ui; | |
29 | +} | |
30 | + | |
31 | +void ConfigSteamWashDlg::updateView() | |
32 | +{ | |
33 | + switch (phase) { | |
34 | + case Idle: | |
35 | + ui->ctrLbBody->setText(tr("시작하시겠습니까?")); | |
36 | + ui->ctrLbBody->show(); | |
37 | + ui->ctrGauge->hide(); | |
38 | + ui->ctrBtnOk->setGeometry(300, 350, 150, 100); | |
39 | + ui->ctrBtnOk->show(); | |
40 | + ui->ctrBtnCancel->show(); | |
41 | + break; | |
42 | + case Starting: | |
43 | + ui->ctrLbBody->hide(); | |
44 | + ui->ctrGauge->hide(); | |
45 | + ui->ctrBtnOk->hide(); | |
46 | + ui->ctrBtnCancel->hide(); | |
47 | + break; | |
48 | + case Started: | |
49 | + { | |
50 | + UdpHandler *udp = UdpHandler::getInstance(); | |
51 | + | |
52 | + oven_control_t control; | |
53 | + udp->fillControl(control); | |
54 | + | |
55 | + switch (control.clean_step_type) | |
56 | + { | |
57 | + case 1: | |
58 | + ui->ctrLbBody->setText(tr("내부 헹굼 진행 중입니다.")); | |
59 | + break; | |
60 | + case 2: | |
61 | + ui->ctrLbBody->setText(tr("스팀 급수 진행 중입니다.")); | |
62 | + break; | |
63 | + case 3: | |
64 | + ui->ctrLbBody->setText(tr("내부 팬 세척 진행 중입니다.")); | |
65 | + break; | |
66 | + case 4: | |
67 | + ui->ctrLbBody->setText(tr("내부 스팀 불림 진행 중입니다.")); | |
68 | + break; | |
69 | + case 5: | |
70 | + ui->ctrLbBody->setText(tr("내부 강 세척 진행 중입니다.")); | |
71 | + break; | |
72 | + case 6: | |
73 | + ui->ctrLbBody->setText(tr("내부 상부 세척 진행 중입니다.")); | |
74 | + break; | |
75 | + case 7: | |
76 | + ui->ctrLbBody->setText(tr("내부 스팀 세척 진행 중입니다.")); | |
77 | + break; | |
78 | + case 8: | |
79 | + ui->ctrLbBody->setText(tr("세척 종료 진행 중입니다.")); | |
80 | + break; | |
81 | + case 9: | |
82 | + ui->ctrLbBody->setText(tr("세제 세척수 만들기 진행 중입니다.")); | |
83 | + break; | |
84 | + case 10: | |
85 | + ui->ctrLbBody->setText(tr("세제 세척수 헹굼 진행 중입니다.")); | |
86 | + break; | |
87 | + case 11: | |
88 | + ui->ctrLbBody->setText(tr("하부 탱크 세척수 만들기 진행 중입니다.")); | |
89 | + break; | |
90 | + } | |
91 | + ui->ctrLbBody->show(); | |
92 | + | |
93 | + ui->ctrGauge->setMaximum(control.clean_total); | |
94 | + ui->ctrGauge->setValue(control.clean_step); | |
95 | + ui->ctrGauge->show(); | |
96 | + | |
97 | + ui->ctrBtnOk->hide(); | |
98 | + ui->ctrBtnCancel->hide(); | |
99 | + break; | |
100 | + } | |
101 | + case Finished: | |
102 | + ui->ctrLbBody->setText(tr("세척이 종료되었습니다")); | |
103 | + ui->ctrLbBody->show(); | |
104 | + ui->ctrGauge->setMaximum(1); | |
105 | + ui->ctrGauge->setValue(1); | |
106 | + ui->ctrGauge->show(); | |
107 | + ui->ctrBtnOk->setGeometry(300, 350, 300, 100); | |
108 | + ui->ctrBtnOk->show(); | |
109 | + ui->ctrBtnCancel->hide(); | |
110 | + } | |
111 | +} | |
112 | + | |
113 | +void ConfigSteamWashDlg::onChanged() | |
114 | +{ | |
115 | + switch (phase) { | |
116 | + case Idle: | |
117 | + return; | |
118 | + case Starting: | |
119 | + if (isStarted()) | |
120 | + phase = Started; | |
121 | + break; | |
122 | + case Started: | |
123 | + if (isFinished()) | |
124 | + phase = Finished; | |
125 | + break; | |
126 | + case Finished: | |
127 | + return; | |
128 | + } | |
129 | + | |
130 | + updateView(); | |
131 | +} | |
132 | + | |
133 | +void ConfigSteamWashDlg::start() | |
134 | +{ | |
135 | + UdpHandler *udp = UdpHandler::getInstance(); | |
136 | + udp->set(TG_OVEN_MODE, 2); | |
137 | + udp->set(TG_CLEAN_TYPE, 6); | |
138 | + udp->turnOn(TG_CLEANING); | |
139 | + | |
140 | + phase = Starting; | |
141 | + | |
142 | + updateView(); | |
143 | +} | |
144 | + | |
145 | +bool ConfigSteamWashDlg::isStarted() | |
146 | +{ | |
147 | + UdpHandler *udp = UdpHandler::getInstance(); | |
148 | + | |
149 | + oven_control_t control; | |
150 | + oven_state_t state; | |
151 | + udp->fillControl(control); | |
152 | + udp->fillData(state); | |
153 | + | |
154 | + return state.cleaning_sate != 0 | |
155 | + && control.clean_total != 0 | |
156 | + && control.clean_step != 0 | |
157 | + && control.clean_step_type != 0; | |
158 | +} | |
159 | + | |
160 | +bool ConfigSteamWashDlg::isFinished() | |
161 | +{ | |
162 | + UdpHandler *udp = UdpHandler::getInstance(); | |
163 | + | |
164 | + oven_state_t state; | |
165 | + udp->fillData(state); | |
166 | + | |
167 | + return state.cleaning_sate == 0; | |
168 | +} | |
169 | + | |
170 | +void ConfigSteamWashDlg::on_ctrBtnOk_clicked() | |
171 | +{ | |
172 | + switch (phase) { | |
173 | + case Idle: | |
174 | + start(); | |
175 | + break; | |
176 | + case Finished: | |
177 | + close(); | |
178 | + break; | |
179 | + default: | |
180 | + return; | |
181 | + } | |
182 | +} | |
183 | + | |
184 | +void ConfigSteamWashDlg::on_ctrBtnCancel_clicked() | |
185 | +{ | |
186 | + switch (phase) { | |
187 | + case Idle: | |
188 | + close(); | |
189 | + break; | |
190 | + default: | |
191 | + return; | |
192 | + } | |
193 | +} | ... | ... |
app/gui/oven_control/configsteamwashdlg.h
... | ... | @@ -0,0 +1,41 @@ |
1 | +#ifndef CONFIGSTEAMWASHDLG_H | |
2 | +#define CONFIGSTEAMWASHDLG_H | |
3 | + | |
4 | +#include <QDialog> | |
5 | +#include <QTimer> | |
6 | + | |
7 | +namespace Ui { | |
8 | +class ConfigSteamWashDlg; | |
9 | +} | |
10 | + | |
11 | +class ConfigSteamWashDlg : public QDialog | |
12 | +{ | |
13 | + Q_OBJECT | |
14 | + | |
15 | + enum Phase { | |
16 | + Idle, Starting, Started, Finished | |
17 | + }; | |
18 | + | |
19 | +public: | |
20 | + explicit ConfigSteamWashDlg(QWidget *parent = 0); | |
21 | + ~ConfigSteamWashDlg(); | |
22 | + | |
23 | +private slots: | |
24 | + void updateView(); | |
25 | + | |
26 | + void onChanged(); | |
27 | + | |
28 | + void start(); | |
29 | + bool isStarted(); | |
30 | + bool isFinished(); | |
31 | + | |
32 | + void on_ctrBtnOk_clicked(); | |
33 | + void on_ctrBtnCancel_clicked(); | |
34 | + | |
35 | +private: | |
36 | + Ui::ConfigSteamWashDlg *ui; | |
37 | + | |
38 | + enum Phase phase = Idle; | |
39 | +}; | |
40 | + | |
41 | +#endif // CONFIGSTEAMWASHDLG_H | ... | ... |
app/gui/oven_control/configsteamwashdlg.ui
... | ... | @@ -0,0 +1,186 @@ |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<ui version="4.0"> | |
3 | + <class>ConfigSteamWashDlg</class> | |
4 | + <widget class="QDialog" name="ConfigSteamWashDlg"> | |
5 | + <property name="geometry"> | |
6 | + <rect> | |
7 | + <x>0</x> | |
8 | + <y>0</y> | |
9 | + <width>900</width> | |
10 | + <height>1600</height> | |
11 | + </rect> | |
12 | + </property> | |
13 | + <property name="windowTitle"> | |
14 | + <string>Dialog</string> | |
15 | + </property> | |
16 | + <property name="styleSheet"> | |
17 | + <string notr="true">#centralWidget { background-image: url(:/images/background/popup/503.png); | |
18 | +} | |
19 | +</string> | |
20 | + </property> | |
21 | + <widget class="QWidget" name="centralWidget" native="true"> | |
22 | + <property name="geometry"> | |
23 | + <rect> | |
24 | + <x>0</x> | |
25 | + <y>430</y> | |
26 | + <width>900</width> | |
27 | + <height>503</height> | |
28 | + </rect> | |
29 | + </property> | |
30 | + <property name="styleSheet"> | |
31 | + <string notr="true"/> | |
32 | + </property> | |
33 | + <widget class="QPushButton" name="ctrBtnOk"> | |
34 | + <property name="geometry"> | |
35 | + <rect> | |
36 | + <x>300</x> | |
37 | + <y>350</y> | |
38 | + <width>150</width> | |
39 | + <height>100</height> | |
40 | + </rect> | |
41 | + </property> | |
42 | + <property name="font"> | |
43 | + <font> | |
44 | + <weight>75</weight> | |
45 | + <bold>true</bold> | |
46 | + <underline>true</underline> | |
47 | + </font> | |
48 | + </property> | |
49 | + <property name="styleSheet"> | |
50 | + <string notr="true">QPushButton { | |
51 | +border: none; | |
52 | +color: white; | |
53 | +} | |
54 | +QPushButton:pressed, QPushButton:focus { | |
55 | +color: yellow; | |
56 | +}</string> | |
57 | + </property> | |
58 | + <property name="text"> | |
59 | + <string>확인</string> | |
60 | + </property> | |
61 | + </widget> | |
62 | + <widget class="QLabel" name="ctrLbTitle"> | |
63 | + <property name="geometry"> | |
64 | + <rect> | |
65 | + <x>0</x> | |
66 | + <y>0</y> | |
67 | + <width>900</width> | |
68 | + <height>91</height> | |
69 | + </rect> | |
70 | + </property> | |
71 | + <property name="font"> | |
72 | + <font> | |
73 | + <family>나눔고딕</family> | |
74 | + <pointsize>13</pointsize> | |
75 | + <weight>75</weight> | |
76 | + <bold>true</bold> | |
77 | + </font> | |
78 | + </property> | |
79 | + <property name="styleSheet"> | |
80 | + <string notr="true">QLabel { | |
81 | + color : white; | |
82 | + border : none; | |
83 | +}</string> | |
84 | + </property> | |
85 | + <property name="text"> | |
86 | + <string>증기 발생기 헹굼</string> | |
87 | + </property> | |
88 | + <property name="alignment"> | |
89 | + <set>Qt::AlignCenter</set> | |
90 | + </property> | |
91 | + </widget> | |
92 | + <widget class="Line" name="line"> | |
93 | + <property name="geometry"> | |
94 | + <rect> | |
95 | + <x>0</x> | |
96 | + <y>93</y> | |
97 | + <width>900</width> | |
98 | + <height>3</height> | |
99 | + </rect> | |
100 | + </property> | |
101 | + <property name="orientation"> | |
102 | + <enum>Qt::Horizontal</enum> | |
103 | + </property> | |
104 | + </widget> | |
105 | + <widget class="QLabel" name="ctrLbBody"> | |
106 | + <property name="geometry"> | |
107 | + <rect> | |
108 | + <x>0</x> | |
109 | + <y>100</y> | |
110 | + <width>900</width> | |
111 | + <height>91</height> | |
112 | + </rect> | |
113 | + </property> | |
114 | + <property name="font"> | |
115 | + <font> | |
116 | + <family>나눔고딕</family> | |
117 | + <pointsize>13</pointsize> | |
118 | + <weight>75</weight> | |
119 | + <bold>true</bold> | |
120 | + </font> | |
121 | + </property> | |
122 | + <property name="styleSheet"> | |
123 | + <string notr="true">QLabel { | |
124 | + color : white; | |
125 | + border : none; | |
126 | +}</string> | |
127 | + </property> | |
128 | + <property name="text"> | |
129 | + <string>시작하시겠습니까?</string> | |
130 | + </property> | |
131 | + <property name="alignment"> | |
132 | + <set>Qt::AlignCenter</set> | |
133 | + </property> | |
134 | + </widget> | |
135 | + <widget class="WashStepGauge" name="ctrGauge" native="true"> | |
136 | + <property name="geometry"> | |
137 | + <rect> | |
138 | + <x>184</x> | |
139 | + <y>210</y> | |
140 | + <width>532</width> | |
141 | + <height>58</height> | |
142 | + </rect> | |
143 | + </property> | |
144 | + </widget> | |
145 | + <widget class="QPushButton" name="ctrBtnCancel"> | |
146 | + <property name="geometry"> | |
147 | + <rect> | |
148 | + <x>450</x> | |
149 | + <y>350</y> | |
150 | + <width>150</width> | |
151 | + <height>100</height> | |
152 | + </rect> | |
153 | + </property> | |
154 | + <property name="font"> | |
155 | + <font> | |
156 | + <weight>75</weight> | |
157 | + <bold>true</bold> | |
158 | + <underline>true</underline> | |
159 | + </font> | |
160 | + </property> | |
161 | + <property name="styleSheet"> | |
162 | + <string notr="true">QPushButton { | |
163 | +border: none; | |
164 | +color: white; | |
165 | +} | |
166 | +QPushButton:pressed, QPushButton:focus { | |
167 | +color: yellow; | |
168 | +}</string> | |
169 | + </property> | |
170 | + <property name="text"> | |
171 | + <string>취소</string> | |
172 | + </property> | |
173 | + </widget> | |
174 | + </widget> | |
175 | + </widget> | |
176 | + <customwidgets> | |
177 | + <customwidget> | |
178 | + <class>WashStepGauge</class> | |
179 | + <extends>QWidget</extends> | |
180 | + <header>washstepgauge.h</header> | |
181 | + <container>1</container> | |
182 | + </customwidget> | |
183 | + </customwidgets> | |
184 | + <resources/> | |
185 | + <connections/> | |
186 | +</ui> | ... | ... |
app/gui/oven_control/oven_control.pro
... | ... | @@ -126,7 +126,8 @@ SOURCES += main.cpp\ |
126 | 126 | configdemomodedlg.cpp \ |
127 | 127 | demoicon.cpp \ |
128 | 128 | halfenergyicon.cpp \ |
129 | - notipopupdlg.cpp | |
129 | + notipopupdlg.cpp \ | |
130 | + configsteamwashdlg.cpp | |
130 | 131 | |
131 | 132 | |
132 | 133 | HEADERS += mainwindow.h \ |
... | ... | @@ -243,7 +244,8 @@ HEADERS += mainwindow.h \ |
243 | 244 | configdemomodedlg.h \ |
244 | 245 | demoicon.h \ |
245 | 246 | halfenergyicon.h \ |
246 | - notipopupdlg.h | |
247 | + notipopupdlg.h \ | |
248 | + configsteamwashdlg.h | |
247 | 249 | |
248 | 250 | FORMS += mainwindow.ui \ |
249 | 251 | manualcookwindow.ui \ |
... | ... | @@ -323,7 +325,8 @@ FORMS += mainwindow.ui \ |
323 | 325 | autocookcheckconfigwindow.ui \ |
324 | 326 | programmedcookpanelbutton.ui \ |
325 | 327 | configdemomodedlg.ui \ |
326 | - notipopupdlg.ui | |
328 | + notipopupdlg.ui \ | |
329 | + configsteamwashdlg.ui | |
327 | 330 | |
328 | 331 | RESOURCES += \ |
329 | 332 | resources.qrc | ... | ... |