Commit 878f5d85f88abb585113bf5734e27b5c65635da9
1 parent
648451f20b
Exists in
master
and in
2 other branches
가스식 rpm 설정 기능 추가
Showing
7 changed files
with
226 additions
and
13 deletions
Show diff stats
app/gui/oven_control/config.cpp
... | ... | @@ -119,6 +119,14 @@ void Config::initConfig(){ |
119 | 119 | configlist.items.demo_mode.d32=0; |
120 | 120 | configlist.items.enter_engineer_mode.d32=0; |
121 | 121 | configlist.items.model.d32 = model_electric_20; |
122 | + configlist.items.burner1_pwr1_normal_rpm.d32 = 4000; | |
123 | + configlist.items.burner1_pwr1_half_rpm.d32 = 4000; | |
124 | + configlist.items.burner1_pwr2_normal_rpm.d32 = 6000; | |
125 | + configlist.items.burner1_pwr2_half_rpm.d32 = 4500; | |
126 | + configlist.items.burner23_pwr1_normal_rpm.d32 = 2300; | |
127 | + configlist.items.burner23_pwr1_half_rpm.d32 = 2300; | |
128 | + configlist.items.burner23_pwr2_normal_rpm.d32 = 6500; | |
129 | + configlist.items.burner23_pwr2_half_rpm.d32 = 4500; | |
122 | 130 | qDebug() << "Init Config lists"; |
123 | 131 | } |
124 | 132 | |
... | ... | @@ -149,13 +157,20 @@ bool Config::loadConfig(){ |
149 | 157 | if(file.open(QIODevice::ReadOnly)){ |
150 | 158 | readlen = file.read(buff,sizeof(config_lists)+1); |
151 | 159 | file.close(); |
152 | - if(buff[sizeof(config_lists)] ==0x9c && readlen == (sizeof(config_lists)+1) ){ | |
160 | + if(readlen != (sizeof(configlist)+1)){ | |
161 | + //File size is wrong. apply default config value & save default value; | |
162 | + qDebug() << "config file size wrone, apply defult setting!"; | |
163 | + saveConfig(); | |
164 | + return false; | |
165 | + } | |
166 | + if(buff[sizeof(config_lists)] ==0x9c){ | |
153 | 167 | memcpy(configlist.data,buff,sizeof(config_lists)); |
154 | 168 | qDebug() << "loading config file success"; |
155 | 169 | } |
156 | 170 | else { |
157 | 171 | qDebug()<<"loading config file fail"; |
158 | - return true; | |
172 | + saveConfig(); | |
173 | + return false; | |
159 | 174 | } |
160 | 175 | } |
161 | 176 | else{ |
... | ... | @@ -167,6 +182,7 @@ bool Config::loadConfig(){ |
167 | 182 | void Config::applyConfig(){ |
168 | 183 | watcher.setDelay(configlist.items.set_auto_darkness.d32); |
169 | 184 | Backlight::set(configlist.items.backlight.d32); |
185 | + UdpHandler* udp = UdpHandler::getInstance(); | |
170 | 186 | |
171 | 187 | switch (configlist.items.model.d32) |
172 | 188 | { |
... | ... | @@ -180,13 +196,17 @@ void Config::applyConfig(){ |
180 | 196 | case Define::model_gas_lpg_40: |
181 | 197 | if (configlist.items.set_half_energy.d32) |
182 | 198 | { |
183 | - UdpHandler::getInstance()->set(TG_BURNER1_2_RPM, 4500); | |
184 | - UdpHandler::getInstance()->set(TG_BURNER23_2_RPM, 4500); | |
199 | + udp->set(TG_BURNER1_1_RPM, configlist.items.burner1_pwr1_half_rpm.d32); | |
200 | + udp->set(TG_BURNER1_2_RPM, configlist.items.burner1_pwr2_half_rpm.d32); | |
201 | + udp->set(TG_BURNER23_1_RPM, configlist.items.burner23_pwr1_half_rpm.d32); | |
202 | + udp->set(TG_BURNER23_2_RPM, configlist.items.burner23_pwr2_half_rpm.d32); | |
185 | 203 | } |
186 | 204 | else |
187 | - { | |
188 | - UdpHandler::getInstance()->set(TG_BURNER1_2_RPM, 6000); | |
189 | - UdpHandler::getInstance()->set(TG_BURNER23_2_RPM, 6500); | |
205 | + { | |
206 | + udp->set(TG_BURNER1_1_RPM, configlist.items.burner1_pwr1_normal_rpm.d32); | |
207 | + udp->set(TG_BURNER1_2_RPM, configlist.items.burner1_pwr2_normal_rpm.d32); | |
208 | + udp->set(TG_BURNER23_1_RPM, configlist.items.burner23_pwr1_normal_rpm.d32); | |
209 | + udp->set(TG_BURNER23_2_RPM, configlist.items.burner23_pwr2_normal_rpm.d32); | |
190 | 210 | } |
191 | 211 | UdpHandler::getInstance()->set(TG_PRODUCT_TYPE, 1); |
192 | 212 | break; | ... | ... |
app/gui/oven_control/config.h
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 | #define STRUCT_PACK __attribute__ ((packed)) |
10 | 10 | |
11 | 11 | |
12 | -#define MAX_CONFIG_COUNT 46 | |
12 | +#define MAX_CONFIG_COUNT 54 | |
13 | 13 | #define MAX_SOFTWARE_INFO_CNT 7 |
14 | 14 | #define MAX_HOTLINE_CHEF_CNT 3 |
15 | 15 | #define MAX_HOTLINE_SERVICE_CNT 2 |
... | ... | @@ -21,6 +21,7 @@ |
21 | 21 | #define MODEL_INFO_FILE_NAME "/prime/config/model_info.csv" |
22 | 22 | #define CHEF_INFO_FILE_NAME "/prime/config/chef_info.csv" |
23 | 23 | #define SERVICE_INFO_FILE_NAME "/prime/config/service_info.csv" |
24 | +#define RPM_INFO_FILE_NAME "/prime/config/rpm_info.csv" | |
24 | 25 | |
25 | 26 | |
26 | 27 | static const char rest_time_type_menu[2][16] = { |
... | ... | @@ -160,6 +161,14 @@ namespace Define |
160 | 161 | config_demo_mode, |
161 | 162 | config_enter_engineer_mode, |
162 | 163 | config_model, |
164 | + config_burner1_pwr1_normal_rpm, | |
165 | + config_burner1_pwr2_normal_rpm, | |
166 | + config_burner23_pwr1_normal_rpm, | |
167 | + config_burner23_pwr2_normal_rpm, | |
168 | + config_burner1_pwr1_half_rpm, | |
169 | + config_burner1_pwr2_half_rpm, | |
170 | + config_burner23_pwr1_half_rpm, | |
171 | + config_burner23_pwr2_half_rpm, | |
163 | 172 | config_standard_info_upload, |
164 | 173 | config_invalid = MAX_CONFIG_COUNT+1 |
165 | 174 | }; |
... | ... | @@ -227,7 +236,15 @@ namespace Define |
227 | 236 | config_item steam_wash; |
228 | 237 | config_item demo_mode; |
229 | 238 | config_item enter_engineer_mode; |
230 | - config_item model; | |
239 | + config_item model; //System Data, Do not copy after this item when config upload. | |
240 | + config_item burner1_pwr1_normal_rpm; | |
241 | + config_item burner1_pwr2_normal_rpm; | |
242 | + config_item burner23_pwr1_normal_rpm; | |
243 | + config_item burner23_pwr2_normal_rpm; | |
244 | + config_item burner1_pwr1_half_rpm; | |
245 | + config_item burner1_pwr2_half_rpm; | |
246 | + config_item burner23_pwr1_half_rpm; | |
247 | + config_item burner23_pwr2_half_rpm; | |
231 | 248 | }items; |
232 | 249 | }STRUCT_PACK config_lists; |
233 | 250 | ... | ... |
app/gui/oven_control/fileprocessdlg.cpp
... | ... | @@ -690,11 +690,28 @@ void FileProcessDlg::configDownload(){ |
690 | 690 | } |
691 | 691 | |
692 | 692 | void FileProcessDlg::configUpload(){ |
693 | + char buff[sizeof(config_lists)+1]; | |
694 | + qint64 readlen; | |
693 | 695 | QString strUsbPath; |
694 | 696 | QString strSrcPath; |
695 | 697 | Config *cfg = Config::getInstance(); |
696 | 698 | if(FileProcessor::detectUSB(strUsbPath)){ |
697 | 699 | strSrcPath = QString("%1/%2").arg(strUsbPath).arg(CONFIG_FILE_NAME); |
700 | + QFile srcFile(strSrcPath); | |
701 | + //Check Source File is valid this machine | |
702 | + readlen = srcFile.read(buff,sizeof(config_lists)+1); | |
703 | + if(readlen != (sizeof(config_lists)+1)) { | |
704 | + qDebug() << "SRC config.ini file size wrong"; | |
705 | + ui->ctrLbRemainTime->setText(tr("설정 업로드에 실패하였습니다.")); | |
706 | + QTimer::singleShot(1000,this,SLOT(close())); | |
707 | + return; | |
708 | + } | |
709 | + if(buff[sizeof(config_lists)] != 0x9C){ | |
710 | + qDebug() << "SRC config.ini file check fail"; | |
711 | + ui->ctrLbRemainTime->setText(tr("설정 업로드에 실패하였습니다.")); | |
712 | + QTimer::singleShot(1000,this,SLOT(close())); | |
713 | + return; | |
714 | + } | |
698 | 715 | QFile file(CONFIG_FILE_NAME); |
699 | 716 | file.remove(); |
700 | 717 | if(QFile::copy( strSrcPath , CONFIG_FILE_NAME)){ | ... | ... |
app/gui/oven_control/functiontestwindow.cpp
... | ... | @@ -10,6 +10,11 @@ |
10 | 10 | #include "fantestwindow.h" |
11 | 11 | #include "gastestwindow.h" |
12 | 12 | #include "soundplayer.h" |
13 | +#include "config.h" | |
14 | +#include "yesnopopupdlg.h" | |
15 | +#include "notipopupdlg.h" | |
16 | +#include "usbcheckpopupdlg.h" | |
17 | +#include "fileprocessor.h" | |
13 | 18 | |
14 | 19 | FunctionTestWindow::FunctionTestWindow(QWidget *parent) : |
15 | 20 | QMainWindow(parent), |
... | ... | @@ -118,3 +123,107 @@ void FunctionTestWindow::onEncoderClicked(QWidget *clicked) |
118 | 123 | if (b) |
119 | 124 | b->click(); |
120 | 125 | } |
126 | + | |
127 | +bool FunctionTestWindow::readFromRpmFilea(QMap<QString, uint32_t> &rpm_map, const QString &filename){ | |
128 | + QFile file(filename); | |
129 | + QString label; | |
130 | + uint32_t value; | |
131 | + | |
132 | + if(file.open(QIODevice::ReadOnly | QIODevice::Text)){ | |
133 | + while(!file.atEnd()){ | |
134 | + QString line = QString::fromUtf8(file.readLine()); | |
135 | + rpm_map[line.section(',',0,0)] = line.section(',',1,1).toUInt(); | |
136 | + } | |
137 | + qDebug() << file.fileName() << "read OK!"; | |
138 | + qDebug() << "final size " << rpm_map.size(); | |
139 | + return true; | |
140 | + } | |
141 | + else { | |
142 | + qDebug() << file.fileName() + " file not found"; | |
143 | + } | |
144 | + return false; | |
145 | + | |
146 | +} | |
147 | + | |
148 | +void FunctionTestWindow::on_adjustBlowerFan_clicked() | |
149 | +{ | |
150 | + QString strUsbPath; | |
151 | + Config* cfg = Config::getInstance(); | |
152 | + Define::config_item item; | |
153 | + | |
154 | + YesNoPopupDlg* yesDlg = new YesNoPopupDlg(this,tr("RPM 설정을 바꾸시겠습니까?")); | |
155 | + yesDlg->exec(); | |
156 | + if(yesDlg->result()!=QDialog::Accepted){ | |
157 | + return; | |
158 | + } | |
159 | + | |
160 | + | |
161 | + QMap<QString, uint32_t> rpm_infos; | |
162 | + rpm_infos["config_burner1_pwr1_normal_rpm"] = 4000; | |
163 | + rpm_infos["config_burner1_pwr2_normal_rpm"] = 6000; | |
164 | + rpm_infos["config_burner23_pwr1_normal_rpm"] = 2300; | |
165 | + rpm_infos["config_burner23_pwr2_normal_rpm"] = 6500; | |
166 | + rpm_infos["config_burner1_pwr1_half_rpm"] = 4000; | |
167 | + rpm_infos["config_burner1_pwr2_half_rpm"] = 4500; | |
168 | + rpm_infos["config_burner23_pwr1_half_rpm"] = 2300; | |
169 | + rpm_infos["config_burner23_pwr2_half_rpm"] = 4500; | |
170 | + | |
171 | + if(!FileProcessor::detectUSB(strUsbPath)){ | |
172 | + UsbCheckPopupDlg* usbDlg = new UsbCheckPopupDlg(this); | |
173 | + usbDlg->exec(); | |
174 | + if(usbDlg->result() != QDialog::Accepted){ | |
175 | + NotiPopupDlg* notidlg= new NotiPopupDlg(this,tr("USB 메모리가 인식되지 않았습니다.")); | |
176 | + notidlg->exec(); | |
177 | + return; | |
178 | + } | |
179 | + } | |
180 | + | |
181 | + FileProcessor::detectUSB(strUsbPath); | |
182 | + | |
183 | + | |
184 | + | |
185 | + strUsbPath = QString("%1%2").arg(strUsbPath).arg(QString(RPM_INFO_FILE_NAME)); | |
186 | + | |
187 | + if(readFromRpmFilea(rpm_infos,strUsbPath)){ | |
188 | + | |
189 | + YesNoPopupDlg* dlg = new YesNoPopupDlg(this, tr("송풍기 교정을 하시겠습니까?")); | |
190 | + | |
191 | + item.d32 = rpm_infos["config_burner1_pwr1_normal_rpm"]; | |
192 | + cfg->setConfigValue(Define::config_burner1_pwr1_normal_rpm, item); | |
193 | + | |
194 | + item.d32 = rpm_infos["config_burner1_pwr2_normal_rpm"]; | |
195 | + cfg->setConfigValue(Define::config_burner1_pwr2_normal_rpm, item); | |
196 | + | |
197 | + item.d32 = rpm_infos["config_burner23_pwr1_normal_rpm"]; | |
198 | + cfg->setConfigValue(Define::config_burner23_pwr1_normal_rpm,item); | |
199 | + | |
200 | + item.d32 = rpm_infos["config_burner23_pwr2_normal_rpm"]; | |
201 | + cfg->setConfigValue(Define::config_burner23_pwr2_normal_rpm, item); | |
202 | + | |
203 | + item.d32 = rpm_infos["config_burner1_pwr1_half_rpm"]; | |
204 | + cfg->setConfigValue(Define::config_burner1_pwr1_half_rpm,item); | |
205 | + | |
206 | + item.d32 = rpm_infos["config_burner1_pwr2_half_rpm"]; | |
207 | + cfg->setConfigValue(Define::config_burner1_pwr2_half_rpm, item); | |
208 | + | |
209 | + item.d32 = rpm_infos["config_burner23_pwr1_half_rpm"]; | |
210 | + cfg->setConfigValue(Define::config_burner23_pwr1_half_rpm,item); | |
211 | + | |
212 | + item.d32 = rpm_infos["config_burner23_pwr2_half_rpm"]; | |
213 | + cfg->setConfigValue(Define::config_burner23_pwr2_half_rpm,item); | |
214 | + | |
215 | + cfg->saveConfig(); | |
216 | + cfg->applyConfig(); | |
217 | + | |
218 | + item = cfg->getConfigValue(Define::config_burner23_pwr2_half_rpm); | |
219 | + qDebug() << item.d32; | |
220 | + | |
221 | + NotiPopupDlg* notidlg = new NotiPopupDlg(this,tr("적용 되었습니다.")); | |
222 | + notidlg->exec(); | |
223 | + } | |
224 | + else{ | |
225 | + NotiPopupDlg* notidlg = new NotiPopupDlg(this,tr("설정 파일이 없습니다.")); | |
226 | + notidlg->exec(); | |
227 | + } | |
228 | + | |
229 | +} | ... | ... |
app/gui/oven_control/functiontestwindow.h
... | ... | @@ -33,6 +33,8 @@ private slots: |
33 | 33 | |
34 | 34 | void on_gasTestButton_clicked(); |
35 | 35 | |
36 | + void on_adjustBlowerFan_clicked(); | |
37 | + | |
36 | 38 | private: |
37 | 39 | Ui::FunctionTestWindow *ui; |
38 | 40 | |
... | ... | @@ -41,6 +43,7 @@ private: |
41 | 43 | void onEncoderLeft(); |
42 | 44 | void onEncoderRight(); |
43 | 45 | void onEncoderClicked(QWidget *clicked); |
46 | + bool readFromRpmFilea(QMap<QString, uint32_t> &rpm_map, const QString &filename); | |
44 | 47 | }; |
45 | 48 | |
46 | 49 | #endif // FUNCTIONTESTWINDOW_H | ... | ... |
app/gui/oven_control/functiontestwindow.ui
... | ... | @@ -500,10 +500,10 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/b |
500 | 500 | <widget class="Line" name="line_2"> |
501 | 501 | <property name="geometry"> |
502 | 502 | <rect> |
503 | - <x>100</x> | |
503 | + <x>79</x> | |
504 | 504 | <y>580</y> |
505 | - <width>1</width> | |
506 | - <height>542</height> | |
505 | + <width>41</width> | |
506 | + <height>631</height> | |
507 | 507 | </rect> |
508 | 508 | </property> |
509 | 509 | <property name="orientation"> |
... | ... | @@ -575,6 +575,50 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/b |
575 | 575 | <enum>Qt::Horizontal</enum> |
576 | 576 | </property> |
577 | 577 | </widget> |
578 | + <widget class="Line" name="line_8"> | |
579 | + <property name="geometry"> | |
580 | + <rect> | |
581 | + <x>100</x> | |
582 | + <y>1210</y> | |
583 | + <width>30</width> | |
584 | + <height>1</height> | |
585 | + </rect> | |
586 | + </property> | |
587 | + <property name="orientation"> | |
588 | + <enum>Qt::Horizontal</enum> | |
589 | + </property> | |
590 | + </widget> | |
591 | + <widget class="QPushButton" name="adjustBlowerFan"> | |
592 | + <property name="geometry"> | |
593 | + <rect> | |
594 | + <x>128</x> | |
595 | + <y>1175</y> | |
596 | + <width>379</width> | |
597 | + <height>70</height> | |
598 | + </rect> | |
599 | + </property> | |
600 | + <property name="sizePolicy"> | |
601 | + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> | |
602 | + <horstretch>0</horstretch> | |
603 | + <verstretch>0</verstretch> | |
604 | + </sizepolicy> | |
605 | + </property> | |
606 | + <property name="font"> | |
607 | + <font> | |
608 | + <family>NanumGothic</family> | |
609 | + <pointsize>10</pointsize> | |
610 | + <weight>75</weight> | |
611 | + <bold>true</bold> | |
612 | + </font> | |
613 | + </property> | |
614 | + <property name="styleSheet"> | |
615 | + <string notr="true">QPushButton { border-image: url(:/images/button/379.png); } | |
616 | +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/button/379_ov.png); }</string> | |
617 | + </property> | |
618 | + <property name="text"> | |
619 | + <string>송풍기 교정</string> | |
620 | + </property> | |
621 | + </widget> | |
578 | 622 | <zorder>line</zorder> |
579 | 623 | <zorder>line_2</zorder> |
580 | 624 | <zorder>upperStack</zorder> |
... | ... | @@ -594,6 +638,8 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/b |
594 | 638 | <zorder>line_5</zorder> |
595 | 639 | <zorder>line_6</zorder> |
596 | 640 | <zorder>line_7</zorder> |
641 | + <zorder>line_8</zorder> | |
642 | + <zorder>adjustBlowerFan</zorder> | |
597 | 643 | </widget> |
598 | 644 | </widget> |
599 | 645 | <customwidgets> | ... | ... |
app/gui/oven_control/usbcheckpopupdlg.cpp