Commit 7ae6a4b1d98ff8becb12f0572b8a932d1fe63212

Authored by 고영탁
1 parent fd6c8836be
Exists in master and in 2 other branches fhd, fhd-demo

시스템 설정 마무리 및 다국어 처리

app/gui/oven_control/config.cpp
@@ -225,11 +225,13 @@ QString Config::getValueString(Define::ConfigType idx){ @@ -225,11 +225,13 @@ QString Config::getValueString(Define::ConfigType idx){
225 break; 225 break;
226 case 2: 226 case 2:
227 qstrTemp = tr(config_format[(uint32_t)idx]); 227 qstrTemp = tr(config_format[(uint32_t)idx]);
  228 + break;
228 case 3: 229 case 3:
229 qstrTemp.sprintf(config_format[(uint32_t)idx], configlist.values[(uint32_t)idx].d32+1); 230 qstrTemp.sprintf(config_format[(uint32_t)idx], configlist.values[(uint32_t)idx].d32+1);
230 break; 231 break;
231 case 0x7f: 232 case 0x7f:
232 qstrTemp = ""; 233 qstrTemp = "";
  234 + break;
233 } 235 }
234 return qstrTemp; 236 return qstrTemp;
235 } 237 }
@@ -270,7 +272,7 @@ QString Config::getValueString(Define::ConfigType idx){ @@ -270,7 +272,7 @@ QString Config::getValueString(Define::ConfigType idx){
270 break; 272 break;
271 case config_set_half_energy: 273 case config_set_half_energy:
272 if(configlist.items.set_half_energy.d32 >=2) configlist.items.set_half_energy.d32 = 0; 274 if(configlist.items.set_half_energy.d32 >=2) configlist.items.set_half_energy.d32 = 0;
273 - qstrTemp = tr(on_off_menu[configlist.items.set_half_energy.d32]); 275 + qstrTemp = tr(set_unset_menu[configlist.items.set_half_energy.d32]);
274 break; 276 break;
275 case config_duty_wash: 277 case config_duty_wash:
276 if(configlist.items.duty_wash.d32 >=2) configlist.items.duty_wash.d32 = 0; 278 if(configlist.items.duty_wash.d32 >=2) configlist.items.duty_wash.d32 = 0;
@@ -283,6 +285,10 @@ QString Config::getValueString(Define::ConfigType idx){ @@ -283,6 +285,10 @@ QString Config::getValueString(Define::ConfigType idx){
283 case config_loading_door_monitoring: 285 case config_loading_door_monitoring:
284 qstrTemp.sprintf(config_format[(uint32_t)idx ], configlist.items.loading_door_monitoring.d8.d8_0); 286 qstrTemp.sprintf(config_format[(uint32_t)idx ], configlist.items.loading_door_monitoring.d8.d8_0);
285 break; 287 break;
  288 + case config_demo_mode:
  289 + if(configlist.items.demo_mode.d32 >=2) configlist.items.demo_mode.d32 = 0;
  290 + qstrTemp = tr(on_off_menu[configlist.items.demo_mode.d32]);
  291 + break;
286 default: 292 default:
287 qstrTemp = ""; 293 qstrTemp = "";
288 break; 294 break;
app/gui/oven_control/config.h
@@ -199,7 +199,7 @@ namespace Define @@ -199,7 +199,7 @@ namespace Define
199 "타겟시간\0" 199 "타겟시간\0"
200 }; 200 };
201 201
202 - const char on_off_menu[2][16]={ 202 + const char set_unset_menu[2][16]={
203 "설정취소\0", 203 "설정취소\0",
204 "설정\0" 204 "설정\0"
205 }; 205 };
@@ -209,6 +209,11 @@ namespace Define @@ -209,6 +209,11 @@ namespace Define
209 "활성화\0" 209 "활성화\0"
210 }; 210 };
211 211
  212 + const char on_off_menu[2][16] = {
  213 + "끄기\0",
  214 + "켜기\0"
  215 + };
  216 +
212 typedef struct _config_1digit_set{ 217 typedef struct _config_1digit_set{
213 char str_unit[8]; 218 char str_unit[8];
214 int maxlen; 219 int maxlen;
@@ -279,9 +284,15 @@ class Config : public QObject @@ -279,9 +284,15 @@ class Config : public QObject
279 0x02, 0x02, 0x02,0x02, 0x02,0x02, 0x80, 0x80, 0x80, 0x02, 0x02, 284 0x02, 0x02, 0x02,0x02, 0x02,0x02, 0x80, 0x80, 0x80, 0x02, 0x02,
280 0x80, 0x00, 0x00,0x00, 285 0x80, 0x00, 0x00,0x00,
281 0x80, 0x80, 0x80, 286 0x80, 0x80, 0x80,
282 - 0x7F,0x7F,0x7F,0x7F,0x7F,0x7F 287 + 0x02,0x02,0x02,0x02,0x80,0x02
283 }; 288 };
284 289
  290 + const QString str_menu[3] ={
  291 + tr("test"),
  292 + tr("name"),
  293 + tr("ok")
  294 + };
  295 +
