From 57c2b84ee123953756a4dfcbd93002e3742ac37e Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Wed, 20 Sep 2023 13:46:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B5=8B=E8=AF=95=E9=A1=B9?= =?UTF-8?q?=EF=BC=8C=E6=A3=80=E6=B5=8B=E8=AE=BE=E5=A4=87=E5=86=85=E5=AD=98?= =?UTF-8?q?=E5=92=8C=E7=A1=AC=E7=9B=98=E5=AE=B9=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/HGProductionTool/ProductionTool_zh_CN.qm | Bin 17153 -> 17350 bytes app/HGProductionTool/ProductionTool_zh_CN.ts | 237 ++++++++++--------- app/HGProductionTool/form_maininterface.cpp | 9 + app/HGProductionTool/form_maininterface.h | 2 + app/HGProductionTool/hgscanner.cpp | 19 ++ app/HGProductionTool/hgscanner.h | 2 + app/HGProductionTool/ui_helper.h | 4 +- code/base/test_base.cpp | 45 +++- code/base/test_base.h | 4 + 9 files changed, 211 insertions(+), 111 deletions(-) diff --git a/app/HGProductionTool/ProductionTool_zh_CN.qm b/app/HGProductionTool/ProductionTool_zh_CN.qm index 97e71836a00717d0b82782f0e589492a63f7ad20..1526d690b8c919df77607b32f4cbe58b7966232c 100644 GIT binary patch delta 2238 zcmZ{lYgAO%7034s_c8a*ojU>whynv)MBWgA;Sr45purfG1S1AR1ZIFSP-sAu3C#?# zYC3=#9*J=o+eQH+#%Rbg;zAP^2!(d#VT}^v(l#-TF{yM_m+?WR|KT+K)(^9Ov+q4; z?|t_E?{gcrYle1ccF#;3Bci25^FIMs5Ji3rt|p4E0G}d?*+j&hCwk}y#>iG8KAvc% z{MwWL&QKT`FcvWS|Bf-_9GFk!8wA2(JZy0lk>6#+fP?u5;kyfVD$%+@yt_#B+yVG$ zB61E8`5TC?Z6q@15w~wA(d<>k9ZVn!jUukY!?oZgtetg_pl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sqF^xfsMc5Jm=q zYhXr)bv@}~iMN&36p7>vqSUFhOp9FIQ?{nZ%FI(@1pCGJug~v&=e<17_xV2W47|eC z)^mTeB%LRs45AsYflm>IZUwW5!e@eui6WAS_)A1n=Q4&qO(aAUS@L%-^mV;}K{5sn zjK04zT0_AVMBZiK8KUUdiKInDzHzvt1(&VC*$0Sxb`a(E6Uk9T&+fxH-x9gpSht$! z`*lS2qr|s26HV$Met!&6NG) zFwv3~qeTAQwB*@w-k|06P%$!!mj7`d4HmnXFqC`CwRBw2mc+yg8f5q zda5lO0Zj9t)e@$Qq{Q*47{msUJC{VsJm|;L?TV$BzD2zElVD6r$PN)eleM+4ZriL#b#peOOzx9tQ<2 z(sC}piwiQfr=8>Dty*5eRPdIzdf!BtX^Xad#DNFqhSt{Ghk%l`-VJB5-W!B+liRej zRd-Rc^V)}<@PLn7`|nZw7fe_Py6`c1y)Jelql8S|W_lR`wd>)Bae>`WPg@IR_+xtZ z1N?5Q)t|XAg!kcR{ki<{3*XUKrKMy4CA}s*1SYfT+k+bLo{Z{mo`V;ROY~#&F`m9f z?;GRra1H5KUWD{f%k<%bUGPMfKJ0Rap_U&QYao1@2#GI(_;lB$jJ(4OG8`C$rAe**4e;Q+;60Y|zmi*Ud$vFmss2TwT8wU6KY4qV}2QZQ}_TcbQ+aRb#;z zqd{i0{F^bb*=X*ofs4&^u{$}q<*1*%rAIb(+2t@k(W^K*XIj-qOGspKJVO|+LG;K?aI取消 - - - - - + + + + tips 提示 - + Speed mode 速度模式 - + Failed! 失败! - + Succeed! 成功! - + Sleep time 休眠时间 - + Vid and Pid Vid和Pid @@ -172,120 +171,121 @@ 检测到配置%1不一致,已重新配置,请再次检查 - + Consistent configuration 配置一致! - + device is lost 设备已丢失 - + Serial num is empty 序列号为空 - + sn is illegal 序列号不合法 - + The device is testing 该设备正在进行测试 - + set sn failed 设置序列号失败 - + Device name: %1 设备名: %1 - + Target Configration: Target Configration: 目标配置: - - - - + + + + Speep mode: %1PPM Speep mode: %1PPM 速度模式: %1PPM - + Pass Pass - - - + + + Set 设置 - - - - + + + + Sleep time: %1minute Sleep time: %1minute 休眠时间: %1分钟 - - - - + + + + Vid: %1 Pid: %2 Vid: %1 Pid: %2 Vid: %1 Pid: %2 - + Current Configration of device: 当前设备配置: - + Fail Fail - - - + + + Set serial number: %1 设置序列号: %1 - + + Detected that the current device's vid-pid and device object are not consistent. 检测到当前设备的vid-pid和设备对象不一致. - + + Please reboot device to update. 请重启设备刷新. - Do you want to restart now? - 是否立即重启设备? + 是否立即重启设备? Detected that the current device's vid-pid and device object are not consistent. Do you want to restart now? @@ -300,23 +300,23 @@ 测试结果:成功! - - + + 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: 测试内容: @@ -325,21 +325,21 @@ 成功,请检查配置 - - - - + + + + Sleep time: Not sleeping 休眠时间: 不休眠 - - + + Tester: %1, Test item: %2 测试员: %1, 测试项: %2 - + set sn succeed 设置序列号成功 @@ -1271,12 +1271,12 @@ 设备未连接 - + Device type: 设备类型: - + SerialNum: 序列号: @@ -1293,7 +1293,7 @@ 休眠时间: - + load last image which uploaded last time 加载上一次上传的图片 @@ -1302,14 +1302,14 @@ 设备已断开 - + tips 提示 - - - + + + destortion value: 畸变修正值: @@ -1322,68 +1322,68 @@ 取消 - + speed mode: 目标配置: 速度模式: - + sleep time: 休眠时间: - + ,but correct information is abnormal ,但是校正有异常 - + please verify the configuration of the device: 请验证设备配置: - + vid:%1 vid:%1 - + pid:%1 pid:%1 - + sleep time:%1minute 休眠时间:%1分钟 - + sleep time:%1 休眠时间:%1 - - + + Not sleeping 不休眠 - + speed mode:%1PPM 速度模式:%1PPM - + device model:%1 设备型号:%1 @@ -1398,46 +1398,65 @@ 设备序列号: %1, 测试项: %2, 测试结果: 通过! - - + + device history scan count: 设备历史扫描张数: - - - - + + + + Prompt 提示 - + + please verify the size of the device's cpu and disk: + 请验证设备内存和硬盘容量大小: + + + + Cpu size:%1 + + 内存大小:%1 + + + + + Disk size:%1 + + 硬盘总容量大小:%1 + + + + Tester: %1, Test item: %2, Test result: Failed! Reason: %3 测试员: %1, 测试项: %2, 测试结果: 不通过! 原因: %3 - + Tester: %1, Test item: %2, Test result: Pass! 测试员: %1, 测试项: %2, 测试结果: 通过! - + No paper 无纸 - + Device is sleeping 设备处于休眠模式 - + Counting mode 设备处于计数模式 - + Other error 其他错误 @@ -1446,39 +1465,39 @@ 设备序列号:%1 - + ID 序号 - + Test items 测试项 - + status 测试状态 - + not test 未测试 - - + + not pass 不通过 - + not support 不支持 - - + + pass 通过 @@ -1504,31 +1523,31 @@ Pid: - - + + device roller count: 设备滚轴张数: - - + + image pixel: 标准圆:宽 * 高: - + FirmwareNum: 固件号: - + device serial number:%1 设备序列号:%1 - + device firmware number:%1 device firmware number:%1 @@ -1536,17 +1555,17 @@ - + minute 分钟 - + VID: VID: - + PID: PID: @@ -1767,19 +1786,19 @@ QObject - + success: success 成功: - - + + failed: 失败: - + Not find test item 没有找到该测试项 diff --git a/app/HGProductionTool/form_maininterface.cpp b/app/HGProductionTool/form_maininterface.cpp index a25aae0..a7894ce 100644 --- a/app/HGProductionTool/form_maininterface.cpp +++ b/app/HGProductionTool/form_maininterface.cpp @@ -59,6 +59,7 @@ Form_mainInterface::Form_mainInterface(class MainWindow *mainwnd, Dialog_logIn:: connect(this, SIGNAL(testCorrectInfo(QString)), this, SLOT(on_testCorrectInfo(QString)), Qt::QueuedConnection); connect(this, SIGNAL(testGetDevCfgInfo(int,int,int,int,QString,QString,QString)), this, SLOT(on_testGetDevCfgInfo(int,int,int,int,QString,QString,QString)), Qt::QueuedConnection); connect(this, SIGNAL(testOpenCacheFile(QString)), this, SLOT(on_testOpenCacheFile(QString)), Qt::QueuedConnection); + connect(this, SIGNAL(testGetDevCpuDisk(QString,QString)), this, SLOT(on_testGetDevCpuDisk(QString,QString)), Qt::QueuedConnection); if (m_handle) { @@ -276,6 +277,14 @@ void Form_mainInterface::on_testGetDevCfgInfo(int vid, int pid, int sleepTime, i m_textTips->setViewContent(str); } +void Form_mainInterface::on_testGetDevCpuDisk(QString cpu, QString disk) +{ + QString str = (tr("please verify the size of the device's cpu and disk:") + "\n\t"); + str.append(tr("Cpu size:%1\n\t").arg(cpu)); + str.append(tr("Disk size:%1\n\t").arg(disk)); + m_textTips->setViewContent(str); +} + void Form_mainInterface::on_testOpenCacheFile(QString name) { if (name == HGPDTTOOLDB_NAME_IMAGE_GRAY_QUALITY && m_curDpi == 600) diff --git a/app/HGProductionTool/form_maininterface.h b/app/HGProductionTool/form_maininterface.h index d5f8947..acf9d62 100644 --- a/app/HGProductionTool/form_maininterface.h +++ b/app/HGProductionTool/form_maininterface.h @@ -41,6 +41,7 @@ signals: void testDistortion(SANE_DISTORTION_VAL data); void testCorrectInfo(QString info); void testGetDevCfgInfo(int vid, int pid, int sleepTime, int speedMode, QString devSn, QString devFw, QString devModel); + void testGetDevCpuDisk(QString cpu, QString disk); void testOpenCacheFile(QString name); private slots: @@ -49,6 +50,7 @@ private slots: void on_testDistortion(SANE_DISTORTION_VAL data); void on_testCorrectInfo(QString info); void on_testGetDevCfgInfo(int vid, int pid, int sleepTime, int speedMode, QString devSn, QString devFw, QString devModel); + void on_testGetDevCpuDisk(QString cpu, QString disk); void on_testOpenCacheFile(QString name); void on_viewerDblClick(); diff --git a/app/HGProductionTool/hgscanner.cpp b/app/HGProductionTool/hgscanner.cpp index 5e9f63e..ba94e53 100644 --- a/app/HGProductionTool/hgscanner.cpp +++ b/app/HGProductionTool/hgscanner.cpp @@ -17,6 +17,8 @@ hgscanner::hgscanner(Form_mainInterface *form, Form_BurnMode *burnMode, Dialog_I , m_devSn("") , m_devFw("") , m_devModel("") + , m_cpu("") + , m_disk("") { cb_ = nullptr; } @@ -71,6 +73,15 @@ void hgscanner::test_callback(const wchar_t* name, test_event ev, void* data, si m_devModel = QString::fromStdWString((const wchar_t*)data); } + if(ev == TEST_EVEB_GET_DEVICE_DEVS_CPU) + { + m_cpu = QString::fromStdWString((const wchar_t*)data); + } + else if (ev == TEST_EVEB_GET_DEVICE_DEVS_DISK) + { + m_disk = QString::fromStdWString((const wchar_t*)data); + } + if (ev == TEST_EVENT_TIPS) { @@ -124,6 +135,14 @@ void hgscanner::test_callback(const wchar_t* name, test_event ev, void* data, si } } + if (wcscmp(name, HGPDTTOOLDB_NAME_GET_DEVICE_CPU_DISK) == 0) + { + if (m_interface != nullptr) + { + emit m_interface->testGetDevCpuDisk(m_cpu, m_disk); + } + } + if (data != nullptr) { if (flag) diff --git a/app/HGProductionTool/hgscanner.h b/app/HGProductionTool/hgscanner.h index f719055..0d51cee 100644 --- a/app/HGProductionTool/hgscanner.h +++ b/app/HGProductionTool/hgscanner.h @@ -47,5 +47,7 @@ private: QString m_devSn; QString m_devFw; QString m_devModel; + QString m_cpu; + QString m_disk; }; diff --git a/app/HGProductionTool/ui_helper.h b/app/HGProductionTool/ui_helper.h index 229f343..a893a86 100644 --- a/app/HGProductionTool/ui_helper.h +++ b/app/HGProductionTool/ui_helper.h @@ -99,7 +99,9 @@ public: TEST_EVEB_GET_DEVICE_CONFIG_SLEEPTIME, //get sleeptime;data is (int*) ;flag is (bool)result,true - get pass TEST_EVEB_GET_DEVICE_CONFIG_SN, //get sn ;data is (wchar*) ;flag is (bool)result,true - get pass TEST_EVEB_GET_DEVICE_CONFIG_FW, //get fw ;data is (wchar*) ;flag is (bool)result,true - get pass - TEST_EVEB_GET_DEVICE_CONFIG_DEVS_MODEL, //get devs_model ;data is (wchar*) ;flag is (bool)result,true - get pass + TEST_EVEB_GET_DEVICE_CONFIG_DEVS_MODEL, //get devs_model ;data is (wchar*) ;flag is (bool)result,true - get pass + TEST_EVEB_GET_DEVICE_DEVS_CPU, //get dev cpu + TEST_EVEB_GET_DEVICE_DEVS_DISK, //get dev disk }; virtual void test_callback(const wchar_t* name/*test name*/, test_event ev, void* data, size_t flag)=0 ; diff --git a/code/base/test_base.cpp b/code/base/test_base.cpp index 305edf9..59ad260 100644 --- a/code/base/test_base.cpp +++ b/code/base/test_base.cpp @@ -45,7 +45,8 @@ static struct Test_Map {HGPDTTOOLDB_NAME_PAPER_SEPARATION_STRENGTH ,HGPDTTOOLDB_TITLE_PAPER_SEPARATION_STRENGTH}, {HGPDTTOOLDB_NAME_CONFIGURE_SPEED_MODE ,HGPDTTOOLDB_TITLE_CONFIGURE_SPEED_MODE}, {HGPDTTOOLDB_NAME_DORMANCY ,HGPDTTOOLDB_TITLE_DORMANCY}, - {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} }; static std::string StringToUtf(std::string strValue) @@ -583,6 +584,7 @@ public: test_map_[HGPDTTOOLDB_NAME_PRESSUER_TEST_RGB_300DPI] = &test::test_pressuer_test_rgb_300dpi; test_map_[HGPDTTOOLDB_NAME_PRESSUER_TEST_GRAY_300DPI] = &test::test_pressuer_test_gray_300dpi; test_map_[HGPDTTOOLDB_NAME_GET_DEVICE_CONFIG] = &test::test_get_device_config; + test_map_[HGPDTTOOLDB_NAME_GET_DEVICE_CPU_DISK] = &test::test_get_device_cpu_disk; } int set_test(const wchar_t* name,const wchar_t* oper) { @@ -1448,6 +1450,47 @@ public: helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT, (void*)(L"配置获取完成"), true); return ret; } + /*获取设备内存和硬盘容量大小*/ + int test_get_device_cpu_disk(void* data) + { + std::string cpu; + unsigned len = 0; + std::wstring wstr; + size_t l = 0; + int ret = helper_->io_control(IO_CTRL_CODE_GET_DEVS_CPU, &cpu[0], &len); + ret = str_to_wchar(cpu.c_str(), (wchar_t*)wstr.c_str(), &l); + if (ret == ERROR_INSUFFICIENT_BUFFER) + { + wstr.resize(l); + ret = str_to_wchar(cpu.c_str(), (wchar_t*)wstr.c_str(), &l); + } + if (wstr.empty()) + { + helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVEB_GET_DEVICE_DEVS_CPU, (void*)L",获取失败,设备不支持", false); + return ret; + } + helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVEB_GET_DEVICE_DEVS_CPU, (void*)wstr.c_str(), true); + + std::string disk; + unsigned len2 = 0; + ret = helper_->io_control(IO_CTRL_CODE_GET_DEVS_DISK, &disk[0], &len2); + ret = str_to_wchar(disk.c_str(), (wchar_t*)wstr.c_str(), &l); + if (ret == ERROR_INSUFFICIENT_BUFFER) + { + wstr.resize(l); + ret = str_to_wchar(disk.c_str(), (wchar_t*)wstr.c_str(), &l); + } + if (wstr.empty()) + { + helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVEB_GET_DEVICE_DEVS_DISK, (void*)L",获取失败,设备不支持", false); + return ret; + } + helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVEB_GET_DEVICE_DEVS_DISK, (void*)wstr.c_str(), true); + + 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) { diff --git a/code/base/test_base.h b/code/base/test_base.h index d5ebac3..f8955cd 100644 --- a/code/base/test_base.h +++ b/code/base/test_base.h @@ -86,6 +86,8 @@ #define HGPDTTOOLDB_TITLE_PRESSUER_TEST_GRAY_300DPI L"压力测试灰色_300dpi" /*获取设备配置*/ #define HGPDTTOOLDB_TITLE_GET_DEVICE_CONFIG L"获取设备配置" +/*获取设备内存和硬盘容量大小*/ +#define HGPDTTOOLDB_TITLE_GET_DEVICE_CPU_DISK L"获取设备内存和硬盘容量大小" //////////////////////////////////////NAME////////////////////////////////////// #define WRITE_CFG_NAME L"write-cfg" /* 设置json序列号 */ @@ -178,6 +180,8 @@ #define HGPDTTOOLDB_NAME_PRESSUER_TEST_GRAY_300DPI L"PRESSUER_TEST_GRAY_300DPI" /*获取设备配置*/ #define HGPDTTOOLDB_NAME_GET_DEVICE_CONFIG L"GET_DEVICE_CONFIG" +/*获取设备内存和硬盘容量大小*/ +#define HGPDTTOOLDB_NAME_GET_DEVICE_CPU_DISK L"GET_DEVICE_CPU_DISK" #define TEST_DLL #ifdef TEST_DLL