Commit cfc2fcc35abae38edf16dfbbc56d5afc4cec12d3
1 parent
6eb13ba2e3
Exists in
master
and in
2 other branches
쿨다운 팝업 추가
Showing
6 changed files
with
779 additions
and
7 deletions
Show diff stats
app/gui/oven_control/cooldownpopup.cpp
@@ -0,0 +1,205 @@ | @@ -0,0 +1,205 @@ | ||
1 | +#include "cooldownpopup.h" | ||
2 | +#include "ui_cooldownpopup.h" | ||
3 | + | ||
4 | +CooldownPopup::CooldownPopup(QWidget *parent, Oven *oven) : | ||
5 | + QWidget(parent), | ||
6 | + ui(new Ui::CooldownPopup), | ||
7 | + oven(oven), | ||
8 | + showingCurrentTemp(false) | ||
9 | +{ | ||
10 | + ui->setupUi(this); | ||
11 | + | ||
12 | + setAttribute(Qt::WA_DeleteOnClose); | ||
13 | + | ||
14 | + ui->openDoorAnimation->load(":/images/animation/door_big_01.png"); | ||
15 | + ui->openDoorAnimation->load(":/images/animation/door_big_02.png"); | ||
16 | + ui->openDoorAnimation->load(":/images/animation/door_big_03.png"); | ||
17 | + ui->openDoorAnimation->load(":/images/animation/door_big_04.png"); | ||
18 | + ui->openDoorAnimation->load(":/images/animation/door_big_05.png"); | ||
19 | + ui->openDoorAnimation->load(":/images/animation/door_big_06.png"); | ||
20 | + ui->openDoorAnimation->load(":/images/animation/door_big_07.png"); | ||
21 | + ui->openDoorAnimation->load(":/images/animation/door_big_08.png"); | ||
22 | + ui->openDoorAnimation->load(":/images/animation/door_big_09.png"); | ||
23 | + ui->openDoorAnimation->start(300); | ||
24 | + | ||
25 | + cookingFanLevel = oven->fan(); | ||
26 | + expectingFanLevel = oven->maxFan(); | ||
27 | + started = false; | ||
28 | + opened = false; | ||
29 | + | ||
30 | + connect(oven, SIGNAL(changed(Oven*)), SLOT(updateView())); | ||
31 | + | ||
32 | + cooldownStartTimer.setSingleShot(true); | ||
33 | + cooldownStartTimer.setInterval(2000); | ||
34 | + connect(&cooldownStartTimer, SIGNAL(timeout()), SLOT(start())); | ||
35 | + | ||
36 | + showCurrentTempTimer.setSingleShot(true); | ||
37 | + showCurrentTempTimer.setInterval(2000); | ||
38 | + connect(&showCurrentTempTimer, SIGNAL(timeout()), SLOT(showCurrentTemp())); | ||
39 | + | ||
40 | + checkOvenTimer.setInterval(100); | ||
41 | + connect(&checkOvenTimer, SIGNAL(timeout()), SLOT(checkOven())); | ||
42 | + | ||
43 | + connect(ui->tempSlider, SIGNAL(valueChanged(int)), SLOT(updateView())); | ||
44 | + | ||
45 | + updateView(); | ||
46 | + | ||
47 | + cooldownStartTimer.start(); | ||
48 | +} | ||
49 | + | ||
50 | +CooldownPopup::~CooldownPopup() | ||
51 | +{ | ||
52 | + delete ui; | ||
53 | +} | ||
54 | + | ||
55 | +void CooldownPopup::start() | ||
56 | +{ | ||
57 | + started = true; | ||
58 | + opened = false; | ||
59 | + | ||
60 | + checkOvenTimer.start(); | ||
61 | + | ||
62 | + updateView(); | ||
63 | +} | ||
64 | + | ||
65 | +void CooldownPopup::stop() | ||
66 | +{ | ||
67 | + started = false; | ||
68 | + | ||
69 | + oven->stopCooldown(); | ||
70 | + oven->setFan(cookingFanLevel); | ||
71 | + | ||
72 | + close(); | ||
73 | +} | ||
74 | + | ||
75 | +void CooldownPopup::showCurrentTemp() | ||
76 | +{ | ||
77 | + showingCurrentTemp = true; | ||
78 | + updateView(); | ||
79 | +} | ||
80 | + | ||
81 | +void CooldownPopup::updateView() | ||
82 | +{ | ||
83 | + int temp; | ||
84 | + if (showingCurrentTemp) | ||
85 | + temp = oven->currentTemp(); | ||
86 | + else | ||
87 | + temp = ui->tempSlider->value(); | ||
88 | + | ||
89 | + ui->tempCurrentLabel->setText(QString("%1<span style=\"font-size:11pt;\">℃</span>").arg(temp)); | ||
90 | + | ||
91 | + switch (expectingFanLevel) | ||
92 | + { | ||
93 | + case 1: | ||
94 | + ui->fanButton->setStyleSheet("background-image: url(:/images/cooldown/fan1.png);"); | ||
95 | + break; | ||
96 | + case 2: | ||
97 | + ui->fanButton->setStyleSheet("background-image: url(:/images/cooldown/fan2.png);"); | ||
98 | + break; | ||
99 | + case 3: | ||
100 | + ui->fanButton->setStyleSheet("background-image: url(:/images/cooldown/fan3.png);"); | ||
101 | + break; | ||
102 | + case 4: | ||
103 | + ui->fanButton->setStyleSheet("background-image: url(:/images/cooldown/fan4.png);"); | ||
104 | + break; | ||
105 | + case 5: | ||
106 | + ui->fanButton->setStyleSheet("background-image: url(:/images/cooldown/fan5.png);"); | ||
107 | + break; | ||
108 | + } | ||
109 | + | ||
110 | + if (oven->humidification()) | ||
111 | + ui->humidificationButton->setStyleSheet("background-image: url(:/images/cooldown/side_nozzle_ov.png);"); | ||
112 | + else | ||
113 | + ui->humidificationButton->setStyleSheet("background-image: url(:/images/cooldown/side_nozzle.png);"); | ||
114 | + | ||
115 | + if (started && !oven->door()) | ||
116 | + ui->openDoorWidget->show(); | ||
117 | + else | ||
118 | + ui->openDoorWidget->hide(); | ||
119 | +} | ||
120 | + | ||
121 | +void CooldownPopup::checkOven() | ||
122 | +{ | ||
123 | + updateView(); | ||
124 | + | ||
125 | + if (!started) | ||
126 | + return; | ||
127 | + | ||
128 | + if (!opened) | ||
129 | + { | ||
130 | + if (oven->door()) | ||
131 | + { | ||
132 | + opened = true; | ||
133 | + oven->setFan(expectingFanLevel); | ||
134 | + oven->startCooldown(); | ||
135 | + } | ||
136 | + } | ||
137 | + else | ||
138 | + { | ||
139 | + if (oven->currentTemp() <= ui->tempSlider->value()) | ||
140 | + { | ||
141 | + stop(); | ||
142 | + } | ||
143 | + } | ||
144 | +} | ||
145 | + | ||
146 | +void CooldownPopup::on_closeButton_clicked() | ||
147 | +{ | ||
148 | + stop(); | ||
149 | + close(); | ||
150 | +} | ||
151 | + | ||
152 | +void CooldownPopup::on_closeButton_2_clicked() | ||
153 | +{ | ||
154 | + stop(); | ||
155 | + close(); | ||
156 | +} | ||
157 | + | ||
158 | +void CooldownPopup::on_tempButton_pressed() | ||
159 | +{ | ||
160 | + showCurrentTempTimer.start(); | ||
161 | +} | ||
162 | + | ||
163 | +void CooldownPopup::on_tempButton_released() | ||
164 | +{ | ||
165 | + if (showCurrentTempTimer.isActive()) | ||
166 | + showCurrentTempTimer.stop(); | ||
167 | + | ||
168 | + if (showingCurrentTemp) | ||
169 | + { | ||
170 | + showingCurrentTemp = false; | ||
171 | + updateView(); | ||
172 | + } | ||
173 | +} | ||
174 | + | ||
175 | +void CooldownPopup::on_runButton_clicked() | ||
176 | +{ | ||
177 | + if (cooldownStartTimer.isActive()) | ||
178 | + { | ||
179 | + cooldownStartTimer.stop(); | ||
180 | + start(); | ||
181 | + } | ||
182 | +} | ||
183 | + | ||
184 | +void CooldownPopup::on_fanButton_clicked() | ||
185 | +{ | ||
186 | + expectingFanLevel--; | ||
187 | + if (expectingFanLevel < oven->minFan()) | ||
188 | + expectingFanLevel = oven->maxFan(); | ||
189 | + | ||
190 | + if (oven->cooldown()) | ||
191 | + oven->setFan(expectingFanLevel); | ||
192 | + else | ||
193 | + updateView(); | ||
194 | + | ||
195 | + if (cooldownStartTimer.isActive()) | ||
196 | + cooldownStartTimer.start(); | ||
197 | +} | ||
198 | + | ||
199 | +void CooldownPopup::on_humidificationButton_clicked() | ||
200 | +{ | ||
201 | + if (oven->humidification()) | ||
202 | + oven->stopHumidification(); | ||
203 | + else | ||
204 | + oven->startHumidification(); | ||
205 | +} |
app/gui/oven_control/cooldownpopup.h
@@ -0,0 +1,58 @@ | @@ -0,0 +1,58 @@ | ||
1 | +#ifndef COOLDOWNPOPUP_H | ||
2 | +#define COOLDOWNPOPUP_H | ||
3 | + | ||
4 | +#include <QWidget> | ||
5 | +#include <QTimer> | ||
6 | + | ||
7 | +#include "oven.h" | ||
8 | + | ||
9 | +namespace Ui { | ||
10 | +class CooldownPopup; | ||
11 | +} | ||
12 | + | ||
13 | +class CooldownPopup : public QWidget | ||
14 | +{ | ||
15 | + Q_OBJECT | ||
16 | + | ||
17 | +public: | ||
18 | + explicit CooldownPopup(QWidget *parent = 0, Oven *oven = 0); | ||
19 | + ~CooldownPopup(); | ||
20 | + | ||
21 | +private slots: | ||
22 | + void start(); | ||
23 | + void stop(); | ||
24 | + void showCurrentTemp(); | ||
25 | + void updateView(); | ||
26 | + void checkOven(); | ||
27 | + | ||
28 | + void on_closeButton_clicked(); | ||
29 | + | ||
30 | + void on_closeButton_2_clicked(); | ||
31 | + | ||
32 | + void on_tempButton_pressed(); | ||
33 | + | ||
34 | + void on_tempButton_released(); | ||
35 | + | ||
36 | + void on_runButton_clicked(); | ||
37 | + | ||
38 | + void on_fanButton_clicked(); | ||
39 | + | ||
40 | + void on_humidificationButton_clicked(); | ||
41 | + | ||
42 | +private: | ||
43 | + Ui::CooldownPopup *ui; | ||
44 | + Oven *oven; | ||
45 | + | ||
46 | + QTimer cooldownStartTimer; | ||
47 | + QTimer checkOvenTimer; | ||
48 | + | ||
49 | + bool showingCurrentTemp; | ||
50 | + QTimer showCurrentTempTimer; | ||
51 | + | ||
52 | + int cookingFanLevel; | ||
53 | + int expectingFanLevel; | ||
54 | + bool started; | ||
55 | + bool opened; | ||
56 | +}; | ||
57 | + | ||
58 | +#endif // COOLDOWNPOPUP_H |
app/gui/oven_control/cooldownpopup.ui
@@ -0,0 +1,445 @@ | @@ -0,0 +1,445 @@ | ||
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<ui version="4.0"> | ||
3 | + <class>CooldownPopup</class> | ||
4 | + <widget class="QWidget" name="CooldownPopup"> | ||
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>Form</string> | ||
15 | + </property> | ||
16 | + <property name="styleSheet"> | ||
17 | + <string notr="true">#closeButton { border: none; } | ||
18 | +#closeButton_2 { border: none; } | ||
19 | +#background { background-image: url(:/images/background/popup/373.png); } | ||
20 | + | ||
21 | +QPushButton { | ||
22 | +background-position: center; | ||
23 | +background-repeat: no-repeat; | ||
24 | +border: none; | ||
25 | +} | ||
26 | + | ||
27 | +QPushButton[style="icon"] { background-image: url(:/images/slider_icon/background.png); } | ||
28 | + | ||
29 | +QSlider::groove { | ||
30 | +background-image: url(:/images/slider/groove.png); | ||
31 | +background-repeat: no-repeat; | ||
32 | +background-position: center; | ||
33 | +} | ||
34 | + | ||
35 | +QSlider::sub-page { | ||
36 | +background-repeat: no-repeat; | ||
37 | +background-position: left center; | ||
38 | +margin: 0px 5px; | ||
39 | +} | ||
40 | + | ||
41 | +QSlider[sliderColor="red"]::sub-page { | ||
42 | +background-image: url(:/images/slider/sub_red.png); | ||
43 | +} | ||
44 | + | ||
45 | +QSlider[sliderColor="yellow"]::sub-page { | ||
46 | +background-image: url(:/images/slider/sub_yellow.png); | ||
47 | +} | ||
48 | + | ||
49 | +QSlider[sliderColor="white"]::sub-page { | ||
50 | +background-image: url(:/images/slider/sub_white.png); | ||
51 | +} | ||
52 | + | ||
53 | +QSlider[sliderColor="blue"]::sub-page { | ||
54 | +background-image: url(:/images/slider/sub_blue.png); | ||
55 | +} | ||
56 | + | ||
57 | +QSlider[sliderColor="green"]::sub-page { | ||
58 | +background-image: url(:/images/slider/sub_green.png); | ||
59 | +} | ||
60 | + | ||
61 | +QSlider::handle { | ||
62 | +background-image: url(:/images/slider/handle_big.png); | ||
63 | +background-repeat: no-repeat; | ||
64 | +background-position: center; | ||
65 | +width: 23px; | ||
66 | +height: 33px; | ||
67 | +}</string> | ||
68 | + </property> | ||
69 | + <widget class="QPushButton" name="closeButton_2"> | ||
70 | + <property name="geometry"> | ||
71 | + <rect> | ||
72 | + <x>0</x> | ||
73 | + <y>801</y> | ||
74 | + <width>900</width> | ||
75 | + <height>799</height> | ||
76 | + </rect> | ||
77 | + </property> | ||
78 | + <property name="text"> | ||
79 | + <string/> | ||
80 | + </property> | ||
81 | + </widget> | ||
82 | + <widget class="QWidget" name="background" native="true"> | ||
83 | + <property name="geometry"> | ||
84 | + <rect> | ||
85 | + <x>0</x> | ||
86 | + <y>426</y> | ||
87 | + <width>900</width> | ||
88 | + <height>373</height> | ||
89 | + </rect> | ||
90 | + </property> | ||
91 | + <widget class="QPushButton" name="tempButton"> | ||
92 | + <property name="geometry"> | ||
93 | + <rect> | ||
94 | + <x>30</x> | ||
95 | + <y>50</y> | ||
96 | + <width>140</width> | ||
97 | + <height>140</height> | ||
98 | + </rect> | ||
99 | + </property> | ||
100 | + <property name="styleSheet"> | ||
101 | + <string notr="true">QPushButton { image: url(:/images/slider_icon/cooldown.png); } | ||
102 | +QPushButton::pressed { image: url(:/images/slider_icon/cooldown_ov.png); }</string> | ||
103 | + </property> | ||
104 | + <property name="text"> | ||
105 | + <string notr="true"/> | ||
106 | + </property> | ||
107 | + <property name="style" stdset="0"> | ||
108 | + <string notr="true">icon</string> | ||
109 | + </property> | ||
110 | + </widget> | ||
111 | + <widget class="QPushButton" name="runButton"> | ||
112 | + <property name="geometry"> | ||
113 | + <rect> | ||
114 | + <x>590</x> | ||
115 | + <y>260</y> | ||
116 | + <width>78</width> | ||
117 | + <height>78</height> | ||
118 | + </rect> | ||
119 | + </property> | ||
120 | + <property name="styleSheet"> | ||
121 | + <string notr="true">QPushButton { background-image: url(:/images/cooldown/run.png); } | ||
122 | +QPushButton:pressed { background-image: url(:/images/cooldown/run_ov.png); }</string> | ||
123 | + </property> | ||
124 | + <property name="text"> | ||
125 | + <string/> | ||
126 | + </property> | ||
127 | + </widget> | ||
128 | + <widget class="QPushButton" name="fanButton"> | ||
129 | + <property name="geometry"> | ||
130 | + <rect> | ||
131 | + <x>690</x> | ||
132 | + <y>260</y> | ||
133 | + <width>78</width> | ||
134 | + <height>78</height> | ||
135 | + </rect> | ||
136 | + </property> | ||
137 | + <property name="styleSheet"> | ||
138 | + <string notr="true">QPushButton { background-image: url(:/images/cooldown/fan5.png); }</string> | ||
139 | + </property> | ||
140 | + <property name="text"> | ||
141 | + <string/> | ||
142 | + </property> | ||
143 | + </widget> | ||
144 | + <widget class="QPushButton" name="humidificationButton"> | ||
145 | + <property name="geometry"> | ||
146 | + <rect> | ||
147 | + <x>790</x> | ||
148 | + <y>260</y> | ||
149 | + <width>78</width> | ||
150 | + <height>78</height> | ||
151 | + </rect> | ||
152 | + </property> | ||
153 | + <property name="styleSheet"> | ||
154 | + <string notr="true">QPushButton { background-image: url(:/images/cooldown/side_nozzle.png); } | ||
155 | +QPushButton:pressed { background-image: url(:/images/cooldown/side_nozzle_ov.png); }</string> | ||
156 | + </property> | ||
157 | + <property name="text"> | ||
158 | + <string/> | ||
159 | + </property> | ||
160 | + </widget> | ||
161 | + <widget class="QLabel" name="tempMaxLabel"> | ||
162 | + <property name="enabled"> | ||
163 | + <bool>true</bool> | ||
164 | + </property> | ||
165 | + <property name="geometry"> | ||
166 | + <rect> | ||
167 | + <x>711</x> | ||
168 | + <y>60</y> | ||
169 | + <width>151</width> | ||
170 | + <height>51</height> | ||
171 | + </rect> | ||
172 | + </property> | ||
173 | + <property name="palette"> | ||
174 | + <palette> | ||
175 | + <active> | ||
176 | + <colorrole role="WindowText"> | ||
177 | + <brush brushstyle="SolidPattern"> | ||
178 | + <color alpha="255"> | ||
179 | + <red>255</red> | ||
180 | + <green>255</green> | ||
181 | + <blue>255</blue> | ||
182 | + </color> | ||
183 | + </brush> | ||
184 | + </colorrole> | ||
185 | + </active> | ||
186 | + <inactive> | ||
187 | + <colorrole role="WindowText"> | ||
188 | + <brush brushstyle="SolidPattern"> | ||
189 | + <color alpha="255"> | ||
190 | + <red>255</red> | ||
191 | + <green>255</green> | ||
192 | + <blue>255</blue> | ||
193 | + </color> | ||
194 | + </brush> | ||
195 | + </colorrole> | ||
196 | + </inactive> | ||
197 | + <disabled> | ||
198 | + <colorrole role="WindowText"> | ||
199 | + <brush brushstyle="SolidPattern"> | ||
200 | + <color alpha="255"> | ||
201 | + <red>123</red> | ||
202 | + <green>123</green> | ||
203 | + <blue>123</blue> | ||
204 | + </color> | ||
205 | + </brush> | ||
206 | + </colorrole> | ||
207 | + </disabled> | ||
208 | + </palette> | ||
209 | + </property> | ||
210 | + <property name="font"> | ||
211 | + <font> | ||
212 | + <family>Malgun Gothic</family> | ||
213 | + <pointsize>9</pointsize> | ||
214 | + </font> | ||
215 | + </property> | ||
216 | + <property name="text"> | ||
217 | + <string>증가</string> | ||
218 | + </property> | ||
219 | + <property name="alignment"> | ||
220 | + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | ||
221 | + </property> | ||
222 | + </widget> | ||
223 | + <widget class="QLabel" name="tempMinLabel"> | ||
224 | + <property name="enabled"> | ||
225 | + <bool>true</bool> | ||
226 | + </property> | ||
227 | + <property name="geometry"> | ||
228 | + <rect> | ||
229 | + <x>196</x> | ||
230 | + <y>60</y> | ||
231 | + <width>151</width> | ||
232 | + <height>51</height> | ||
233 | + </rect> | ||
234 | + </property> | ||
235 | + <property name="palette"> | ||
236 | + <palette> | ||
237 | + <active> | ||
238 | + <colorrole role="WindowText"> | ||
239 | + <brush brushstyle="SolidPattern"> | ||
240 | + <color alpha="255"> | ||
241 | + <red>255</red> | ||
242 | + <green>255</green> | ||
243 | + <blue>255</blue> | ||
244 | + </color> | ||
245 | + </brush> | ||
246 | + </colorrole> | ||
247 | + </active> | ||
248 | + <inactive> | ||
249 | + <colorrole role="WindowText"> | ||
250 | + <brush brushstyle="SolidPattern"> | ||
251 | + <color alpha="255"> | ||
252 | + <red>255</red> | ||
253 | + <green>255</green> | ||
254 | + <blue>255</blue> | ||
255 | + </color> | ||
256 | + </brush> | ||
257 | + </colorrole> | ||
258 | + </inactive> | ||
259 | + <disabled> | ||
260 | + <colorrole role="WindowText"> | ||
261 | + <brush brushstyle="SolidPattern"> | ||
262 | + <color alpha="255"> | ||
263 | + <red>123</red> | ||
264 | + <green>123</green> | ||
265 | + <blue>123</blue> | ||
266 | + </color> | ||
267 | + </brush> | ||
268 | + </colorrole> | ||
269 | + </disabled> | ||
270 | + </palette> | ||
271 | + </property> | ||
272 | + <property name="font"> | ||
273 | + <font> | ||
274 | + <family>Malgun Gothic</family> | ||
275 | + <pointsize>9</pointsize> | ||
276 | + </font> | ||
277 | + </property> | ||
278 | + <property name="text"> | ||
279 | + <string>감소</string> | ||
280 | + </property> | ||
281 | + <property name="alignment"> | ||
282 | + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> | ||
283 | + </property> | ||
284 | + </widget> | ||
285 | + <widget class="QSlider" name="tempSlider"> | ||
286 | + <property name="geometry"> | ||
287 | + <rect> | ||
288 | + <x>196</x> | ||
289 | + <y>103</y> | ||
290 | + <width>666</width> | ||
291 | + <height>33</height> | ||
292 | + </rect> | ||
293 | + </property> | ||
294 | + <property name="minimum"> | ||
295 | + <number>30</number> | ||
296 | + </property> | ||
297 | + <property name="maximum"> | ||
298 | + <number>300</number> | ||
299 | + </property> | ||
300 | + <property name="pageStep"> | ||
301 | + <number>10</number> | ||
302 | + </property> | ||
303 | + <property name="tracking"> | ||
304 | + <bool>true</bool> | ||
305 | + </property> | ||
306 | + <property name="orientation"> | ||
307 | + <enum>Qt::Horizontal</enum> | ||
308 | + </property> | ||
309 | + <property name="sliderColor" stdset="0"> | ||
310 | + <string>red</string> | ||
311 | + </property> | ||
312 | + </widget> | ||
313 | + <widget class="QLabel" name="tempCurrentLabel"> | ||
314 | + <property name="enabled"> | ||
315 | + <bool>true</bool> | ||
316 | + </property> | ||
317 | + <property name="geometry"> | ||
318 | + <rect> | ||
319 | + <x>210</x> | ||
320 | + <y>130</y> | ||
321 | + <width>641</width> | ||
322 | + <height>51</height> | ||
323 | + </rect> | ||
324 | + </property> | ||
325 | + <property name="palette"> | ||
326 | + <palette> | ||
327 | + <active> | ||
328 | + <colorrole role="WindowText"> | ||
329 | + <brush brushstyle="SolidPattern"> | ||
330 | + <color alpha="255"> | ||
331 | + <red>255</red> | ||
332 | + <green>255</green> | ||
333 | + <blue>255</blue> | ||
334 | + </color> | ||
335 | + </brush> | ||
336 | + </colorrole> | ||
337 | + </active> | ||
338 | + <inactive> | ||
339 | + <colorrole role="WindowText"> | ||
340 | + <brush brushstyle="SolidPattern"> | ||
341 | + <color alpha="255"> | ||
342 | + <red>255</red> | ||
343 | + <green>255</green> | ||
344 | + <blue>255</blue> | ||
345 | + </color> | ||
346 | + </brush> | ||
347 | + </colorrole> | ||
348 | + </inactive> | ||
349 | + <disabled> | ||
350 | + <colorrole role="WindowText"> | ||
351 | + <brush brushstyle="SolidPattern"> | ||
352 | + <color alpha="255"> | ||
353 | + <red>123</red> | ||
354 | + <green>123</green> | ||
355 | + <blue>123</blue> | ||
356 | + </color> | ||
357 | + </brush> | ||
358 | + </colorrole> | ||
359 | + </disabled> | ||
360 | + </palette> | ||
361 | + </property> | ||
362 | + <property name="font"> | ||
363 | + <font> | ||
364 | + <family>Roboto</family> | ||
365 | + <pointsize>16</pointsize> | ||
366 | + <weight>75</weight> | ||
367 | + <bold>true</bold> | ||
368 | + </font> | ||
369 | + </property> | ||
370 | + <property name="text"> | ||
371 | + <string>스팀</string> | ||
372 | + </property> | ||
373 | + <property name="alignment"> | ||
374 | + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | ||
375 | + </property> | ||
376 | + </widget> | ||
377 | + </widget> | ||
378 | + <widget class="QPushButton" name="closeButton"> | ||
379 | + <property name="geometry"> | ||
380 | + <rect> | ||
381 | + <x>0</x> | ||
382 | + <y>0</y> | ||
383 | + <width>900</width> | ||
384 | + <height>426</height> | ||
385 | + </rect> | ||
386 | + </property> | ||
387 | + <property name="text"> | ||
388 | + <string/> | ||
389 | + </property> | ||
390 | + </widget> | ||
391 | + <widget class="QWidget" name="openDoorWidget" native="true"> | ||
392 | + <property name="geometry"> | ||
393 | + <rect> | ||
394 | + <x>0</x> | ||
395 | + <y>0</y> | ||
396 | + <width>900</width> | ||
397 | + <height>426</height> | ||
398 | + </rect> | ||
399 | + </property> | ||
400 | + <property name="styleSheet"> | ||
401 | + <string notr="true">#openDoorWidget { background-image: url(:/images/clock/background.png); }</string> | ||
402 | + </property> | ||
403 | + <widget class="AnimatedImageBox" name="openDoorAnimation"> | ||
404 | + <property name="geometry"> | ||
405 | + <rect> | ||
406 | + <x>366</x> | ||
407 | + <y>20</y> | ||
408 | + <width>251</width> | ||
409 | + <height>292</height> | ||
410 | + </rect> | ||
411 | + </property> | ||
412 | + <property name="text"> | ||
413 | + <string>TextLabel</string> | ||
414 | + </property> | ||
415 | + </widget> | ||
416 | + <widget class="QLabel" name="label_5"> | ||
417 | + <property name="geometry"> | ||
418 | + <rect> | ||
419 | + <x>430</x> | ||
420 | + <y>170</y> | ||
421 | + <width>85</width> | ||
422 | + <height>24</height> | ||
423 | + </rect> | ||
424 | + </property> | ||
425 | + <property name="text"> | ||
426 | + <string/> | ||
427 | + </property> | ||
428 | + <property name="pixmap"> | ||
429 | + <pixmap resource="resources.qrc">:/images/animation/open_door_arrow.png</pixmap> | ||
430 | + </property> | ||
431 | + </widget> | ||
432 | + </widget> | ||
433 | + </widget> | ||
434 | + <customwidgets> | ||
435 | + <customwidget> | ||
436 | + <class>AnimatedImageBox</class> | ||
437 | + <extends>QLabel</extends> | ||
438 | + <header>animatedimagebox.h</header> | ||
439 | + </customwidget> | ||
440 | + </customwidgets> | ||
441 | + <resources> | ||
442 | + <include location="resources.qrc"/> | ||
443 | + </resources> | ||
444 | + <connections/> | ||
445 | +</ui> |
app/gui/oven_control/manualcookwindow.cpp
@@ -6,6 +6,7 @@ | @@ -6,6 +6,7 @@ | ||
6 | #include <QtDebug> | 6 | #include <QtDebug> |
7 | 7 | ||
8 | #include "preheatpopup.h" | 8 | #include "preheatpopup.h" |
9 | +#include "cooldownpopup.h" | ||
9 | 10 | ||
10 | ManualCookWindow::ManualCookWindow(QWidget *parent, Oven *oven, UdpHandler *udp) : | 11 | ManualCookWindow::ManualCookWindow(QWidget *parent, Oven *oven, UdpHandler *udp) : |
11 | QMainWindow(parent), | 12 | QMainWindow(parent), |
@@ -14,6 +15,7 @@ ManualCookWindow::ManualCookWindow(QWidget *parent, Oven *oven, UdpHandler *udp) | @@ -14,6 +15,7 @@ ManualCookWindow::ManualCookWindow(QWidget *parent, Oven *oven, UdpHandler *udp) | ||
14 | ui->setupUi(this); | 15 | ui->setupUi(this); |
15 | 16 | ||
16 | ui->clockContainer->setParent(ui->upperStack); | 17 | ui->clockContainer->setParent(ui->upperStack); |
18 | + ui->closeDoorWidget->setParent(ui->upperStack); | ||
17 | ui->outerStack->setParent(ui->bodyStack); | 19 | ui->outerStack->setParent(ui->bodyStack); |
18 | ui->innerStack->setParent(ui->bodyStack); | 20 | ui->innerStack->setParent(ui->bodyStack); |
19 | setAttribute(Qt::WA_DeleteOnClose); | 21 | setAttribute(Qt::WA_DeleteOnClose); |
@@ -91,6 +93,17 @@ ManualCookWindow::ManualCookWindow(QWidget *parent, Oven *oven, UdpHandler *udp) | @@ -91,6 +93,17 @@ ManualCookWindow::ManualCookWindow(QWidget *parent, Oven *oven, UdpHandler *udp) | ||
91 | connect(this, SIGNAL(cookStopRequested()), cookingStartTimer, SLOT(stop())); | 93 | connect(this, SIGNAL(cookStopRequested()), cookingStartTimer, SLOT(stop())); |
92 | 94 | ||
93 | ui->bodyStack->setCurrentIndex(0); | 95 | ui->bodyStack->setCurrentIndex(0); |
96 | + | ||
97 | + ui->openDoorAnimation->load(":/images/animation/door_big_09.png"); | ||
98 | + ui->openDoorAnimation->load(":/images/animation/door_big_08.png"); | ||
99 | + ui->openDoorAnimation->load(":/images/animation/door_big_07.png"); | ||
100 | + ui->openDoorAnimation->load(":/images/animation/door_big_06.png"); | ||
101 | + ui->openDoorAnimation->load(":/images/animation/door_big_05.png"); | ||
102 | + ui->openDoorAnimation->load(":/images/animation/door_big_04.png"); | ||
103 | + ui->openDoorAnimation->load(":/images/animation/door_big_03.png"); | ||
104 | + ui->openDoorAnimation->load(":/images/animation/door_big_02.png"); | ||
105 | + ui->openDoorAnimation->load(":/images/animation/door_big_01.png"); | ||
106 | + ui->openDoorAnimation->start(300); | ||
94 | } | 107 | } |
95 | 108 | ||
96 | ManualCookWindow::~ManualCookWindow() | 109 | ManualCookWindow::~ManualCookWindow() |
@@ -318,6 +331,11 @@ QPushButton:pressed {\ | @@ -318,6 +331,11 @@ QPushButton:pressed {\ | ||
318 | break; | 331 | break; |
319 | } | 332 | } |
320 | 333 | ||
334 | + if (oven->paused() && !oven->cooldown() && oven->door()) | ||
335 | + ui->upperStack->setCurrentIndex(1); | ||
336 | + else | ||
337 | + ui->upperStack->setCurrentIndex(0); | ||
338 | + | ||
321 | updateLabels(); | 339 | updateLabels(); |
322 | } | 340 | } |
323 | 341 | ||
@@ -394,10 +412,11 @@ void ManualCookWindow::on_repeatButton_clicked() | @@ -394,10 +412,11 @@ void ManualCookWindow::on_repeatButton_clicked() | ||
394 | 412 | ||
395 | void ManualCookWindow::on_cooldownButton_clicked() | 413 | void ManualCookWindow::on_cooldownButton_clicked() |
396 | { | 414 | { |
397 | - if (oven->cooldown()) | ||
398 | - oven->stopCooldown(); | ||
399 | - else | ||
400 | - oven->startCooldown(); | 415 | + cookingStartTimer->stop(); |
416 | + | ||
417 | + CooldownPopup *p = new CooldownPopup(this, oven); | ||
418 | + p->setWindowModality(Qt::WindowModal); | ||
419 | + p->showFullScreen(); | ||
401 | } | 420 | } |
402 | 421 | ||
403 | void ManualCookWindow::on_reserveButton_clicked() | 422 | void ManualCookWindow::on_reserveButton_clicked() |
app/gui/oven_control/manualcookwindow.ui
@@ -106,6 +106,43 @@ height: 33px; | @@ -106,6 +106,43 @@ height: 33px; | ||
106 | </property> | 106 | </property> |
107 | </widget> | 107 | </widget> |
108 | </widget> | 108 | </widget> |
109 | + <widget class="QWidget" name="closeDoorWidget"> | ||
110 | + <property name="styleSheet"> | ||
111 | + <string notr="true">#closeDoorWidget { background-image: url(:/images/clock/background.png); }</string> | ||
112 | + </property> | ||
113 | + <widget class="AnimatedImageBox" name="openDoorAnimation"> | ||
114 | + <property name="geometry"> | ||
115 | + <rect> | ||
116 | + <x>366</x> | ||
117 | + <y>20</y> | ||
118 | + <width>251</width> | ||
119 | + <height>292</height> | ||
120 | + </rect> | ||
121 | + </property> | ||
122 | + <property name="text"> | ||
123 | + <string/> | ||
124 | + </property> | ||
125 | + <property name="pixmap"> | ||
126 | + <pixmap resource="resources.qrc">:/images/animation/door_big_02.png</pixmap> | ||
127 | + </property> | ||
128 | + </widget> | ||
129 | + <widget class="QLabel" name="label_5"> | ||
130 | + <property name="geometry"> | ||
131 | + <rect> | ||
132 | + <x>430</x> | ||
133 | + <y>170</y> | ||
134 | + <width>85</width> | ||
135 | + <height>24</height> | ||
136 | + </rect> | ||
137 | + </property> | ||
138 | + <property name="text"> | ||
139 | + <string/> | ||
140 | + </property> | ||
141 | + <property name="pixmap"> | ||
142 | + <pixmap resource="resources.qrc">:/images/animation/close_door_arrow.png</pixmap> | ||
143 | + </property> | ||
144 | + </widget> | ||
145 | + </widget> | ||
109 | </widget> | 146 | </widget> |
110 | <widget class="QPushButton" name="combiButton"> | 147 | <widget class="QPushButton" name="combiButton"> |
111 | <property name="geometry"> | 148 | <property name="geometry"> |
@@ -2427,6 +2464,11 @@ QPushButton:pressed { border-image: url(:/images/manual_button/ok_ov.png); }</st | @@ -2427,6 +2464,11 @@ QPushButton:pressed { border-image: url(:/images/manual_button/ok_ov.png); }</st | ||
2427 | <header>clock.h</header> | 2464 | <header>clock.h</header> |
2428 | <container>1</container> | 2465 | <container>1</container> |
2429 | </customwidget> | 2466 | </customwidget> |
2467 | + <customwidget> | ||
2468 | + <class>AnimatedImageBox</class> | ||
2469 | + <extends>QLabel</extends> | ||
2470 | + <header>animatedimagebox.h</header> | ||
2471 | + </customwidget> | ||
2430 | </customwidgets> | 2472 | </customwidgets> |
2431 | <resources> | 2473 | <resources> |
2432 | <include location="resources.qrc"/> | 2474 | <include location="resources.qrc"/> |
app/gui/oven_control/oven_control.pro
@@ -41,7 +41,8 @@ SOURCES += main.cpp\ | @@ -41,7 +41,8 @@ SOURCES += main.cpp\ | ||
41 | washwindow.cpp \ | 41 | washwindow.cpp \ |
42 | washstepgauge.cpp \ | 42 | washstepgauge.cpp \ |
43 | preheatpopup.cpp \ | 43 | preheatpopup.cpp \ |
44 | - longpreheattempgauge.cpp | 44 | + longpreheattempgauge.cpp \ |
45 | + cooldownpopup.cpp | ||
45 | 46 | ||
46 | HEADERS += mainwindow.h \ | 47 | HEADERS += mainwindow.h \ |
47 | cook.h \ | 48 | cook.h \ |
@@ -71,7 +72,8 @@ HEADERS += mainwindow.h \ | @@ -71,7 +72,8 @@ HEADERS += mainwindow.h \ | ||
71 | washwindow.h \ | 72 | washwindow.h \ |
72 | washstepgauge.h \ | 73 | washstepgauge.h \ |
73 | preheatpopup.h \ | 74 | preheatpopup.h \ |
74 | - longpreheattempgauge.h | 75 | + longpreheattempgauge.h \ |
76 | + cooldownpopup.h | ||
75 | 77 | ||
76 | FORMS += mainwindow.ui \ | 78 | FORMS += mainwindow.ui \ |
77 | manualcookwindow.ui \ | 79 | manualcookwindow.ui \ |
@@ -87,7 +89,8 @@ FORMS += mainwindow.ui \ | @@ -87,7 +89,8 @@ FORMS += mainwindow.ui \ | ||
87 | autocookwindow.ui \ | 89 | autocookwindow.ui \ |
88 | autocookconfigwindow.ui \ | 90 | autocookconfigwindow.ui \ |
89 | washwindow.ui \ | 91 | washwindow.ui \ |
90 | - preheatpopup.ui | 92 | + preheatpopup.ui \ |
93 | + cooldownpopup.ui | ||
91 | 94 | ||
92 | RESOURCES += \ | 95 | RESOURCES += \ |
93 | resources.qrc | 96 | resources.qrc |