Commit 5cf78e0e698734230457c5aadc4c4b0d6ed0063b
1 parent
f7926454e6
Exists in
master
and in
2 other branches
모델 설정을 환경 설정에 반영
Showing
4 changed files
with
39 additions
and
22 deletions
Show diff stats
app/gui/oven_control/electricmodelsettingwindow.cpp
| ... | ... | @@ -16,24 +16,34 @@ ElectricModelSettingWindow::~ElectricModelSettingWindow() |
| 16 | 16 | delete ui; |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | -void ElectricModelSettingWindow::on_e10Button_clicked() | |
| 19 | +void ElectricModelSettingWindow::setModel(Define::model_type model) | |
| 20 | 20 | { |
| 21 | + Define::config_item item; | |
| 22 | + item.d32 = (int) model; | |
| 21 | 23 | |
| 24 | + Config *config = Config::getInstance(); | |
| 25 | + config->setConfigValue(Define::config_model, item); | |
| 26 | + config->saveConfig(); | |
| 22 | 27 | } |
| 23 | 28 | |
| 24 | -void ElectricModelSettingWindow::on_e20Button_clicked() | |
| 29 | +void ElectricModelSettingWindow::on_e10Button_clicked() | |
| 25 | 30 | { |
| 31 | + setModel(Define::model_electric_10); | |
| 32 | +} | |
| 26 | 33 | |
| 34 | +void ElectricModelSettingWindow::on_e20Button_clicked() | |
| 35 | +{ | |
| 36 | + setModel(Define::model_electric_20); | |
| 27 | 37 | } |
| 28 | 38 | |
| 29 | 39 | void ElectricModelSettingWindow::on_e24Button_clicked() |
| 30 | 40 | { |
| 31 | - | |
| 41 | + setModel(Define::model_electric_24); | |
| 32 | 42 | } |
| 33 | 43 | |
| 34 | 44 | void ElectricModelSettingWindow::on_e40Button_clicked() |
| 35 | 45 | { |
| 36 | - | |
| 46 | + setModel(Define::model_electric_40); | |
| 37 | 47 | } |
| 38 | 48 | |
| 39 | 49 | void ElectricModelSettingWindow::on_backButton_clicked() | ... | ... |
app/gui/oven_control/electricmodelsettingwindow.h
| ... | ... | @@ -3,6 +3,8 @@ |
| 3 | 3 | |
| 4 | 4 | #include <QMainWindow> |
| 5 | 5 | |
| 6 | +#include "config.h" | |
| 7 | + | |
| 6 | 8 | namespace Ui { |
| 7 | 9 | class ElectricModelSettingWindow; |
| 8 | 10 | } |
| ... | ... | @@ -16,12 +18,11 @@ public: |
| 16 | 18 | ~ElectricModelSettingWindow(); |
| 17 | 19 | |
| 18 | 20 | private slots: |
| 19 | - void on_e10Button_clicked(); | |
| 21 | + void setModel(Define::model_type model); | |
| 20 | 22 | |
| 23 | + void on_e10Button_clicked(); | |
| 21 | 24 | void on_e20Button_clicked(); |
| 22 | - | |
| 23 | 25 | void on_e24Button_clicked(); |
| 24 | - | |
| 25 | 26 | void on_e40Button_clicked(); |
| 26 | 27 | |
| 27 | 28 | void on_backButton_clicked(); | ... | ... |
app/gui/oven_control/gasmodelsettingwindow.cpp
| ... | ... | @@ -16,44 +16,54 @@ GasModelSettingWindow::~GasModelSettingWindow() |
| 16 | 16 | delete ui; |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | -void GasModelSettingWindow::on_lpg10Button_clicked() | |
| 19 | +void GasModelSettingWindow::setModel(Define::model_type model) | |
| 20 | 20 | { |
| 21 | + Define::config_item item; | |
| 22 | + item.d32 = (int) model; | |
| 21 | 23 | |
| 24 | + Config *config = Config::getInstance(); | |
| 25 | + config->setConfigValue(Define::config_model, item); | |
| 26 | + config->saveConfig(); | |
| 22 | 27 | } |
| 23 | 28 | |
| 24 | -void GasModelSettingWindow::on_lng10Button_clicked() | |
| 29 | +void GasModelSettingWindow::on_lpg10Button_clicked() | |
| 25 | 30 | { |
| 31 | + setModel(Define::model_gas_lpg_10); | |
| 32 | +} | |
| 26 | 33 | |
| 34 | +void GasModelSettingWindow::on_lng10Button_clicked() | |
| 35 | +{ | |
| 36 | + setModel(Define::model_gas_lng_10); | |
| 27 | 37 | } |
| 28 | 38 | |
| 29 | 39 | void GasModelSettingWindow::on_lpg20Button_clicked() |
| 30 | 40 | { |
| 31 | - | |
| 41 | + setModel(Define::model_gas_lpg_20); | |
| 32 | 42 | } |
| 33 | 43 | |
| 34 | 44 | void GasModelSettingWindow::on_lng20Button_clicked() |
| 35 | 45 | { |
| 36 | - | |
| 46 | + setModel(Define::model_gas_lng_20); | |
| 37 | 47 | } |
| 38 | 48 | |
| 39 | 49 | void GasModelSettingWindow::on_lpg24Button_clicked() |
| 40 | 50 | { |
| 41 | - | |
| 51 | + setModel(Define::model_gas_lpg_24); | |
| 42 | 52 | } |
| 43 | 53 | |
| 44 | 54 | void GasModelSettingWindow::on_lng24Button_clicked() |
| 45 | 55 | { |
| 46 | - | |
| 56 | + setModel(Define::model_gas_lng_24); | |
| 47 | 57 | } |
| 48 | 58 | |
| 49 | 59 | void GasModelSettingWindow::on_lpg40Button_clicked() |
| 50 | 60 | { |
| 51 | - | |
| 61 | + setModel(Define::model_gas_lpg_40); | |
| 52 | 62 | } |
| 53 | 63 | |
| 54 | 64 | void GasModelSettingWindow::on_lng40Button_clicked() |
| 55 | 65 | { |
| 56 | - | |
| 66 | + setModel(Define::model_gas_lng_40); | |
| 57 | 67 | } |
| 58 | 68 | |
| 59 | 69 | void GasModelSettingWindow::on_backButton_clicked() | ... | ... |
app/gui/oven_control/gasmodelsettingwindow.h
| ... | ... | @@ -3,6 +3,8 @@ |
| 3 | 3 | |
| 4 | 4 | #include <QMainWindow> |
| 5 | 5 | |
| 6 | +#include "config.h" | |
| 7 | + | |
| 6 | 8 | namespace Ui { |
| 7 | 9 | class GasModelSettingWindow; |
| 8 | 10 | } |
| ... | ... | @@ -16,20 +18,14 @@ public: |
| 16 | 18 | ~GasModelSettingWindow(); |
| 17 | 19 | |
| 18 | 20 | private slots: |
| 21 | + void setModel(Define::model_type model); | |
| 19 | 22 | void on_lpg10Button_clicked(); |
| 20 | - | |
| 21 | 23 | void on_lng10Button_clicked(); |
| 22 | - | |
| 23 | 24 | void on_lpg20Button_clicked(); |
| 24 | - | |
| 25 | 25 | void on_lng20Button_clicked(); |
| 26 | - | |
| 27 | 26 | void on_lpg24Button_clicked(); |
| 28 | - | |
| 29 | 27 | void on_lng24Button_clicked(); |
| 30 | - | |
| 31 | 28 | void on_lpg40Button_clicked(); |
| 32 | - | |
| 33 | 29 | void on_lng40Button_clicked(); |
| 34 | 30 | |
| 35 | 31 | void on_backButton_clicked(); | ... | ... |