285 const char config_format_kr[MAX_CONFIG_COUNT][64]={ 296 const char config_format_kr[MAX_CONFIG_COUNT][64]={
286 "%S", 297 "%S",
287 "%S", 298 "%S",
@@ -322,12 +333,12 @@ class Config : public QObject @@ -322,12 +333,12 @@ class Config : public QObject
322 "%s", //config_duty_wash, 333 "%s", //config_duty_wash,
323 "%d단계", //config_loading_door_monitoring, 334 "%d단계", //config_loading_door_monitoring,
324 "%d단계", //config_cooking_door_monitoring 335 "%d단계", //config_cooking_door_monitoring
325 - "%s", //config_software_info,  
326 - "%s", //config_hotline_chef,  
327 - "%s", //config_hotline_service,  
328 - "%s", //config_steam_wash 336 + "정보확인", //config_software_info,
  337 + "정보확인", //config_hotline_chef,
  338 + "정보확인", //config_hotline_service,
  339 + "헹굼", //config_steam_wash
329 "%s", //config_demo_mode, 340 "%s", //config_demo_mode,
330 - "%s", //config_enter_engineer_mode, 341 + "엔지니어모드 진입", //config_enter_engineer_mode,
331 }; 342 };
332 343
333 344
app/gui/oven_control/confighalfenergydlg.cpp
@@ -21,8 +21,8 @@ ConfigHalfEnergyDlg::ConfigHalfEnergyDlg(QWidget *parent) : @@ -21,8 +21,8 @@ ConfigHalfEnergyDlg::ConfigHalfEnergyDlg(QWidget *parent) :
21 connect(button, &QPushButton::pressed, SoundPlayer::playClick); 21 connect(button, &QPushButton::pressed, SoundPlayer::playClick);
22 22
23 23
24 - ui->pushButton_1->setText(tr(on_off_menu[0]));  
25 - ui->pushButton_2->setText(tr(on_off_menu[1])); 24 + ui->pushButton_1->setText(tr(set_unset_menu[0]));
  25 + ui->pushButton_2->setText(tr(set_unset_menu[1]));
26 26
27 reloadUi(); 27 reloadUi();
28 28
app/gui/oven_control/configwindow.h
@@ -32,7 +32,7 @@ class ConfigWindow : public QMainWindow @@ -32,7 +32,7 @@ class ConfigWindow : public QMainWindow
32 32
33 private: 33 private:
34 const uint16_t m_arrMaxMenuCount[7] ={ 34 const uint16_t m_arrMaxMenuCount[7] ={
35 - 6,8,9,2,3,0,5 35 + 6,8,9,2,3,0,6
36 }; 36 };
37 const Define::ConfigType m_arrConfigListInfos[7][20] = { 37 const Define::ConfigType m_arrConfigListInfos[7][20] = {
38 {config_language,config_datetime, config_temptype,config_backlight, config_time_type,config_resttime_format,}, 38 {config_language,config_datetime, config_temptype,config_backlight, config_time_type,config_resttime_format,},
@@ -41,7 +41,7 @@ private: @@ -41,7 +41,7 @@ private:
41 {config_set_half_energy,config_set_auto_darkness,}, 41 {config_set_half_energy,config_set_auto_darkness,},
42 {config_duty_wash,config_loading_door_monitoring,config_cooking_door_monitoring}, 42 {config_duty_wash,config_loading_door_monitoring,config_cooking_door_monitoring},
43 {config_invalid,}, 43 {config_invalid,},
44 - {config_software_info,config_hotline_chef,config_hotline_service,config_steam_wash,config_enter_engineer_mode} 44 + {config_software_info,config_hotline_chef,config_hotline_service,config_steam_wash,config_demo_mode,config_enter_engineer_mode}
45 }; 45 };
46 46
47 public: 47 public:
app/gui/oven_control/lang_en.qm
No preview for this file type
app/gui/oven_control/main.cpp
@@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
6 #include "config.h" 6 #include "config.h"
7 #include "inputoverwatcher.h" 7 #include "inputoverwatcher.h"
8 #include <QApplication> 8 #include <QApplication>
  9 +#include <QDebug>
9 10
10 int main(int argc, char *argv[]) 11 int main(int argc, char *argv[])
11 { 12 {
@@ -23,6 +24,10 @@ int main(int argc, char *argv[]) @@ -23,6 +24,10 @@ int main(int argc, char *argv[])
23 OvenStatistics::getInstance(oven); 24 OvenStatistics::getInstance(oven);
24 Config::getInstance(oven); 25 Config::getInstance(oven);
25 26
  27 + QTranslator* trans = new QTranslator();
  28 + qDebug() << trans->load(":/lang_en.qm");
  29 + QApplication::installTranslator(trans);
  30 +
26 MainWindow w; 31 MainWindow w;
27 w.showFullScreen(); 32 w.showFullScreen();
28 33
app/gui/oven_control/oven_control.pro
@@ -303,5 +303,7 @@ FORMS += mainwindow.ui \ @@ -303,5 +303,7 @@ FORMS += mainwindow.ui \
303 RESOURCES += \ 303 RESOURCES += \
304 resources.qrc 304 resources.qrc
305 305
  306 +TRANSLATIONS += lang_en.ts lang_zh.ts
  307 +
306 target.path = /falinux/dev 308 target.path = /falinux/dev
307 INSTALLS += target 309 INSTALLS += target
app/gui/oven_control/resources.qrc
@@ -568,5 +568,6 @@ @@ -568,5 +568,6 @@
568 <file>images/error/symbol.png</file> 568 <file>images/error/symbol.png</file>
569 <file>images/symbol/keep_warm.png</file> 569 <file>images/symbol/keep_warm.png</file>
570 <file>images/background/popup/668.png</file> 570 <file>images/background/popup/668.png</file>
  571 + <file>lang_en.qm</file>
571 </qresource> 572 </qresource>
572 </RCC> 573 </RCC>