Commit 6d5da5fca82da08a9784b59d19c8a960fe95552c
1 parent
f4f894f09b
Exists in
master
and in
2 other branches
청결/관리 상태 기능 반영
Showing
4 changed files
with
28 additions
and
4 deletions
Show diff stats
app/gui/oven_control/oven.cpp
@@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
5 | #include <cmath> | 5 | #include <cmath> |
6 | 6 | ||
7 | #include "soundplayer.h" | 7 | #include "soundplayer.h" |
8 | +#include "dirtylevel.h" | ||
8 | 9 | ||
9 | Oven *Oven::instance = 0; | 10 | Oven *Oven::instance = 0; |
10 | 11 | ||
@@ -358,6 +359,8 @@ void Oven::startCooking() | @@ -358,6 +359,8 @@ void Oven::startCooking() | ||
358 | cooking_ = true; | 359 | cooking_ = true; |
359 | cookingTimer.start(); | 360 | cookingTimer.start(); |
360 | interface->startCooking(); | 361 | interface->startCooking(); |
362 | + | ||
363 | + DirtyLevel::cookStart(); | ||
361 | } | 364 | } |
362 | 365 | ||
363 | emit changed(this); | 366 | emit changed(this); |
@@ -384,6 +387,8 @@ void Oven::stopCooking() | @@ -384,6 +387,8 @@ void Oven::stopCooking() | ||
384 | cooking_ = false; | 387 | cooking_ = false; |
385 | interface->stopCooking(); | 388 | interface->stopCooking(); |
386 | 389 | ||
390 | + DirtyLevel::cookEnd(); | ||
391 | + | ||
387 | emit changed(this); | 392 | emit changed(this); |
388 | } | 393 | } |
389 | } | 394 | } |
app/gui/oven_control/washwindow.cpp
@@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
4 | #include <QSignalMapper> | 4 | #include <QSignalMapper> |
5 | 5 | ||
6 | #include "soundplayer.h" | 6 | #include "soundplayer.h" |
7 | +#include "dirtylevel.h" | ||
7 | 8 | ||
8 | WashWindow::WashWindow(QWidget *parent) : | 9 | WashWindow::WashWindow(QWidget *parent) : |
9 | QMainWindow(parent), | 10 | QMainWindow(parent), |
@@ -48,6 +49,8 @@ WashWindow::WashWindow(QWidget *parent) : | @@ -48,6 +49,8 @@ WashWindow::WashWindow(QWidget *parent) : | ||
48 | 49 | ||
49 | foreach (QPushButton *button, findChildren<QPushButton *>()) | 50 | foreach (QPushButton *button, findChildren<QPushButton *>()) |
50 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); | 51 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); |
52 | + | ||
53 | + updateGauge(); | ||
51 | } | 54 | } |
52 | 55 | ||
53 | WashWindow::~WashWindow() | 56 | WashWindow::~WashWindow() |
@@ -97,6 +100,12 @@ void WashWindow::returnToClock() | @@ -97,6 +100,12 @@ void WashWindow::returnToClock() | ||
97 | ui->upperStack->setCurrentIndex(0); | 100 | ui->upperStack->setCurrentIndex(0); |
98 | } | 101 | } |
99 | 102 | ||
103 | +void WashWindow::updateGauge() | ||
104 | +{ | ||
105 | + ui->dirtySlider->setValue(DirtyLevel::dirty()); | ||
106 | + ui->stateSlider->setValue(DirtyLevel::state()); | ||
107 | +} | ||
108 | + | ||
100 | void WashWindow::onChanged() | 109 | void WashWindow::onChanged() |
101 | { | 110 | { |
102 | if (!selected) | 111 | if (!selected) |
@@ -213,6 +222,7 @@ void WashWindow::onChanged() | @@ -213,6 +222,7 @@ void WashWindow::onChanged() | ||
213 | else if (run) | 222 | else if (run) |
214 | { | 223 | { |
215 | SoundPlayer::playStop(); | 224 | SoundPlayer::playStop(); |
225 | + DirtyLevel::wash(type); | ||
216 | 226 | ||
217 | ui->titleLabel->setText("세척이 종료되었습니다"); | 227 | ui->titleLabel->setText("세척이 종료되었습니다"); |
218 | ui->descLabel->setText(""); | 228 | ui->descLabel->setText(""); |
@@ -229,6 +239,8 @@ void WashWindow::onChanged() | @@ -229,6 +239,8 @@ void WashWindow::onChanged() | ||
229 | opened = false; | 239 | opened = false; |
230 | started = false; | 240 | started = false; |
231 | run = false; | 241 | run = false; |
242 | + | ||
243 | + updateGauge(); | ||
232 | } | 244 | } |
233 | } | 245 | } |
234 | 246 |
app/gui/oven_control/washwindow.h
@@ -22,6 +22,7 @@ private slots: | @@ -22,6 +22,7 @@ private slots: | ||
22 | void start(int type); | 22 | void start(int type); |
23 | void stop(); | 23 | void stop(); |
24 | void returnToClock(); | 24 | void returnToClock(); |
25 | + void updateGauge(); | ||
25 | void onChanged(); | 26 | void onChanged(); |
26 | void on_backButton_clicked(); | 27 | void on_backButton_clicked(); |
27 | 28 |
app/gui/oven_control/washwindow.ui
@@ -851,7 +851,10 @@ QPushButton:pressed { image: url(:/images/slider_icon/management_ov.png); }</str | @@ -851,7 +851,10 @@ QPushButton:pressed { image: url(:/images/slider_icon/management_ov.png); }</str | ||
851 | <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> | 851 | <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> |
852 | </property> | 852 | </property> |
853 | </widget> | 853 | </widget> |
854 | - <widget class="QSlider" name="configSlider_4"> | 854 | + <widget class="QSlider" name="stateSlider"> |
855 | + <property name="enabled"> | ||
856 | + <bool>false</bool> | ||
857 | + </property> | ||
855 | <property name="geometry"> | 858 | <property name="geometry"> |
856 | <rect> | 859 | <rect> |
857 | <x>185</x> | 860 | <x>185</x> |
@@ -861,7 +864,7 @@ QPushButton:pressed { image: url(:/images/slider_icon/management_ov.png); }</str | @@ -861,7 +864,7 @@ QPushButton:pressed { image: url(:/images/slider_icon/management_ov.png); }</str | ||
861 | </rect> | 864 | </rect> |
862 | </property> | 865 | </property> |
863 | <property name="maximum"> | 866 | <property name="maximum"> |
864 | - <number>100</number> | 867 | + <number>5</number> |
865 | </property> | 868 | </property> |
866 | <property name="pageStep"> | 869 | <property name="pageStep"> |
867 | <number>1</number> | 870 | <number>1</number> |
@@ -1087,7 +1090,10 @@ QPushButton:pressed { image: url(:/images/slider_icon/clean_ov.png); }</string> | @@ -1087,7 +1090,10 @@ QPushButton:pressed { image: url(:/images/slider_icon/clean_ov.png); }</string> | ||
1087 | <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> | 1090 | <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> |
1088 | </property> | 1091 | </property> |
1089 | </widget> | 1092 | </widget> |
1090 | - <widget class="QSlider" name="configSlider_5"> | 1093 | + <widget class="QSlider" name="dirtySlider"> |
1094 | + <property name="enabled"> | ||
1095 | + <bool>false</bool> | ||
1096 | + </property> | ||
1091 | <property name="geometry"> | 1097 | <property name="geometry"> |
1092 | <rect> | 1098 | <rect> |
1093 | <x>185</x> | 1099 | <x>185</x> |
@@ -1097,7 +1103,7 @@ QPushButton:pressed { image: url(:/images/slider_icon/clean_ov.png); }</string> | @@ -1097,7 +1103,7 @@ QPushButton:pressed { image: url(:/images/slider_icon/clean_ov.png); }</string> | ||
1097 | </rect> | 1103 | </rect> |
1098 | </property> | 1104 | </property> |
1099 | <property name="maximum"> | 1105 | <property name="maximum"> |
1100 | - <number>100</number> | 1106 | + <number>5</number> |
1101 | </property> | 1107 | </property> |
1102 | <property name="pageStep"> | 1108 | <property name="pageStep"> |
1103 | <number>1</number> | 1109 | <number>1</number> |