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 @@ 取消 - - - - + + + + tips 提示 - + Speed mode 速度模式 - + Failed! 失败! - + Succeed! 成功! - + + Inconsistent firmware detected, please burn the correct firmware, and check again + 检测到固件版本不一致,请烧录正确的固件并重新检查 + + + Sleep time 休眠时间 - + Vid and Pid Vid和Pid @@ -171,32 +176,32 @@ 检测到配置%1不一致,已重新配置,请再次检查 - + Consistent configuration 配置一致! - + device is lost 设备已丢失 - + Serial num is empty 序列号为空 - + sn is illegal 序列号不合法 - + The device is testing 该设备正在进行测试 - + set sn failed 设置序列号失败 @@ -206,7 +211,7 @@ 设备名: %1 - + Target Configration: Target Configration: @@ -214,16 +219,16 @@ - - - + + + Speep mode: %1PPM Speep mode: %1PPM 速度模式: %1PPM - + Pass Pass @@ -237,9 +242,9 @@ - - - + + + Sleep time: %1minute Sleep time: %1minute @@ -247,9 +252,7 @@ - - - + Vid: %1 Pid: %2 Vid: %1 Pid: %2 @@ -257,43 +260,65 @@ - - - + + + Device model: %1 设备型号: %1 - + + + Firmware version: %1 + 固件版本:%1 + + + + + Vid: %1 +Pid: %2 + Vid: %1 +Pid: %2 + + + Current Configration of device: 当前设备配置: - + Fail Fail - - - + + + Set serial number: %1 设置序列号: %1 - + Device model 设备型号 - - + Firmware version + 固件版本 + + + Inconsistent configuration %1detected, please burn the correct firmware, and check again + 检测到%1不一致,请烧录正确的固件并重新检查 + + + + Detected that the current device's vid-pid and device object are not consistent. 检测到当前设备的vid-pid和设备对象不一致. - - + + Please reboot device to update. 请重启设备刷新. @@ -314,24 +339,24 @@ 测试结果:成功! - - - + + + Inconsistent configuration %1detected, please reconfigure, and check again 检测到配置 %1不一致,请重新配置后再次检查 - + Inconsistent configuration %1detected, please reboot and reconfigure, and check again 检测到配置 %1不一致,请重启后再次检查 - + Set configuration to device 将目标配置设置到设备 - + Test content: 测试内容: @@ -341,20 +366,20 @@ - - - + + + Sleep time: Not sleeping 休眠时间: 不休眠 - - + + Tester: %1, Test item: %2 测试员: %1, 测试项: %2 - + set sn succeed 设置序列号成功 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