From ccf891c619c8f0f0478c6af32b2962bcfcab72e5 Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Thu, 4 Jan 2024 17:56:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=AE=BE=E5=A4=87=E7=95=B8?= =?UTF-8?q?=E5=8F=98=E5=80=BC=E4=B8=89=E6=AC=A1=E5=88=86=E5=88=AB=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=94=B9=E4=B8=BA=E5=8F=AA=E8=8E=B7=E5=8F=96=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=EF=BC=8C=E8=A7=A3=E5=86=B3=E8=AE=A1=E7=AE=97=E7=95=B8?= =?UTF-8?q?=E5=8F=98=E5=80=BC=E6=97=B6=E6=97=A0=E7=BA=B8=E5=8D=A1=E9=A1=BF?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/HGProductionTool/ProductionTool_zh_CN.qm | Bin 17961 -> 18277 bytes app/HGProductionTool/ProductionTool_zh_CN.ts | 136 +++++++++++-------- app/HGProductionTool/form_maininterface.cpp | 12 ++ app/HGProductionTool/form_maininterface.h | 2 + app/HGProductionTool/hgscanner.cpp | 16 ++- code/base/test_base.cpp | 86 ++++++------ 6 files changed, 149 insertions(+), 103 deletions(-) diff --git a/app/HGProductionTool/ProductionTool_zh_CN.qm b/app/HGProductionTool/ProductionTool_zh_CN.qm index 10f5e3dc847fe46897f43e4526967a49d39cc158..3c3564a0c47a84652b47ced907f50e86a0dc71be 100644 GIT binary patch delta 1505 zcmaJ>dr(w$6#nk+ecxTyAwyjrqPdIi%42s0WO=C#OIjie_{dQ#9?BNFPCU%VgbYT* z!v|ila+I-BQIS!HA}vD52f-g1Nv1@mHOA;@W#X8QNQand>L2IMo$vnc@0{~H-*>)y z4_7lcwlO=#+9CkBfN9qVUji)O5~c#vO9<0|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a8`dVAnejNym*WT*&Al?e? zox*IYOVkcGP`!4LoflmRm`<{mK)UzIWJ51!0dv1&?O~r&-x9XyDD4pv&6Yge0@$(IfSgW~m(JU|Td$RMsPi?(!)cjBCJC;IK-Y7P>skjd3L_K|_Z z+>tGffLPC+sJR3vkzB_&8X)34clG!efM*xi>$e23m2f}HKJ~3V+>5bB_zv*>vxx7n=D_QoUaIf4|UXp(mt>Lgp&;UyLL7ONGH_ z2PhQ*!k9ElDo2T$vy|Dxx1Yj|De9hncVzs(jQw{U`~hh^vQ7&qDei^nJU8X%bSuyNZ(a*mP{d0 zn&pCRgvO0>Y3?-E$%n>HkiK{1(_T+0#8xNHTP~koN@rJte9rYg-9vUb$WB?3uck}1 zUW(k;X$IVr@yJ^5Y}@~+R|-Al{Q4K%E&){(bK zhAq!2BNo-LvnrQV6A61s-6N_|v}&TJ)Go=We(EW<7l<{c_TB)kte%e6x0~$C^#1`0 CLT;o0 diff --git a/app/HGProductionTool/ProductionTool_zh_CN.ts b/app/HGProductionTool/ProductionTool_zh_CN.ts index ff7ce42..d78d895 100644 --- a/app/HGProductionTool/ProductionTool_zh_CN.ts +++ b/app/HGProductionTool/ProductionTool_zh_CN.ts @@ -1290,12 +1290,12 @@ 设备未连接 - + Device type: 设备类型: - + SerialNum: 序列号: @@ -1312,7 +1312,7 @@ 休眠时间: - + load last image which uploaded last time 加载上一次上传的图片 @@ -1321,14 +1321,14 @@ 设备已断开 - + tips 提示 - - - + + + destortion value: 畸变修正值: @@ -1341,68 +1341,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 @@ -1417,21 +1417,21 @@ 设备序列号: %1, 测试项: %2, 测试结果: 通过! - - + + device history scan count: 设备历史扫描张数: - - - + + + Prompt 提示 - + please verify the size of the device's cpu and disk: 请验证设备内存和硬盘容量大小: @@ -1448,32 +1448,32 @@ - + 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 其他错误 @@ -1482,54 +1482,74 @@ 设备序列号:%1 - + ID 序号 - + Test items 测试项 - + status 测试状态 - + not test 未测试 - - + + not pass 不通过 - + Actual cpu size:%1 实际内存容量:%1 - + Warning 警告 - + Device hard drive or memory detected to be too small! 检测到设备硬盘或内存过小! - + + The device distortion: + 设备当前畸变值: + + + + 200dpi: %1 + 200dpi: %1 + + + + 300dpi: %1 + 300dpi: %1 + + + + 600dpi: %1 + 600dpi: %1 + + + not support 不支持 - - + + pass 通过 @@ -1555,31 +1575,31 @@ Pid: - - + + device roller count: 设备滚轴张数: - - + + image pixel: 标准圆:宽 * 高: - + FirmwareNum: 固件号: - + device serial number:%1 设备序列号:%1 - + device firmware number:%1 device firmware number:%1 @@ -1587,13 +1607,13 @@ - + Target cpu size:>%1 Target cpu size:%1 目标内存大小:>%1 - + Target disk size:>%1 Target disk size:%1 目标硬盘容量:>%1 @@ -1603,22 +1623,22 @@ 实际内存大小:%1 - + Actual disk size:%1 实际硬盘容量:%1 - + minute 分钟 - + VID: VID: - + PID: PID: @@ -1864,14 +1884,14 @@ QObject - + success: success 成功: - + failed: 失败: diff --git a/app/HGProductionTool/form_maininterface.cpp b/app/HGProductionTool/form_maininterface.cpp index a99810a..4c15704 100644 --- a/app/HGProductionTool/form_maininterface.cpp +++ b/app/HGProductionTool/form_maininterface.cpp @@ -60,6 +60,7 @@ Form_mainInterface::Form_mainInterface(class MainWindow *mainwnd, Dialog_logIn:: 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(int,int)), this, SLOT(on_testGetDevCpuDisk(int,int)), Qt::QueuedConnection); + connect(this, SIGNAL(testGetDevdistortion(float,float,float)), this, SLOT(on_testGetDevdistortion(float,float,float)), Qt::QueuedConnection); if (m_handle) { @@ -321,6 +322,17 @@ void Form_mainInterface::on_testOpenCacheFile(QString name) } } +void Form_mainInterface::on_testGetDevdistortion(float dis_200dpi, float dis_300dpi, float dis_600dpi) +{ + QString info; + info.append(tr("The device distortion:") + "\n\n\t"); + info.append(tr("200dpi: %1").arg(QString::number(dis_200dpi, 'f', 6)) + "\n\t"); + info.append(tr("300dpi: %1").arg(QString::number(dis_300dpi, 'f', 6)) + "\n\t"); + info.append(tr("600dpi: %1").arg(QString::number(dis_600dpi, 'f', 6))); + + m_textTips->setViewContent(info); +} + void Form_mainInterface::on_viewerDblClick() { if (m_multiIndex != -1) diff --git a/app/HGProductionTool/form_maininterface.h b/app/HGProductionTool/form_maininterface.h index 575fe6c..804b8df 100644 --- a/app/HGProductionTool/form_maininterface.h +++ b/app/HGProductionTool/form_maininterface.h @@ -43,6 +43,7 @@ signals: void testGetDevCfgInfo(int vid, int pid, int sleepTime, int speedMode, QString devSn, QString devFw, QString devModel); void testGetDevCpuDisk(int cpu, int disk); void testOpenCacheFile(QString name); + void testGetDevdistortion(float dis_200dpi, float dis_300dpi, float dis_600dpi); private slots: void on_testResult(QString text); @@ -52,6 +53,7 @@ private slots: void on_testGetDevCfgInfo(int vid, int pid, int sleepTime, int speedMode, QString devSn, QString devFw, QString devModel); void on_testGetDevCpuDisk(int cpu, int disk); void on_testOpenCacheFile(QString name); + void on_testGetDevdistortion(float dis_200dpi, float dis_300dpi, float dis_600dpi); void on_viewerDblClick(); diff --git a/app/HGProductionTool/hgscanner.cpp b/app/HGProductionTool/hgscanner.cpp index 136d5be..2f9dbd3 100644 --- a/app/HGProductionTool/hgscanner.cpp +++ b/app/HGProductionTool/hgscanner.cpp @@ -143,7 +143,21 @@ void hgscanner::test_callback(const wchar_t* name, test_event ev, void* data, si } } - if (data != nullptr) + bool isGetDevdistortion = false; + if (wcscmp(name, HGPDTTOOLDB_NAME_CONFIRM_DISTORTION_VAL) == 0) + { + isGetDevdistortion = true; + if (m_interface != nullptr) + { + float* value = (float*)data; + float q = value[0]; + float w = value[1]; + float e = value[2]; + emit m_interface->testGetDevdistortion(value[0], value[1], value[2]); + } + } + + if (data != nullptr && !isGetDevdistortion) { if (flag) info = QObject::tr("success: ") + QString::fromStdWString((const wchar_t*)data); diff --git a/code/base/test_base.cpp b/code/base/test_base.cpp index 618def9..a8aaa2b 100644 --- a/code/base/test_base.cpp +++ b/code/base/test_base.cpp @@ -1069,6 +1069,14 @@ public: } dpi = atoi(str.c_str()); } + + ret = helper_->io_control(IO_CTRL_CODE_GET_PAPER_ON, &type, &llen); + if (!type) + { + helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT, (void*)L"自动计算畸变值获取失败: 无纸", false); + return ret; + } + if (dpi > 0) { ret = helper_->io_control(IO_CTRL_CODE_SET_DPI, &dpi, &llen); @@ -1092,11 +1100,11 @@ public: ret = helper_->io_control(IO_CTRL_CODE_GET_PC_DISTORTION_CHECK_VAL, &dis, &llen); break; } - else if (cnt == 30) + else if (cnt == 10) break; if (is_distortion_get_image_abnormal) - return -1; + break; Sleep(1000); cnt++; @@ -1180,50 +1188,40 @@ public: return ret; } - int test_confirm_auto_distortion(void *data) + int test_confirm_auto_distortion(void *data) + { + if (!data ) { - if (!data ) - { - return SCANNER_ERR_DATA_DAMAGED; - } - wchar_t* p = (wchar_t*)data; - std::string str; - - int ret = SCANNER_ERR_OK, - dpi = 0; - float distortion = 0; - unsigned int len = sizeof(int); - size_t strl = 0; - ret = wchar_to_char(str, p, &strl); - if (ret == ERROR_INSUFFICIENT_BUFFER) - { - str.resize(strl); - ret = wchar_to_char(str, p, &strl); - if (str.empty()) - { - return SCANNER_ERR_DATA_DAMAGED; - } - dpi = atoi(str.c_str()); - } - if (dpi > 0) - { - ret = helper_->io_control(IO_CTRL_CODE_SET_DPI, &dpi, &len); - } - - ret = helper_->io_control(IO_CTRL_CODE_GET_DISTORTION_DEVS_CHECK_VAL, &distortion, &len); - if (ret == SCANNER_ERR_OK) - { - wchar_t buf[64]; - swprintf(buf, 64, L"设备畸变值为:%.4f", distortion); - - helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT, (void*)buf, true); - } - else - { - helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT,(void*)L"获取设备畸变值失败", false); - } - return ret; + return SCANNER_ERR_DATA_DAMAGED; } + + float distortion = 0; + unsigned int len = sizeof(int); + + int ret = SCANNER_ERR_OK; + float value[3] = { 0 }; + int dpi[3] = { 200, 300, 600 }; + for (int i = 0; i < 3; i++) + { + ret = helper_->io_control(IO_CTRL_CODE_SET_DPI, &dpi[i], &len); + ret = helper_->io_control(IO_CTRL_CODE_GET_DISTORTION_DEVS_CHECK_VAL, &distortion, &len); + if (ret != SCANNER_ERR_OK) + break; + + value[i] = distortion; + } + + if (ret == SCANNER_ERR_OK) + { + + helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT, (void*)(float*)value, true); + } + else + { + helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT,(void*)L"获取设备畸变值失败", false); + } + return ret; + } /* 分纸强度检测 */ int test_paper_separation_strength(void *data) {