Commit 8d6b74605c6ec03508dd9e9fa130bb3aaaf85eaa

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

세척 시작 전 온도 검사 후 쿨다운

app/gui/oven_control/cooldownpopup.cpp
@@ -6,10 +6,9 @@ @@ -6,10 +6,9 @@
6 #include "soundplayer.h" 6 #include "soundplayer.h"
7 #include "stringer.h" 7 #include "stringer.h"
8 8
9 -CooldownPopup::CooldownPopup(QWidget *parent, Oven *oven) : 9 +CooldownPopup::CooldownPopup(QWidget *parent, int target) :
10 QWidget(parent), 10 QWidget(parent),
11 ui(new Ui::CooldownPopup), 11 ui(new Ui::CooldownPopup),
12 - oven(oven),  
13 showingCurrentTemp(false), 12 showingCurrentTemp(false),
14 needCookStarting(false) 13 needCookStarting(false)
15 { 14 {
@@ -17,6 +16,8 @@ CooldownPopup::CooldownPopup(QWidget *parent, Oven *oven) : @@ -17,6 +16,8 @@ CooldownPopup::CooldownPopup(QWidget *parent, Oven *oven) :
17 16
18 setAttribute(Qt::WA_DeleteOnClose); 17 setAttribute(Qt::WA_DeleteOnClose);
19 18
  19 + oven = Oven::getInstance();
  20 +
20 lastDisplayedFanLevel = -1; 21 lastDisplayedFanLevel = -1;
21 lastDisplayedHumidification = !oven->humidification(); 22 lastDisplayedHumidification = !oven->humidification();
22 23
@@ -33,6 +34,7 @@ CooldownPopup::CooldownPopup(QWidget *parent, Oven *oven) : @@ -33,6 +34,7 @@ CooldownPopup::CooldownPopup(QWidget *parent, Oven *oven) :
33 34
34 ui->tempSlider->setSubPixmap(":/images/slider/sub_red.png"); 35 ui->tempSlider->setSubPixmap(":/images/slider/sub_red.png");
35 ui->tempSlider->setRange(30, 300); 36 ui->tempSlider->setRange(30, 300);
  37 + ui->tempSlider->setValue(target);
36 38
37 cookingFanLevel = oven->fan(); 39 cookingFanLevel = oven->fan();
38 expectingFanLevel = oven->maxFan(); 40 expectingFanLevel = oven->maxFan();
app/gui/oven_control/cooldownpopup.h
@@ -15,7 +15,7 @@ class CooldownPopup : public QWidget @@ -15,7 +15,7 @@ class CooldownPopup : public QWidget
15 Q_OBJECT 15 Q_OBJECT
16 16
17 public: 17 public:
18 - explicit CooldownPopup(QWidget *parent = 0, Oven *oven = 0); 18 + explicit CooldownPopup(QWidget *parent = 0, int target = 30);
19 ~CooldownPopup(); 19 ~CooldownPopup();
20 20
21 protected: 21 protected:
app/gui/oven_control/manualcookwindow.cpp
@@ -988,7 +988,7 @@ void ManualCookWindow::on_cooldownButton_clicked() @@ -988,7 +988,7 @@ void ManualCookWindow::on_cooldownButton_clicked()
988 { 988 {
989 startCookingTimer.stop(); 989 startCookingTimer.stop();
990 990
991 - CooldownPopup *p = new CooldownPopup(this, oven); 991 + CooldownPopup *p = new CooldownPopup(this, 30);
992 p->setWindowModality(Qt::WindowModal); 992 p->setWindowModality(Qt::WindowModal);
993 p->showFullScreen(); 993 p->showFullScreen();
994 994
app/gui/oven_control/washwindow.cpp
@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 #include "configwindow.h" 9 #include "configwindow.h"
10 #include "mainwindow.h" 10 #include "mainwindow.h"
11 #include "ovenstatics.h" 11 #include "ovenstatics.h"
  12 +#include "cooldownpopup.h"
12 13
13 WashWindow::WashWindow(QWidget *parent) : 14 WashWindow::WashWindow(QWidget *parent) :
14 QMainWindow(parent), 15 QMainWindow(parent),
@@ -134,21 +135,48 @@ void WashWindow::start(int type) @@ -134,21 +135,48 @@ void WashWindow::start(int type)
134 if (type < 1 || type > 5) 135 if (type < 1 || type > 5)
135 return; 136 return;
136 137
137 - state = OpenDoor;  
138 -  
139 this->type = type; 138 this->type = type;
140 139
141 - returnToClockTimer.stop(); 140 + if (udp->getData().curr_heat > 60)
  141 + {
  142 + state = CoolDown;
142 143
143 - ui->animation->clear();  
144 - ui->animation->load(":/images/animation/pull_01.png");  
145 - ui->animation->load(":/images/animation/pull_02.png");  
146 - ui->animation->load(":/images/animation/pull_03.png");  
147 - ui->animation->load(":/images/animation/pull_04.png");  
148 - ui->animation->show();  
149 - ui->animation->start(300); 144 + CooldownPopup *p = new CooldownPopup(this, 60);
  145 + p->setWindowModality(Qt::WindowModal);
  146 + p->showFullScreen();
  147 +
  148 + connect(p, SIGNAL(destroyed(QObject*)), SLOT(resume()));
  149 + }
  150 + else
  151 + {
  152 + state = OpenDoor;
150 153
151 - udp->set(TG_OVEN_MODE, 2); 154 + returnToClockTimer.stop();
  155 +
  156 + ui->animation->clear();
  157 + ui->animation->load(":/images/animation/pull_01.png");
  158 + ui->animation->load(":/images/animation/pull_02.png");
  159 + ui->animation->load(":/images/animation/pull_03.png");
  160 + ui->animation->load(":/images/animation/pull_04.png");
  161 + ui->animation->show();
  162 + ui->animation->start(300);
  163 +
  164 + udp->set(TG_OVEN_MODE, 2);
  165 + }
  166 +}
  167 +
  168 +void WashWindow::resume()
  169 +{
  170 + if (udp->getData().door_state)
  171 + {
  172 + state = CloseDoor;
  173 + showCloseDoor();
  174 + }
  175 + else
  176 + {
  177 + state = Request;
  178 + request();
  179 + }
152 } 180 }
153 181
154 void WashWindow::stop() 182 void WashWindow::stop()
@@ -220,6 +248,48 @@ void WashWindow::updateView() @@ -220,6 +248,48 @@ void WashWindow::updateView()
220 } 248 }
221 } 249 }
222 250
  251 +void WashWindow::showCloseDoor()
  252 +{
  253 + ui->animation->clear();
  254 + ui->animation->load(":/images/animation/door_big_09.png");
  255 + ui->animation->load(":/images/animation/door_big_08.png");
  256 + ui->animation->load(":/images/animation/door_big_07.png");
  257 + ui->animation->load(":/images/animation/door_big_06.png");
  258 + ui->animation->load(":/images/animation/door_big_05.png");
  259 + ui->animation->load(":/images/animation/door_big_04.png");
  260 + ui->animation->load(":/images/animation/door_big_03.png");
  261 + ui->animation->load(":/images/animation/door_big_02.png");
  262 + ui->animation->load(":/images/animation/door_big_01.png");
  263 + ui->animation->start(300);
  264 + ui->closeDoorArrow->show();
  265 +}
  266 +
  267 +void WashWindow::request()
  268 +{
  269 + udp->set(TG_CLEAN_TYPE, type);
  270 + udp->turnOn(TG_CLEANING);
  271 +
  272 + OvenStatistics::getInstance()->setWashState(true);
  273 +
  274 + SoundPlayer::playStart();
  275 +
  276 + ui->closeDoorArrow->hide();
  277 + ui->animation->clear();
  278 + ui->animation->load(":/images/animation/wash_01.png");
  279 + ui->animation->load(":/images/animation/wash_02.png");
  280 + ui->animation->load(":/images/animation/wash_03.png");
  281 + ui->animation->load(":/images/animation/wash_04.png");
  282 + ui->animation->start(300);
  283 +
  284 + ui->washStepGauge->setValue(0);
  285 + ui->titleLabel->setText(tr("기기의 내부를 세척 중입니다"));
  286 + ui->descLabel->setText(tr("완료될 때까지 문을 열지 마세요.\n제품 내부의 자동 세척 기능을 실행 중입니다."));
  287 + ui->washStepTypeLabel->setText("");
  288 + ui->washStepCountLabel->setText("");
  289 +
  290 + ui->upperStack->setCurrentIndex(1);
  291 +}
  292 +
