diff --git a/app/HGProductionTool/ProductionTool_zh_CN.qm b/app/HGProductionTool/ProductionTool_zh_CN.qm
index bc30cf2..a3cd089 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 d58c558..0fdf699 100644
--- a/app/HGProductionTool/ProductionTool_zh_CN.ts
+++ b/app/HGProductionTool/ProductionTool_zh_CN.ts
@@ -130,35 +130,35 @@
取消
-
-
-
-
+
+
+
+
提示
-
+
速度模式
-
+
失败!
-
+
成功!
-
+
休眠时间
-
+
Vid和Pid
@@ -171,32 +171,32 @@
检测到配置%1不一致,已重新配置,请再次检查
-
+
配置一致!
-
+
设备已丢失
-
+
序列号为空
-
+
序列号不合法
-
+
该设备正在进行测试
-
+
设置序列号失败
@@ -206,7 +206,7 @@
设备名: %1
-
+
Target Configration:
@@ -214,16 +214,16 @@
-
-
-
+
+
+
Speep mode: %1PPM
速度模式: %1PPM
-
+
Pass
@@ -231,14 +231,15 @@
+
设置
-
-
-
+
+
+
Sleep time: %1minute
@@ -246,40 +247,53 @@
-
-
-
+
+
+
Vid: %1 Pid: %2
Vid: %1 Pid: %2
-
+
+
+
+
+
+ 设备型号: %1
+
+
+
当前设备配置:
-
+
Fail
-
-
-
+
+
+
设置序列号: %1
-
-
+
+
+ 设备型号
+
+
+
+
检测到当前设备的vid-pid和设备对象不一致.
-
-
+
+
请重启设备刷新.
@@ -300,23 +314,24 @@
测试结果:成功!
-
-
+
+
+
检测到配置 %1不一致,请重新配置后再次检查
-
+
检测到配置 %1不一致,请重启后再次检查
-
+
将目标配置设置到设备
-
+
测试内容:
@@ -326,20 +341,20 @@
-
-
-
+
+
+
休眠时间: 不休眠
-
-
+
+
测试员: %1, 测试项: %2
-
+
设置序列号成功
@@ -457,7 +472,7 @@
选择路径
-
+
提示
@@ -466,12 +481,12 @@
文件不能为空
-
+
创建文件失败
-
+
打开文件
@@ -1694,38 +1709,38 @@
数据库错误
-
-
-
-
-
+
+
+
+
+
提示
-
+
华高生产工具-烧录工位
-
+
华高生产工具-初检工位
-
+
华高生产工具-图像测试工位
-
+
华高生产工具-压力测试工位
-
-
-
+
+
+
测试中,请勿关闭!
@@ -1747,8 +1762,8 @@
取消
-
-
+
+
不能创建更多项目
diff --git a/app/HGProductionTool/dialog_inputserialnum.cpp b/app/HGProductionTool/dialog_inputserialnum.cpp
index c9e8284..03de270 100644
--- a/app/HGProductionTool/dialog_inputserialnum.cpp
+++ b/app/HGProductionTool/dialog_inputserialnum.cpp
@@ -167,6 +167,23 @@ void Dialog_InputSerialNum::setVidPid()
addInteractInfo(info, true);
}
+void Dialog_InputSerialNum::setDevceModel()
+{
+ AnalysisJson analysisJson(m_profileName);
+ AnalysisJson::json_global jsonGlobal = analysisJson.GetGlobal();
+
+ std::string deviceModel = jsonGlobal.device_model.toStdString();
+ unsigned int len = deviceModel.size();
+ SANE_Status ret = sane_io_control(m_handle, IO_CTRL_CODE_SET_DEVS_MODEL, &deviceModel[0], &len);
+
+ QString info("");
+ if (ret = SANE_STATUS_GOOD)
+ {
+ info = tr("Set") + tr("Device model: %1").arg(QString::fromStdString(deviceModel));
+ }
+ addInteractInfo(info, true);
+}
+
void Dialog_InputSerialNum::rebootDevice()
{
const wchar_t *p = L"0";
@@ -237,6 +254,21 @@ int Dialog_InputSerialNum::getDevPid()
return pid;
}
+QString Dialog_InputSerialNum::getDeviceModel()
+{
+ std::string devs_model;
+ unsigned int devs_len = 0;
+
+ SANE_Status ret = sane_io_control(m_handle, IO_CTRL_CODE_GET_DEVS_MODEL, &devs_model[0], &devs_len);
+ if (ret == SANE_STATUS_NO_MEM)
+ {
+ devs_model.resize(devs_len);
+ ret = sane_io_control(m_handle, IO_CTRL_CODE_GET_DEVS_MODEL, &devs_model[0], &devs_len);
+ }
+
+ return QString::fromStdString(devs_model);
+}
+
void Dialog_InputSerialNum::updateTargetCfg()
{
ui->textBrowser_target->clear();
@@ -248,6 +280,7 @@ void Dialog_InputSerialNum::updateTargetCfg()
int sleepTime = jsonGlobal.sleep_time;
int vid_to = jsonGlobal.vid_to;
int pid_to = jsonGlobal.pid_to;
+ QString devideModel = jsonGlobal.device_model;
char buf[10];
sprintf(buf, "%x", vid_to);
@@ -257,6 +290,10 @@ void Dialog_InputSerialNum::updateTargetCfg()
QString content;
content.append(tr("Target Configration:") + "\n\n");
+
+ if (!devideModel.isEmpty())
+ content.append(tr("Device model: %1").arg(devideModel) + "\n");
+
content.append(tr("Speep mode: %1PPM").arg(QString::number(speedMode)) + "\n");
content.append((sleepTime > 0 ? tr("Sleep time: %1minute").arg(QString::number(sleepTime)) : tr("Sleep time: Not sleeping")) + "\n");
content.append(tr("Vid: %1 Pid: %2").arg(QString::fromStdString(buf)).arg(QString::fromStdString(buf2)) + "\n");
@@ -275,6 +312,7 @@ void Dialog_InputSerialNum::updateCurDeviceCfg()
int sleepTime = getSleepTime();
int vid_to = getDevVid();
int pid_to = getDevPid();
+ QString devideModel = getDeviceModel();
char buf[10];
sprintf(buf, "%x", vid_to);
@@ -284,6 +322,10 @@ void Dialog_InputSerialNum::updateCurDeviceCfg()
QString content;
content.append(tr("Current Configration of device:") + "\n\n");
+
+ if (!devideModel.isEmpty())
+ content.append(tr("Device model: %1").arg(devideModel) + "\n");
+
content.append(tr("Speep mode: %1PPM").arg(QString::number(speedMode)) + "\n");
content.append(sleepTime > 0 ? tr("Sleep time: %1minute").arg(QString::number(sleepTime)) + "\n" : tr("Sleep time: Not sleeping") + "\n");
content.append(tr("Vid: %1 Pid: %2").arg(QString::fromStdString(buf)).arg(QString::fromStdString(buf2)) + "\n");
@@ -396,15 +438,28 @@ void Dialog_InputSerialNum::on_pbtn_checkConfig_clicked()
int sleepTime_to = jsonGlobal.sleep_time;
int vid_to = jsonGlobal.vid_to;
int pid_to = jsonGlobal.pid_to;
+ QString deviceModel_to = jsonGlobal.device_model;
int speedMode = getSpeedMode();
int sleepTime = getSleepTime();
int vid = getDevVid();
int pid = getDevPid();
+ QString deviceModel = getDeviceModel();
QString item;
bool right = true;
LPWRITECFG lp = new WRITECFG;
+
+ if (deviceModel_to != deviceModel)
+ {
+ item.append(tr("Device model"));
+ item.append(" ");
+ right = false;
+
+ QString info = tr("Inconsistent configuration %1detected, please reconfigure, and check again").arg(item);
+ addInteractInfo(info, false);
+ }
+
if (speedMode_to != speedMode)
{
item.append(tr("Speed mode"));
@@ -491,13 +546,21 @@ void Dialog_InputSerialNum::on_pbtn_enterTest_clicked()
void Dialog_InputSerialNum::on_pbtn_setConfig_clicked()
{
+ AnalysisJson analysisJson(m_profileName);
+ AnalysisJson::json_global jsonGlobal = analysisJson.GetGlobal();
+
+ bool supportDevModel = false;
+ QString deviceModel = jsonGlobal.device_model;
+ if (!deviceModel.isEmpty())
+ {
+ supportDevModel = true;
+ setDevceModel();
+ }
+
setSpeedMode();
setSleepTime();
setVidPid();
- AnalysisJson analysisJson(m_profileName);
- AnalysisJson::json_global jsonGlobal = analysisJson.GetGlobal();
-
int speedMode = jsonGlobal.speed_mode;
int sleepTime = jsonGlobal.sleep_time;
int vid_to = jsonGlobal.vid_to;
@@ -509,6 +572,10 @@ void Dialog_InputSerialNum::on_pbtn_setConfig_clicked()
sprintf(buf2, "%x", pid_to);
QString content;
+
+ if (supportDevModel)
+ content.append(tr("Device model: %1").arg(deviceModel) + " ");
+
content.append(tr("Speep mode: %1PPM").arg(QString::number(speedMode)) + " ");
content.append((sleepTime > 0 ? tr("Sleep time: %1minute").arg(QString::number(sleepTime)) : tr("Sleep time: Not sleeping")) + " ");
content.append(tr("Vid: %1 Pid: %2").arg(QString::fromStdString(buf)).arg(QString::fromStdString(buf2)));
diff --git a/app/HGProductionTool/dialog_inputserialnum.h b/app/HGProductionTool/dialog_inputserialnum.h
index ad4135c..860874a 100644
--- a/app/HGProductionTool/dialog_inputserialnum.h
+++ b/app/HGProductionTool/dialog_inputserialnum.h
@@ -27,12 +27,14 @@ public:
void setSpeedMode();
void setSleepTime();
void setVidPid();
+ void setDevceModel();
void rebootDevice();
int getSpeedMode();
int getSleepTime();
int getDevVid();
int getDevPid();
+ QString getDeviceModel();
private:
void updateTargetCfg();