diff --git a/app/HGProductionTool/ProductionTool_zh_CN.qm b/app/HGProductionTool/ProductionTool_zh_CN.qm index 3c3564a..2a7c16c 100644 Binary files a/app/HGProductionTool/ProductionTool_zh_CN.qm and b/app/HGProductionTool/ProductionTool_zh_CN.qm differ diff --git a/app/HGProductionTool/ProductionTool_zh_CN.ts b/app/HGProductionTool/ProductionTool_zh_CN.ts index d78d895..4e33753 100644 --- a/app/HGProductionTool/ProductionTool_zh_CN.ts +++ b/app/HGProductionTool/ProductionTool_zh_CN.ts @@ -524,12 +524,27 @@ 取消 - + + simpleCN + 简体中文 + + + + trodiCN + 繁体中文 + + + + English + 英文 + + + tips 提示 - + please input valid contents 请输入有效内容 @@ -789,33 +804,39 @@ 登录 - - - - + + + + + Prompt 提示 - + Account dose not exist 账户不存在 - + Password can not be empty 密码不能为空 - + Password error 密码错误 - + Please select a profile first 请先选择配置文件 + + + Profile is not exsits + 配置文件不存在 + Select profile 选择配置文件 @@ -1884,19 +1905,19 @@ QObject - + success: success 成功: - - + + failed: 失败: - + Not find test item 没有找到该测试项 diff --git a/app/HGProductionTool/dialog_userinput.cpp b/app/HGProductionTool/dialog_userinput.cpp index d2bce64..9a54628 100644 --- a/app/HGProductionTool/dialog_userinput.cpp +++ b/app/HGProductionTool/dialog_userinput.cpp @@ -28,14 +28,7 @@ Dialog_UserInput::Dialog_UserInput(ui_helper::value_type type, const QString &ti } else if (type == ui_helper::VAL_TYPE_TIPS_VAL) { - ui_helper::PINFOTIPS p = (ui_helper::PINFOTIPS)desc; - while(*(p->desc) != '\0') - { - ui->comboBox->addItem(QString::number(*(p->desc))); - p->desc++; - } - - ui->label->setText(QString::fromStdWString(p->info)); + ui->label->setText(QString::fromStdWString(desc)); ui->comboBox->setVisible(true); } @@ -77,7 +70,7 @@ parameter *Dialog_UserInput::getParam() } else if (m_type == ui_helper::VAL_TYPE_TIPS_VAL) { - param->m_iData = ui->comboBox->currentText().toInt(); + param->m_iData = ui->comboBox->currentIndex(); } return param; @@ -89,6 +82,15 @@ void Dialog_UserInput::setDistortValue(double value) ui->lineEdit->selectAll(); } +void Dialog_UserInput::setFwLanguageMode() +{ + QStringList mode = { tr("simpleCN"), tr("trodiCN"), tr("English") }; + for (int i = 0; i < mode.size(); i++) + { + ui->comboBox->addItem(mode[i]); + } +} + void Dialog_UserInput::on_pbtn_yes_clicked() { if (ui->lineEdit->text().isEmpty() && (m_type == ui_helper::VAL_TYPE_INT || m_type == ui_helper::VAL_TYPE_FLOAT || m_type == ui_helper::VAL_TYPE_STRING)) diff --git a/app/HGProductionTool/dialog_userinput.h b/app/HGProductionTool/dialog_userinput.h index de6f4db..a084727 100644 --- a/app/HGProductionTool/dialog_userinput.h +++ b/app/HGProductionTool/dialog_userinput.h @@ -35,6 +35,7 @@ public: parameter *getParam(); void setDistortValue(double value); + void setFwLanguageMode(); private slots: void on_pbtn_yes_clicked(); diff --git a/app/HGProductionTool/hgscanner.cpp b/app/HGProductionTool/hgscanner.cpp index 2f9dbd3..762195f 100644 --- a/app/HGProductionTool/hgscanner.cpp +++ b/app/HGProductionTool/hgscanner.cpp @@ -36,6 +36,11 @@ parameter* hgscanner::get_user_input(data_from from, value_type type, const wcha { dlg.setDistortValue(m_distortValue); } + if (wcscmp(L"SET_FIRMWARE_LANGUAGE", title) == 0) + { + dlg.setFwLanguageMode(); + } + if (dlg.exec()) { return dlg.getParam(); diff --git a/code/base/test_base.cpp b/code/base/test_base.cpp index fb3c28f..6d5fe26 100644 --- a/code/base/test_base.cpp +++ b/code/base/test_base.cpp @@ -48,7 +48,8 @@ static struct Test_Map {HGPDTTOOLDB_NAME_GET_DEVICE_CONFIG ,HGPDTTOOLDB_TITLE_GET_DEVICE_CONFIG}, {HGPDTTOOLDB_NAME_GET_DEVICE_CPU_DISK ,HGPDTTOOLDB_TITLE_GET_DEVICE_CPU_DISK}, {HGPDTTOOLDB_NAME_BACKUP ,HGPDTTOOLDB_TITLE_BACKUP}, - {HGPDTTOOLDB_NAME_SHUTDOWN ,HGPDTTOOLDB_TITLE_SHUTDOWN} + {HGPDTTOOLDB_NAME_SHUTDOWN ,HGPDTTOOLDB_TITLE_SHUTDOWN}, + {HGPDTTOOLDB_NAME_SET_FIRMWARE_LANGUAGE ,HGPDTTOOLDB_TITLE_SET_FIRMWARE_LANGUAGE} }; static std::string StringToUtf(std::string strValue) @@ -592,6 +593,7 @@ public: test_map_[HGPDTTOOLDB_NAME_GET_DEVICE_CPU_DISK] = &test::test_get_device_cpu_disk; test_map_[HGPDTTOOLDB_NAME_BACKUP] = &test::test_backup; test_map_[HGPDTTOOLDB_NAME_SHUTDOWN] = &test::test_shutdown; + test_map_[HGPDTTOOLDB_NAME_SET_FIRMWARE_LANGUAGE] = &test::test_set_firmware_language; } int set_test(const wchar_t* name,const wchar_t* oper) { @@ -1534,6 +1536,42 @@ public: int ret = helper_->io_control(IO_CTRL_CODE_SET_DEVS_SHUTDOWN, &val, &len); return ret; } + /* 设置固件语言模式 */ + int test_set_firmware_language(void* data) + { + int mode = 0; + void* get_data = nullptr; + + parameter* ptr = helper_->get_user_input(ui_helper::DATA_FROM_USER, ui_helper::VAL_TYPE_TIPS_VAL, set_test_name_.c_str(), L"请设置固件语言模式"); + if (ptr) + { + get_data = ptr->get_data(); + if (!get_data) + { + helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT, (void*)L"已退出设置固件语言模式流程", false); + return -1; + } + mode = *((int*)get_data); + } + else + { + helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT, (void*)L"已退出设置固件语言模式流程", false); + return -1; + } + + int ret = helper_->io_control(IO_CTRL_CODE_SET_FIRMWARE_LANGUAGE, &mode, NULL); + if (ret != SCANNER_ERR_OK) + { + helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT, (void*)L"不支持设置固件语言模式", false); + return -1; + } + else + { + helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT, (void*)L"设置固件语言模式成功,重启设备生效", true); + } + + return ret; + } /*设置设备型号*/ int test_set_devs_model(void* data) { diff --git a/code/base/test_base.h b/code/base/test_base.h index ef683b4..ada88db 100644 --- a/code/base/test_base.h +++ b/code/base/test_base.h @@ -96,6 +96,8 @@ #define HGPDTTOOLDB_TITLE_BACKUP L"备份设备配置" /*关机*/ #define HGPDTTOOLDB_TITLE_SHUTDOWN L"关机" +/*设置固件语言模式*/ +#define HGPDTTOOLDB_TITLE_SET_FIRMWARE_LANGUAGE L"设置固件语言模式" //////////////////////////////////////NAME////////////////////////////////////// #define WRITE_CFG_NAME L"write-cfg" /* 设置json序列号 */ @@ -161,7 +163,7 @@ /* 设置畸变修正值 */ #define HGPDTTOOLDB_NAME_SET_DISTORTION_VAL L"SET_DISTORTION_VAL" /* 确认畸变修正值 */ -#define HGPDTTOOLDB_NAME_CONFIRM_DISTORTION_VAL L"CONFIRM_DISTORTION_VAL" +#define HGPDTTOOLDB_NAME_CONFIRM_DISTORTION_VAL L"CONFIRM_DISTORTION_VAL" /* 设置休眠 */ #define HGPDTTOOLDB_NAME_DORMANCY L"DORMANCY" /* 歪斜挡位检测 */ @@ -193,11 +195,13 @@ /*获取设备配置*/ #define HGPDTTOOLDB_NAME_GET_DEVICE_CONFIG L"GET_DEVICE_CONFIG" /*获取设备内存和硬盘容量大小*/ -#define HGPDTTOOLDB_NAME_GET_DEVICE_CPU_DISK L"GET_DEVICE_CPU_DISK" +#define HGPDTTOOLDB_NAME_GET_DEVICE_CPU_DISK L"GET_DEVICE_CPU_DISK" /*备份设备配置*/ #define HGPDTTOOLDB_NAME_BACKUP L"BACKUP" /*关机*/ #define HGPDTTOOLDB_NAME_SHUTDOWN L"SHUTDOWN" +/*设置固件语言模式*/ +#define HGPDTTOOLDB_NAME_SET_FIRMWARE_LANGUAGE L"SET_FIRMWARE_LANGUAGE" #define TEST_DLL #ifdef TEST_DLL