223 void WashWindow::onChanged() 293 void WashWindow::onChanged()
224 { 294 {
225 if (state == Idle) 295 if (state == Idle)
@@ -228,51 +298,20 @@ void WashWindow::onChanged() @@ -228,51 +298,20 @@ void WashWindow::onChanged()
228 switch (state) 298 switch (state)
229 { 299 {
230 case Idle: 300 case Idle:
  301 + case CoolDown:
231 return; 302 return;
232 case OpenDoor: 303 case OpenDoor:
233 if (udp->getData().door_state) 304 if (udp->getData().door_state)
234 { 305 {
235 state = CloseDoor; 306 state = CloseDoor;
236 -  
237 - ui->animation->clear();  
238 - ui->animation->load(":/images/animation/door_big_09.png");  
239 - ui->animation->load(":/images/animation/door_big_08.png");  
240 - ui->animation->load(":/images/animation/door_big_07.png");  
241 - ui->animation->load(":/images/animation/door_big_06.png");  
242 - ui->animation->load(":/images/animation/door_big_05.png");  
243 - ui->animation->load(":/images/animation/door_big_04.png");  
244 - ui->animation->load(":/images/animation/door_big_03.png");  
245 - ui->animation->load(":/images/animation/door_big_02.png");  
246 - ui->animation->load(":/images/animation/door_big_01.png");  
247 - ui->closeDoorArrow->show(); 307 + showCloseDoor();
248 } 308 }
249 break; 309 break;
250 case CloseDoor: 310 case CloseDoor:
251 if (!udp->getData().door_state) 311 if (!udp->getData().door_state)
252 { 312 {
253 state = Request; 313 state = Request;
254 -  
255 - SoundPlayer::playStart();  
256 -  
257 - ui->closeDoorArrow->hide();  
258 - ui->animation->clear();  
259 -  
260 - ui->animation->load(":/images/animation/wash_01.png");  
261 - ui->animation->load(":/images/animation/wash_02.png");  
262 - ui->animation->load(":/images/animation/wash_03.png");  
263 - ui->animation->load(":/images/animation/wash_04.png");  
264 - ui->washStepGauge->setValue(0);  
265 - ui->titleLabel->setText(tr("기기의 내부를 세척 중입니다"));  
266 - ui->descLabel->setText(tr("완료될 때까지 문을 열지 마세요.\n제품 내부의 자동 세척 기능을 실행 중입니다."));  
267 - ui->washStepTypeLabel->setText("");  
268 - ui->washStepCountLabel->setText("");  
269 -  
270 - ui->upperStack->setCurrentIndex(1);  
271 -  
272 - udp->set(TG_CLEAN_TYPE, type);  
273 - udp->turnOn(TG_CLEANING);  
274 -  
275 - OvenStatistics::getInstance()->setWashState(true); 314 + request();
276 } 315 }
277 break; 316 break;
278 case Request: 317 case Request:
@@ -371,6 +410,7 @@ void WashWindow::on_backButton_clicked() @@ -371,6 +410,7 @@ void WashWindow::on_backButton_clicked()
371 case Running: 410 case Running:
372 stop(); 411 stop();
373 break; 412 break;
  413 + case CoolDown:
374 case Stopping: 414 case Stopping:
375 case RequestClean: 415 case RequestClean:
376 case RunningClean: 416 case RunningClean:
@@ -398,6 +438,7 @@ void WashWindow::on_configButton_clicked() @@ -398,6 +438,7 @@ void WashWindow::on_configButton_clicked()
398 case Running: 438 case Running:
399 stop(); 439 stop();
400 break; 440 break;
  441 + case CoolDown:
401 case Stopping: 442 case Stopping:
402 case RequestClean: 443 case RequestClean:
403 case RunningClean: 444 case RunningClean:
app/gui/oven_control/washwindow.h
@@ -24,11 +24,15 @@ protected: @@ -24,11 +24,15 @@ protected:
24 24
25 private slots: 25 private slots:
26 void start(int type); 26 void start(int type);
  27 + void resume();
27 void stop(); 28 void stop();
28 void returnToClock(); 29 void returnToClock();
29 void updateGauge(); 30 void updateGauge();
30 void updateView(); 31 void updateView();
31 32
  33 + void showCloseDoor();
  34 + void request();
  35 +
32 void onChanged(); 36 void onChanged();
33 37
34 void on_backButton_clicked(); 38 void on_backButton_clicked();
@@ -40,7 +44,7 @@ private: @@ -40,7 +44,7 @@ private:
40 UdpHandler *udp; 44 UdpHandler *udp;
41 45
42 enum State { 46 enum State {
43 - Idle, OpenDoor, CloseDoor, Request, Running, Stopping, 47 + Idle, CoolDown, OpenDoor, CloseDoor, Request, Running, Stopping,
44 RequestClean, RunningClean 48 RequestClean, RunningClean
45 } state = Idle; 49 } state = Idle;
46 50