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 @@ 取消 - - - - + + + + tips 提示 - + Speed mode 速度模式 - + Failed! 失败! - + Succeed! 成功! - + Sleep time 休眠时间 - + Vid and Pid Vid和Pid @@ -171,32 +171,32 @@ 检测到配置%1不一致,已重新配置,请再次检查 - + Consistent configuration 配置一致! - + device is lost 设备已丢失 - + Serial num is empty 序列号为空 - + sn is illegal 序列号不合法 - + The device is testing 该设备正在进行测试 - + set sn failed 设置序列号失败 @@ -206,7 +206,7 @@ 设备名: %1 - + Target Configration: Target Configration: @@ -214,16 +214,16 @@ - - - + + + Speep mode: %1PPM Speep mode: %1PPM 速度模式: %1PPM - + Pass Pass @@ -231,14 +231,15 @@ + Set 设置 - - - + + + Sleep time: %1minute Sleep time: %1minute @@ -246,40 +247,53 @@ - - - + + + Vid: %1 Pid: %2 Vid: %1 Pid: %2 Vid: %1 Pid: %2 - + + + + + Device model: %1 + 设备型号: %1 + + + Current Configration of device: 当前设备配置: - + Fail Fail - - - + + + Set serial number: %1 设置序列号: %1 - - + + Device model + 设备型号 + + + + Detected that the current device's vid-pid and device object are not consistent. 检测到当前设备的vid-pid和设备对象不一致. - - + + Please reboot device to update. 请重启设备刷新. @@ -300,23 +314,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: 测试内容: @@ -326,20 +341,20 @@ - - - + + + Sleep time: Not sleeping 休眠时间: 不休眠 - - + + Tester: %1, Test item: %2 测试员: %1, 测试项: %2 - + set sn succeed 设置序列号成功 @@ -457,7 +472,7 @@ 选择路径 - + tips 提示 @@ -466,12 +481,12 @@ 文件不能为空 - + Create logPath failed 创建文件失败 - + Browse directory 打开文件 @@ -1694,38 +1709,38 @@ 数据库错误 - - - - - + + + + + tips 提示 - + production tool-burn station 华高生产工具-烧录工位 - + production tool-init test station 华高生产工具-初检工位 - + production tool-image test station 华高生产工具-图像测试工位 - + production tool-pressure test station 华高生产工具-压力测试工位 - - - + + + Is testing, do not close! 测试中,请勿关闭! @@ -1747,8 +1762,8 @@ 取消 - - + + cannot create more table 不能创建更多项目 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();