Commit d0cfbd177bfec277a51efa7595220c9866497fc5
1 parent
fe52dcef99
Exists in
master
and in
2 other branches
GUI V0.1.10 (이 버전으로 배포)
- 컴파일 오류 수정
Showing
7 changed files
with
45 additions
and
61 deletions
Show diff stats
app/gui/oven_control/autocook.cpp
... | ... | @@ -26,7 +26,7 @@ void AutoCook::startStep() |
26 | 26 | startHumidity = oven->currentHumidity(); |
27 | 27 | startTemp = oven->currentTemp(); |
28 | 28 | isWaitingDoorOpened_ = false; |
29 | - oven->setMode(Oven::CombinationMode); | |
29 | + oven->setMode(currentStep.mode); | |
30 | 30 | oven->setHumidity(currentStep.humidity); |
31 | 31 | oven->setTemp(currentStep.temp); |
32 | 32 | oven->setFan(currentStep.fan); |
... | ... | @@ -39,7 +39,7 @@ void AutoCook::startStep() |
39 | 39 | startHumidity = oven->currentHumidity(); |
40 | 40 | startTemp = oven->currentTemp(); |
41 | 41 | isWaitingDoorOpened_ = false; |
42 | - oven->setMode(Oven::CombinationMode); | |
42 | + oven->setMode(currentStep.mode); | |
43 | 43 | oven->setHumidity(currentStep.humidity); |
44 | 44 | oven->setTemp(currentStep.temp); |
45 | 45 | oven->setFan(currentStep.fan); | ... | ... |
app/gui/oven_control/mainwindow.cpp
... | ... | @@ -25,7 +25,7 @@ MainWindow::~MainWindow() |
25 | 25 | delete ui; |
26 | 26 | } |
27 | 27 | |
28 | -void MainWindow::showManualCookWindow(Oven::Mode mode) | |
28 | +void MainWindow::showManualCookWindow(Define::Mode mode) | |
29 | 29 | { |
30 | 30 | ManualCookWindow *w = new ManualCookWindow(this, mode); |
31 | 31 | w->setWindowModality(Qt::WindowModal); |
... | ... | @@ -43,17 +43,17 @@ void MainWindow::showAutoCookSelectionWindow(Define::CookType type) |
43 | 43 | |
44 | 44 | void MainWindow::on_steamButton_clicked() |
45 | 45 | { |
46 | - showManualCookWindow(Oven::SteamMode); | |
46 | + showManualCookWindow(Define::SteamMode); | |
47 | 47 | } |
48 | 48 | |
49 | 49 | void MainWindow::on_combiButton_clicked() |
50 | 50 | { |
51 | - showManualCookWindow(Oven::CombinationMode); | |
51 | + showManualCookWindow(Define::CombiMode); | |
52 | 52 | } |
53 | 53 | |
54 | 54 | void MainWindow::on_dryheatButton_clicked() |
55 | 55 | { |
56 | - showManualCookWindow(Oven::HeatMode); | |
56 | + showManualCookWindow(Define::DryMode); | |
57 | 57 | } |
58 | 58 | |
59 | 59 | void MainWindow::on_poultryButton_clicked() | ... | ... |
app/gui/oven_control/mainwindow.h
app/gui/oven_control/manualcookwindow.cpp
... | ... | @@ -10,7 +10,7 @@ |
10 | 10 | |
11 | 11 | #include <QTime> |
12 | 12 | |
13 | -ManualCookWindow::ManualCookWindow(QWidget *parent, Oven::Mode mode) : | |
13 | +ManualCookWindow::ManualCookWindow(QWidget *parent, Define::Mode mode) : | |
14 | 14 | QMainWindow(parent), |
15 | 15 | ui(new Ui::ManualCookWindow) |
16 | 16 | { |
... | ... | @@ -188,13 +188,13 @@ void ManualCookWindow::onOvenUpdated(Oven *oven) |
188 | 188 | { |
189 | 189 | switch (oven->mode()) |
190 | 190 | { |
191 | - case Oven::HeatMode: | |
191 | + case Define::DryMode: | |
192 | 192 | ui->dryheatButton->setChecked(true); |
193 | 193 | break; |
194 | - case Oven::SteamMode: | |
194 | + case Define::SteamMode: | |
195 | 195 | ui->steamButton->setChecked(true); |
196 | 196 | break; |
197 | - case Oven::CombinationMode: | |
197 | + case Define::CombiMode: | |
198 | 198 | ui->combiButton->setChecked(true); |
199 | 199 | break; |
200 | 200 | default: |
... | ... | @@ -204,7 +204,7 @@ void ManualCookWindow::onOvenUpdated(Oven *oven) |
204 | 204 | bool old; |
205 | 205 | old = ui->humiditySlider->blockSignals(true); |
206 | 206 | ui->humiditySlider->setValue(oven->humidity()); |
207 | - ui->humiditySlider->setEnabled(oven->mode() == Oven::CombinationMode); | |
207 | + ui->humiditySlider->setEnabled(oven->mode() == Define::CombiMode); | |
208 | 208 | ui->humiditySlider->blockSignals(old); |
209 | 209 | |
210 | 210 | old = ui->tempSlider->blockSignals(true); |
... | ... | @@ -305,7 +305,7 @@ QPushButton:pressed {\ |
305 | 305 | updateLabels(); |
306 | 306 | } |
307 | 307 | |
308 | -void ManualCookWindow::setOvenDefault(Oven::Mode mode) | |
308 | +void ManualCookWindow::setOvenDefault(Define::Mode mode) | |
309 | 309 | { |
310 | 310 | stop(); |
311 | 311 | |
... | ... | @@ -328,17 +328,17 @@ void ManualCookWindow::stop() |
328 | 328 | |
329 | 329 | void ManualCookWindow::on_steamButton_clicked() |
330 | 330 | { |
331 | - setOvenDefault(Oven::SteamMode); | |
331 | + setOvenDefault(Define::SteamMode); | |
332 | 332 | } |
333 | 333 | |
334 | 334 | void ManualCookWindow::on_combiButton_clicked() |
335 | 335 | { |
336 | - setOvenDefault(Oven::CombinationMode); | |
336 | + setOvenDefault(Define::CombiMode); | |
337 | 337 | } |
338 | 338 | |
339 | 339 | void ManualCookWindow::on_dryheatButton_clicked() |
340 | 340 | { |
341 | - setOvenDefault(Oven::HeatMode); | |
341 | + setOvenDefault(Define::DryMode); | |
342 | 342 | } |
343 | 343 | |
344 | 344 | void ManualCookWindow::on_humidityButton_pressed() | ... | ... |
app/gui/oven_control/manualcookwindow.h
... | ... | @@ -15,7 +15,7 @@ class ManualCookWindow : public QMainWindow |
15 | 15 | Q_OBJECT |
16 | 16 | |
17 | 17 | public: |
18 | - explicit ManualCookWindow(QWidget *parent, Oven::Mode mode); | |
18 | + explicit ManualCookWindow(QWidget *parent, Define::Mode mode); | |
19 | 19 | ~ManualCookWindow(); |
20 | 20 | |
21 | 21 | signals: |
... | ... | @@ -25,7 +25,7 @@ public slots: |
25 | 25 | |
26 | 26 | private slots: |
27 | 27 | void setupAnimation(); |
28 | - void setOvenDefault(Oven::Mode mode); | |
28 | + void setOvenDefault(Define::Mode mode); | |
29 | 29 | void start(); |
30 | 30 | void stop(); |
31 | 31 | void checkTime(); | ... | ... |
app/gui/oven_control/oven.cpp
... | ... | @@ -51,19 +51,19 @@ void Oven::setInterface(OvenInterface *interface) |
51 | 51 | connect(interface, SIGNAL(doorClosed()), this, SLOT(onDoorClosed())); |
52 | 52 | } |
53 | 53 | |
54 | -void Oven::setMode(Mode mode) | |
54 | +void Oven::setMode(Define::Mode mode) | |
55 | 55 | { |
56 | 56 | if (setMode_(mode)) |
57 | 57 | emit changed(this); |
58 | 58 | } |
59 | 59 | |
60 | -bool Oven::setMode_(Mode mode) | |
60 | +bool Oven::setMode_(Define::Mode mode) | |
61 | 61 | { |
62 | 62 | switch (mode) |
63 | 63 | { |
64 | - case HeatMode: | |
65 | - case SteamMode: | |
66 | - case CombinationMode: | |
64 | + case Define::DryMode: | |
65 | + case Define::SteamMode: | |
66 | + case Define::CombiMode: | |
67 | 67 | break; |
68 | 68 | default: |
69 | 69 | return false; |
... | ... | @@ -72,19 +72,7 @@ bool Oven::setMode_(Mode mode) |
72 | 72 | if (mode != mode_) |
73 | 73 | { |
74 | 74 | mode_ = mode; |
75 | - | |
76 | - switch (mode) | |
77 | - { | |
78 | - case HeatMode: | |
79 | - interface->setMode(Define::DryMode); | |
80 | - break; | |
81 | - case SteamMode: | |
82 | - interface->setMode(Define::SteamMode); | |
83 | - break; | |
84 | - case CombinationMode: | |
85 | - interface->setMode(Define::CombiMode); | |
86 | - break; | |
87 | - } | |
75 | + interface->setMode(mode); | |
88 | 76 | |
89 | 77 | return true; |
90 | 78 | } |
... | ... | @@ -92,20 +80,20 @@ bool Oven::setMode_(Mode mode) |
92 | 80 | return false; |
93 | 81 | } |
94 | 82 | |
95 | -void Oven::setDefault(Mode mode) | |
83 | +void Oven::setDefault(Define::Mode mode) | |
96 | 84 | { |
97 | 85 | setMode_(mode); |
98 | 86 | switch (mode) |
99 | 87 | { |
100 | - case HeatMode: | |
88 | + case Define::DryMode: | |
101 | 89 | setHumidity_(0); |
102 | 90 | setTemp_(160); |
103 | 91 | break; |
104 | - case SteamMode: | |
92 | + case Define::SteamMode: | |
105 | 93 | setHumidity_(100); |
106 | 94 | setTemp_(100); |
107 | 95 | break; |
108 | - case CombinationMode: | |
96 | + case Define::CombiMode: | |
109 | 97 | setHumidity_(50); |
110 | 98 | setTemp_(100); |
111 | 99 | break; |
... | ... | @@ -776,11 +764,11 @@ int Oven::maxTemp() |
776 | 764 | { |
777 | 765 | switch (mode()) |
778 | 766 | { |
779 | - case HeatMode: | |
767 | + case Define::DryMode: | |
780 | 768 | return 300; |
781 | - case SteamMode: | |
769 | + case Define::SteamMode: | |
782 | 770 | return 130; |
783 | - case CombinationMode: | |
771 | + case Define::CombiMode: | |
784 | 772 | return 300; |
785 | 773 | default: |
786 | 774 | return 0; |
... | ... | @@ -791,11 +779,11 @@ int Oven::minTemp() |
791 | 779 | { |
792 | 780 | switch (mode()) |
793 | 781 | { |
794 | - case HeatMode: | |
782 | + case Define::DryMode: | |
795 | 783 | return 30; |
796 | - case SteamMode: | |
784 | + case Define::SteamMode: | |
797 | 785 | return 30; |
798 | - case CombinationMode: | |
786 | + case Define::CombiMode: | |
799 | 787 | return 30; |
800 | 788 | default: |
801 | 789 | return 0; |
... | ... | @@ -806,11 +794,11 @@ int Oven::maxInterTemp() |
806 | 794 | { |
807 | 795 | switch (mode()) |
808 | 796 | { |
809 | - case HeatMode: | |
797 | + case Define::DryMode: | |
810 | 798 | return 99; |
811 | - case SteamMode: | |
799 | + case Define::SteamMode: | |
812 | 800 | return 99; |
813 | - case CombinationMode: | |
801 | + case Define::CombiMode: | |
814 | 802 | return 99; |
815 | 803 | default: |
816 | 804 | return 0; |
... | ... | @@ -821,11 +809,11 @@ int Oven::minInterTemp() |
821 | 809 | { |
822 | 810 | switch (mode()) |
823 | 811 | { |
824 | - case HeatMode: | |
812 | + case Define::DryMode: | |
825 | 813 | return 30; |
826 | - case SteamMode: | |
814 | + case Define::SteamMode: | |
827 | 815 | return 30; |
828 | - case CombinationMode: | |
816 | + case Define::CombiMode: | |
829 | 817 | return 30; |
830 | 818 | default: |
831 | 819 | return 0; | ... | ... |
app/gui/oven_control/oven.h
... | ... | @@ -52,13 +52,9 @@ class Oven : public QObject |
52 | 52 | { |
53 | 53 | Q_OBJECT |
54 | 54 | |
55 | -public: | |
56 | - enum Mode { HeatMode, SteamMode, CombinationMode }; | |
57 | - | |
58 | -private: | |
59 | 55 | explicit Oven(QObject *parent = 0); |
60 | 56 | |
61 | - Mode mode_; | |
57 | + Define::Mode mode_; | |
62 | 58 | int humidity_; |
63 | 59 | int temp_; |
64 | 60 | int time_; |
... | ... | @@ -120,7 +116,7 @@ public: |
120 | 116 | return instance; |
121 | 117 | } |
122 | 118 | |
123 | - Mode mode() { return mode_; } | |
119 | + Define::Mode mode() { return mode_; } | |
124 | 120 | int humidity() { return humidity_; } |
125 | 121 | int temp() { return temp_; } |
126 | 122 | int time(); |
... | ... | @@ -160,8 +156,8 @@ signals: |
160 | 156 | void doorOpened(); |
161 | 157 | |
162 | 158 | public slots: |
163 | - void setMode(Mode mode); | |
164 | - void setDefault(Mode mode); | |
159 | + void setMode(Define::Mode mode); | |
160 | + void setDefault(Define::Mode mode); | |
165 | 161 | void setHumidity(int percentage); |
166 | 162 | void setTemp(int celsius); |
167 | 163 | void setTime(int secs); |
... | ... | @@ -199,7 +195,7 @@ public slots: |
199 | 195 | void setInterface(OvenInterface *interface); |
200 | 196 | |
201 | 197 | private slots: |
202 | - bool setMode_(Mode mode); | |
198 | + bool setMode_(Define::Mode mode); | |
203 | 199 | bool setHumidity_(int percentage); |
204 | 200 | bool setTemp_(int celsius); |
205 | 201 | bool setInterTempEnabled_(bool enabled); | ... | ... |