增加设置固件语言模式功能
This commit is contained in:
parent
f43982b4cd
commit
a1be80f341
Binary file not shown.
|
@ -524,12 +524,27 @@
|
||||||
<translation>取消</translation>
|
<translation>取消</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="dialog_userinput.cpp" line="96"/>
|
<location filename="dialog_userinput.cpp" line="87"/>
|
||||||
|
<source>simpleCN</source>
|
||||||
|
<translation>简体中文</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="dialog_userinput.cpp" line="87"/>
|
||||||
|
<source>trodiCN</source>
|
||||||
|
<translation>繁体中文</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="dialog_userinput.cpp" line="87"/>
|
||||||
|
<source>English</source>
|
||||||
|
<translation>英文</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="dialog_userinput.cpp" line="98"/>
|
||||||
<source>tips</source>
|
<source>tips</source>
|
||||||
<translation>提示</translation>
|
<translation>提示</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="dialog_userinput.cpp" line="96"/>
|
<location filename="dialog_userinput.cpp" line="98"/>
|
||||||
<source>please input valid contents</source>
|
<source>please input valid contents</source>
|
||||||
<translation>请输入有效内容</translation>
|
<translation>请输入有效内容</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -789,33 +804,39 @@
|
||||||
<translation type="vanished">登录</translation>
|
<translation type="vanished">登录</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="dialog_login.cpp" line="170"/>
|
<location filename="dialog_login.cpp" line="172"/>
|
||||||
<location filename="dialog_login.cpp" line="176"/>
|
<location filename="dialog_login.cpp" line="178"/>
|
||||||
<location filename="dialog_login.cpp" line="182"/>
|
<location filename="dialog_login.cpp" line="184"/>
|
||||||
<location filename="dialog_login.cpp" line="188"/>
|
<location filename="dialog_login.cpp" line="190"/>
|
||||||
|
<location filename="dialog_login.cpp" line="277"/>
|
||||||
<source>Prompt</source>
|
<source>Prompt</source>
|
||||||
<translation>提示</translation>
|
<translation>提示</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="dialog_login.cpp" line="170"/>
|
<location filename="dialog_login.cpp" line="172"/>
|
||||||
<source>Account dose not exist</source>
|
<source>Account dose not exist</source>
|
||||||
<translation>账户不存在</translation>
|
<translation>账户不存在</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="dialog_login.cpp" line="176"/>
|
<location filename="dialog_login.cpp" line="178"/>
|
||||||
<source>Password can not be empty</source>
|
<source>Password can not be empty</source>
|
||||||
<translation>密码不能为空</translation>
|
<translation>密码不能为空</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="dialog_login.cpp" line="182"/>
|
<location filename="dialog_login.cpp" line="184"/>
|
||||||
<source>Password error</source>
|
<source>Password error</source>
|
||||||
<translation>密码错误</translation>
|
<translation>密码错误</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="dialog_login.cpp" line="188"/>
|
<location filename="dialog_login.cpp" line="190"/>
|
||||||
<source>Please select a profile first</source>
|
<source>Please select a profile first</source>
|
||||||
<translation>请先选择配置文件</translation>
|
<translation>请先选择配置文件</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="dialog_login.cpp" line="277"/>
|
||||||
|
<source>Profile is not exsits</source>
|
||||||
|
<translation>配置文件不存在</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Select profile</source>
|
<source>Select profile</source>
|
||||||
<translation type="vanished">选择配置文件</translation>
|
<translation type="vanished">选择配置文件</translation>
|
||||||
|
@ -1884,19 +1905,19 @@
|
||||||
<context>
|
<context>
|
||||||
<name>QObject</name>
|
<name>QObject</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="hgscanner.cpp" line="163"/>
|
<location filename="hgscanner.cpp" line="168"/>
|
||||||
<source>success: </source>
|
<source>success: </source>
|
||||||
<oldsource>success</oldsource>
|
<oldsource>success</oldsource>
|
||||||
<translation>成功: </translation>
|
<translation>成功: </translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="hgscanner.cpp" line="107"/>
|
<location filename="hgscanner.cpp" line="112"/>
|
||||||
<location filename="hgscanner.cpp" line="165"/>
|
<location filename="hgscanner.cpp" line="170"/>
|
||||||
<source>failed: </source>
|
<source>failed: </source>
|
||||||
<translation>失败: </translation>
|
<translation>失败: </translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="hgscanner.cpp" line="91"/>
|
<location filename="hgscanner.cpp" line="96"/>
|
||||||
<source>Not find test item</source>
|
<source>Not find test item</source>
|
||||||
<translation>没有找到该测试项</translation>
|
<translation>没有找到该测试项</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -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)
|
else if (type == ui_helper::VAL_TYPE_TIPS_VAL)
|
||||||
{
|
{
|
||||||
ui_helper::PINFOTIPS p = (ui_helper::PINFOTIPS)desc;
|
ui->label->setText(QString::fromStdWString(desc));
|
||||||
while(*(p->desc) != '\0')
|
|
||||||
{
|
|
||||||
ui->comboBox->addItem(QString::number(*(p->desc)));
|
|
||||||
p->desc++;
|
|
||||||
}
|
|
||||||
|
|
||||||
ui->label->setText(QString::fromStdWString(p->info));
|
|
||||||
ui->comboBox->setVisible(true);
|
ui->comboBox->setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +70,7 @@ parameter *Dialog_UserInput::getParam()
|
||||||
}
|
}
|
||||||
else if (m_type == ui_helper::VAL_TYPE_TIPS_VAL)
|
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;
|
return param;
|
||||||
|
@ -89,6 +82,15 @@ void Dialog_UserInput::setDistortValue(double value)
|
||||||
ui->lineEdit->selectAll();
|
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()
|
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))
|
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))
|
||||||
|
|
|
@ -35,6 +35,7 @@ public:
|
||||||
|
|
||||||
parameter *getParam();
|
parameter *getParam();
|
||||||
void setDistortValue(double value);
|
void setDistortValue(double value);
|
||||||
|
void setFwLanguageMode();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_pbtn_yes_clicked();
|
void on_pbtn_yes_clicked();
|
||||||
|
|
|
@ -36,6 +36,11 @@ parameter* hgscanner::get_user_input(data_from from, value_type type, const wcha
|
||||||
{
|
{
|
||||||
dlg.setDistortValue(m_distortValue);
|
dlg.setDistortValue(m_distortValue);
|
||||||
}
|
}
|
||||||
|
if (wcscmp(L"SET_FIRMWARE_LANGUAGE", title) == 0)
|
||||||
|
{
|
||||||
|
dlg.setFwLanguageMode();
|
||||||
|
}
|
||||||
|
|
||||||
if (dlg.exec())
|
if (dlg.exec())
|
||||||
{
|
{
|
||||||
return dlg.getParam();
|
return dlg.getParam();
|
||||||
|
|
|
@ -48,7 +48,8 @@ static struct Test_Map
|
||||||
{HGPDTTOOLDB_NAME_GET_DEVICE_CONFIG ,HGPDTTOOLDB_TITLE_GET_DEVICE_CONFIG},
|
{HGPDTTOOLDB_NAME_GET_DEVICE_CONFIG ,HGPDTTOOLDB_TITLE_GET_DEVICE_CONFIG},
|
||||||
{HGPDTTOOLDB_NAME_GET_DEVICE_CPU_DISK ,HGPDTTOOLDB_TITLE_GET_DEVICE_CPU_DISK},
|
{HGPDTTOOLDB_NAME_GET_DEVICE_CPU_DISK ,HGPDTTOOLDB_TITLE_GET_DEVICE_CPU_DISK},
|
||||||
{HGPDTTOOLDB_NAME_BACKUP ,HGPDTTOOLDB_TITLE_BACKUP},
|
{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)
|
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_GET_DEVICE_CPU_DISK] = &test::test_get_device_cpu_disk;
|
||||||
test_map_[HGPDTTOOLDB_NAME_BACKUP] = &test::test_backup;
|
test_map_[HGPDTTOOLDB_NAME_BACKUP] = &test::test_backup;
|
||||||
test_map_[HGPDTTOOLDB_NAME_SHUTDOWN] = &test::test_shutdown;
|
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)
|
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);
|
int ret = helper_->io_control(IO_CTRL_CODE_SET_DEVS_SHUTDOWN, &val, &len);
|
||||||
return ret;
|
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)
|
int test_set_devs_model(void* data)
|
||||||
{
|
{
|
||||||
|
|
|
@ -96,6 +96,8 @@
|
||||||
#define HGPDTTOOLDB_TITLE_BACKUP L"备份设备配置"
|
#define HGPDTTOOLDB_TITLE_BACKUP L"备份设备配置"
|
||||||
/*关机*/
|
/*关机*/
|
||||||
#define HGPDTTOOLDB_TITLE_SHUTDOWN L"关机"
|
#define HGPDTTOOLDB_TITLE_SHUTDOWN L"关机"
|
||||||
|
/*设置固件语言模式*/
|
||||||
|
#define HGPDTTOOLDB_TITLE_SET_FIRMWARE_LANGUAGE L"设置固件语言模式"
|
||||||
//////////////////////////////////////NAME//////////////////////////////////////
|
//////////////////////////////////////NAME//////////////////////////////////////
|
||||||
#define WRITE_CFG_NAME L"write-cfg"
|
#define WRITE_CFG_NAME L"write-cfg"
|
||||||
/* 设置json序列号 */
|
/* 设置json序列号 */
|
||||||
|
@ -198,6 +200,8 @@
|
||||||
#define HGPDTTOOLDB_NAME_BACKUP L"BACKUP"
|
#define HGPDTTOOLDB_NAME_BACKUP L"BACKUP"
|
||||||
/*关机*/
|
/*关机*/
|
||||||
#define HGPDTTOOLDB_NAME_SHUTDOWN L"SHUTDOWN"
|
#define HGPDTTOOLDB_NAME_SHUTDOWN L"SHUTDOWN"
|
||||||
|
/*设置固件语言模式*/
|
||||||
|
#define HGPDTTOOLDB_NAME_SET_FIRMWARE_LANGUAGE L"SET_FIRMWARE_LANGUAGE"
|
||||||
|
|
||||||
#define TEST_DLL
|
#define TEST_DLL
|
||||||
#ifdef TEST_DLL
|
#ifdef TEST_DLL
|
||||||
|
|
Loading…
Reference in New Issue