diff --git a/app/HGProductionTool/ProductionTool_zh_CN.qm b/app/HGProductionTool/ProductionTool_zh_CN.qm
index 2a7c16c..bb51bde 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 4e33753..b71889e 100644
--- a/app/HGProductionTool/ProductionTool_zh_CN.ts
+++ b/app/HGProductionTool/ProductionTool_zh_CN.ts
@@ -130,35 +130,40 @@
取消
-
-
-
-
+
+
+
+
提示
-
+
速度模式
-
+
失败!
-
+
成功!
-
+
+
+ 检测到固件版本不一致,请烧录正确的固件并重新检查
+
+
+
休眠时间
-
+
Vid和Pid
@@ -171,32 +176,32 @@
检测到配置%1不一致,已重新配置,请再次检查
-
+
配置一致!
-
+
设备已丢失
-
+
序列号为空
-
+
序列号不合法
-
+
该设备正在进行测试
-
+
设置序列号失败
@@ -206,7 +211,7 @@
设备名: %1
-
+
Target Configration:
@@ -214,16 +219,16 @@
-
-
-
+
+
+
Speep mode: %1PPM
速度模式: %1PPM
-
+
Pass
@@ -237,9 +242,9 @@
-
-
-
+
+
+
Sleep time: %1minute
@@ -247,9 +252,7 @@
-
-
-
+
Vid: %1 Pid: %2
@@ -257,43 +260,65 @@
-
-
-
+
+
+
设备型号: %1
-
+
+
+
+ 固件版本:%1
+
+
+
+
+
+ Vid: %1
+Pid: %2
+
+
+
当前设备配置:
-
+
Fail
-
-
-
+
+
+
设置序列号: %1
-
+
设备型号
-
-
+
+ 固件版本
+
+
+
+ 检测到%1不一致,请烧录正确的固件并重新检查
+
+
+
+
检测到当前设备的vid-pid和设备对象不一致.
-
-
+
+
请重启设备刷新.
@@ -314,24 +339,24 @@
测试结果:成功!
-
-
-
+
+
+
检测到配置 %1不一致,请重新配置后再次检查
-
+
检测到配置 %1不一致,请重启后再次检查
-
+
将目标配置设置到设备
-
+
测试内容:
@@ -341,20 +366,20 @@
-
-
-
+
+
+
休眠时间: 不休眠
-
-
+
+
测试员: %1, 测试项: %2
-
+
设置序列号成功
diff --git a/app/HGProductionTool/analysisjson.cpp b/app/HGProductionTool/analysisjson.cpp
index 53aaeec..fa6bf99 100644
--- a/app/HGProductionTool/analysisjson.cpp
+++ b/app/HGProductionTool/analysisjson.cpp
@@ -58,7 +58,8 @@ AnalysisJson::json_global AnalysisJson::GetGlobal()
obj["sleep-time"].toInt(),
obj["device-model"].toString(),
obj["cpu-size"].toInt(),
- obj["disk-size"].toInt()};
+ obj["disk-size"].toInt(),
+ obj["firmware-version"].toString()};
}
diff --git a/app/HGProductionTool/analysisjson.h b/app/HGProductionTool/analysisjson.h
index 87b0ece..2ecccef 100644
--- a/app/HGProductionTool/analysisjson.h
+++ b/app/HGProductionTool/analysisjson.h
@@ -28,6 +28,7 @@ public:
QString device_model;
std::int32_t cpu_size;
std::int32_t disk_size;
+ QString firmware_version;
};
AnalysisJson() = delete ;
diff --git a/app/HGProductionTool/dialog_inputserialnum.cpp b/app/HGProductionTool/dialog_inputserialnum.cpp
index cb0781e..dbeb20a 100644
--- a/app/HGProductionTool/dialog_inputserialnum.cpp
+++ b/app/HGProductionTool/dialog_inputserialnum.cpp
@@ -269,6 +269,21 @@ QString Dialog_InputSerialNum::getDeviceModel()
return QString::fromStdString(devs_model);
}
+QString Dialog_InputSerialNum::getDeviceFwVersion()
+{
+ std::string firmwareVersion;
+ unsigned int devs_len = 0;
+
+ SANE_Status ret = sane_io_control(m_handle, IO_CTRL_CODE_GET_HARDWARE_VERSION, &firmwareVersion[0], &devs_len);
+ if (ret == SANE_STATUS_NO_MEM)
+ {
+ firmwareVersion.resize(devs_len);
+ ret = sane_io_control(m_handle, IO_CTRL_CODE_GET_HARDWARE_VERSION, &firmwareVersion[0], &devs_len);
+ }
+
+ return QString::fromStdString(firmwareVersion).left(10);
+}
+
void Dialog_InputSerialNum::updateTargetCfg()
{
ui->textBrowser_target->clear();
@@ -281,6 +296,7 @@ void Dialog_InputSerialNum::updateTargetCfg()
int vid_to = jsonGlobal.vid_to;
int pid_to = jsonGlobal.pid_to;
QString devideModel = jsonGlobal.device_model;
+ QString fwVersion = jsonGlobal.firmware_version;
char buf[10];
sprintf(buf, "%x", vid_to);
@@ -294,9 +310,12 @@ void Dialog_InputSerialNum::updateTargetCfg()
if (!devideModel.isEmpty())
content.append(tr("Device model: %1").arg(devideModel) + "\n");
+ if (!fwVersion.isEmpty())
+ content.append(tr("Firmware version: %1").arg(fwVersion) + "\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");
+ content.append(tr("Vid: %1\nPid: %2").arg(QString::fromStdString(buf)).arg(QString::fromStdString(buf2)) + "\n");
ui->textBrowser_target->setText(content);
}
@@ -320,6 +339,13 @@ void Dialog_InputSerialNum::updateCurDeviceCfg()
{
devideModel = getDeviceModel();
}
+
+ QString fwVersion("");
+ if (!jsonGlobal.firmware_version.isEmpty())
+ {
+ fwVersion = getDeviceFwVersion();
+ }
+
char buf[10];
sprintf(buf, "%x", vid_to);
@@ -332,9 +358,12 @@ void Dialog_InputSerialNum::updateCurDeviceCfg()
if (!devideModel.isEmpty())
content.append(tr("Device model: %1").arg(devideModel) + "\n");
+ if (!fwVersion.isEmpty())
+ content.append(tr("Firmware version: %1").arg(fwVersion) + "\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");
+ content.append(tr("Vid: %1\nPid: %2").arg(QString::fromStdString(buf)).arg(QString::fromStdString(buf2)) + "\n");
ui->textBrowser_curConfig->setText(content);
}
@@ -445,6 +474,7 @@ void Dialog_InputSerialNum::on_pbtn_checkConfig_clicked()
int vid_to = jsonGlobal.vid_to;
int pid_to = jsonGlobal.pid_to;
QString deviceModel_to = jsonGlobal.device_model;
+ QString firmwareVersion_to = jsonGlobal.firmware_version;
int speedMode = getSpeedMode();
int sleepTime = getSleepTime();
@@ -469,6 +499,18 @@ void Dialog_InputSerialNum::on_pbtn_checkConfig_clicked()
}
}
+ if (!firmwareVersion_to.isEmpty())
+ {
+ QString fwVersion = getDeviceFwVersion();
+ if (firmwareVersion_to != fwVersion)
+ {
+ right = false;
+
+ QString info = tr("Inconsistent firmware detected, please burn the correct firmware, and check again");
+ addInteractInfo(info, false);
+ }
+ }
+
if (speedMode_to != speedMode)
{
item.append(tr("Speed mode"));
diff --git a/app/HGProductionTool/dialog_inputserialnum.h b/app/HGProductionTool/dialog_inputserialnum.h
index 860874a..bcf93aa 100644
--- a/app/HGProductionTool/dialog_inputserialnum.h
+++ b/app/HGProductionTool/dialog_inputserialnum.h
@@ -35,6 +35,7 @@ public:
int getDevVid();
int getDevPid();
QString getDeviceModel();
+ QString getDeviceFwVersion();
private:
void updateTargetCfg();
diff --git a/app/HGProductionTool/dialog_inputserialnum.ui b/app/HGProductionTool/dialog_inputserialnum.ui
index 034a377..afe6de8 100644
--- a/app/HGProductionTool/dialog_inputserialnum.ui
+++ b/app/HGProductionTool/dialog_inputserialnum.ui
@@ -6,8 +6,8 @@
0
0
- 795
- 608
+ 812
+ 615
@@ -16,7 +16,7 @@
- 570
+ 580
300
190
35
@@ -44,7 +44,7 @@
- 570
+ 580
210
190
35
@@ -72,7 +72,7 @@
- 570
+ 580
390
190
35
@@ -102,7 +102,7 @@
10
320
- 521
+ 531
231
@@ -112,7 +112,7 @@
10
110
- 521
+ 531
191
@@ -148,7 +148,7 @@
- 610
+ 620
480
101
41
@@ -196,7 +196,7 @@
- 390
+ 400
50
141
31
@@ -215,7 +215,7 @@
- 560
+ 580
50
181
31
@@ -234,7 +234,7 @@
- 600
+ 610
110
121
61