From c7cb29b001b8dccc8d0200d29ced5218112e1d67 Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Thu, 16 Feb 2023 13:52:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=85=8D=E7=BD=AE=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E5=92=8C=E7=A1=AE=E8=AE=A4=E7=95=B8=E5=8F=98=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/HGProductionTool/ProductionTool_zh_CN.qm | Bin 12636 -> 12810 bytes app/HGProductionTool/ProductionTool_zh_CN.ts | 100 +++++++++++++------ app/HGProductionTool/form_maininterface.cpp | 19 +++- app/HGProductionTool/form_maininterface.h | 2 + app/HGProductionTool/hgscanner.cpp | 22 +++- app/HGProductionTool/hgscanner.h | 18 ++++ 6 files changed, 125 insertions(+), 36 deletions(-) diff --git a/app/HGProductionTool/ProductionTool_zh_CN.qm b/app/HGProductionTool/ProductionTool_zh_CN.qm index d4a8e6cd994fed63adea90f59dae0beb1d55260b..e604023b972d2a3185cc07e6ace46b5c33f33c5c 100644 GIT binary patch delta 1209 zcmZ`%ZA?>V6h61N_uk&ymKGR=GJ(riE1(3NMPzZP(XnJ<6z3n6(Ez=z1d zXEd{Dki4)h>U0rCHaZuUF3Z@42_i$9Y~37Y9}>-&n?kaUIW}Enuv1A~{IN7QC+ED+ zbI$Xe)0z69{lsI`+MXntvh*B&H7h3*n5Pc`q~!y1bSpqQ0d9XkK$Z%)*Czn-&yh;1 ziVp)f?8R(~yhW9F*r0Zi0m!7GbD{x&o1^?qe*+|mRGVQGprDxgVz&|?H%i@F7zPmT zQ@56P1DJf&oTCvyWmjA(3?e?HxcZzG^8v-p*#yL!6-&np0rIxf&!o%)h*@+)`bhw- zkv;_mDjvT`U-LSVFi8Jw#RuU%WqvU}7*~`fm+SzE+mwMh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IdQe4f;q||!%N6Sf2i;`a$qMjyY@wkWLPNm?7 zy@33&;tf0{!-o`a_!-6jl#qIdK5LJ1cC-VS+pk;-i~%_=Wnv{6wLD?M<|H6(iY@b9 zBm+0us?sBrN7>q`Mlv|ay!#sf{K%TU^qzjanDw<>ApzIewSpjEJI2O-UPoKWXMe^{ z0r5Smc#itr!)j404LH74yH=FbcDgivm;}#n(mKcYQGJFNS~6TOwI@|%an5r+Bc9|X z-_vtrQ9_UDi^AWN%s=!Un+wRE$PZdld6&hO5Yb1XF4{m$|IO40r-Wa(WS3+tGJ3}2 z$X|oe_m4zAwi`ork4f)EVd_Z2tU&~A5 zGv|z!_EP1QANVkfKQf$rC5w-Q6nFXuDmK9n&up4Xp96)Ch2M0Vk#2`gw5izkesP=M z!z-NWe83rt%w``Fxav$23~o1b_?rK3d+B!7Rj?#+|3e>Z-%wvYn}$+U(+R$#NC{Td qcy|ZQ%0P9M-y5o_2>Jun%XN)UJLdBju7&)o1y下一步 - + Device has connected 设备已连接 - + Device hasnot connected 设备未连接 - + Device type: 设备型号: - + SerialNum: 序列号: - - + + connect status: 设备连接状态: @@ -798,23 +798,23 @@ 休眠时间: - + load last image which uploaded last time 加载上一次上传的图片 - + Device has disconnected 设备已断开 - + tips 提示 - - + + destortion value: 畸变修正值: @@ -827,47 +827,85 @@ 取消 - + speed mode: 目标配置: 速度模式: - + sleep time: 休眠时间: - + + please verify the configuration of the device: + 请验证设备配置: + + + + vid:%1 + + vid:%1 + + + + + pid:%1 + + pid:%1 + + + + + sleep time:%1minute + + 休眠时间:%1分钟 + + + + + speed mode:%1PPM + + 速度模式:%1PPM + + + + + device serial number:%1 + 设备序列号:%1 + + + ID 序号 - + Test items 测试项 - + status 测试状态 - + not test 未测试 - + not pass 不通过 - + not support 不支持 - + pass 通过 @@ -893,29 +931,29 @@ Pid: - - + + device roller count: 设备滚轴张数: - - + + image pixel: 标准圆:宽 * 高: - + minute 分钟 - + VID: VID: - + PID: PID: @@ -1131,19 +1169,19 @@ QObject - + success: success 成功: - - + + failed: 失败: - + Not find test item 没有找到该测试项 diff --git a/app/HGProductionTool/form_maininterface.cpp b/app/HGProductionTool/form_maininterface.cpp index f89b272..4070123 100644 --- a/app/HGProductionTool/form_maininterface.cpp +++ b/app/HGProductionTool/form_maininterface.cpp @@ -53,6 +53,7 @@ Form_mainInterface::Form_mainInterface(class MainWindow *mainwnd, Dialog_logIn:: connect(this, SIGNAL(testResultImg(void*)), this, SLOT(on_testResultImg(void*)), Qt::QueuedConnection); connect(this, &Form_mainInterface::testDistortion, this, &Form_mainInterface::on_testDistortion); connect(this, SIGNAL(testCorrectInfo(QString)), this, SLOT(on_testCorrectInfo(QString)), Qt::QueuedConnection); + connect(this, SIGNAL(testGetDevCfgInfo(int,int,int,int,QString)), this, SLOT(on_testGetDevCfgInfo(int,int,int,int,QString)), Qt::QueuedConnection); QString str; if (m_handle) @@ -236,6 +237,22 @@ void Form_mainInterface::on_testCorrectInfo(QString info) m_textTips->addContent(info); } +void Form_mainInterface::on_testGetDevCfgInfo(int vid, int pid, int sleepTime, int speedMode, QString devSn) +{ + char buf[10]; + sprintf(buf, "%x", vid); + char buf2[10]; + sprintf(buf2, "%x", pid); + QString str = (tr("please verify the configuration of the device:") + "\n\t"); + str.append(tr("vid:%1\n\t").arg(QString::fromStdString(buf))); + str.append(tr("pid:%1\n\t").arg(QString::fromStdString(buf2))); + str.append(tr("sleep time:%1minute\n\t").arg(QString::number(sleepTime))); + str.append(tr("speed mode:%1PPM\n\t").arg(QString::number(speedMode))); + str.append(tr("device serial number:%1").arg(devSn)); + + m_textTips->setViewContent(str); +} + void Form_mainInterface::on_viewerDblClick() { if (m_multiIndex != -1) @@ -672,7 +689,7 @@ void Form_mainInterface::on_pbtn_start_clicked() if (buf != nullptr && dpi > 0) func_test_go(name.toStdWString().c_str(), (const wchar_t*)buf, m_hg); else - func_test_go(HGPDTTOOLDB_NAME_GET_DEVICE_CONFIG, L"null", m_hg); + func_test_go(name.toStdWString().c_str(), L"null", m_hg); } if (name == "CLEAR_ROLLER_COUNT") diff --git a/app/HGProductionTool/form_maininterface.h b/app/HGProductionTool/form_maininterface.h index 0be5e50..efa519d 100644 --- a/app/HGProductionTool/form_maininterface.h +++ b/app/HGProductionTool/form_maininterface.h @@ -40,12 +40,14 @@ signals: void testResultImg(void* img); void testDistortion(SANE_DISTORTION_VAL data); void testCorrectInfo(QString info); + void testGetDevCfgInfo(int vid, int pid, int sleepTime, int speedMode, QString devSn); private slots: void on_testResult(QString text); void on_testResultImg(void* img); 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); void on_viewerDblClick(); diff --git a/app/HGProductionTool/hgscanner.cpp b/app/HGProductionTool/hgscanner.cpp index 0958900..e7b4ab3 100644 --- a/app/HGProductionTool/hgscanner.cpp +++ b/app/HGProductionTool/hgscanner.cpp @@ -12,6 +12,9 @@ hgscanner::hgscanner(Form_mainInterface *form, Form_BurnMode *burnMode, Dialog_I , m_inputSnDlg(inputSnDlg) , devHandle_(h) , m_distortValue(0.0) + , m_sleepTime(0) + , m_speedMode(0) + , m_devSn("") { cb_ = nullptr; } @@ -42,21 +45,22 @@ void hgscanner::test_callback(const wchar_t* name, test_event ev, void* data, si { if (ev == TEST_EVEB_GET_DEVICE_CONFIG_VIDPID) { - int vidpid = *(int*)data; + m_vidPid.Value = vidpid; } else if (ev == TEST_EVEB_GET_DEVICE_CONFIG_SP) { - int sp = *(int*)data; + m_speedMode = *(int*)data; } else if (ev == TEST_EVEB_GET_DEVICE_CONFIG_SLEEPTIME) { - int st = *(int*)data; + m_sleepTime = *(int*)data; } else if (ev == TEST_EVEB_GET_DEVICE_CONFIG_SN) { - QString info = QString::fromStdWString((const wchar_t*)data); + m_devSn = QString::fromStdWString((const wchar_t*)data); } + if (ev == TEST_EVENT_TIPS) { @@ -102,6 +106,14 @@ void hgscanner::test_callback(const wchar_t* name, test_event ev, void* data, si else if (ev == TEST_EVENT_RESULT) { QString info; + if (wcscmp(name, HGPDTTOOLDB_NAME_GET_DEVICE_CONFIG) == 0) + { + if (m_interface != nullptr) + { + emit m_interface->testGetDevCfgInfo((int)m_vidPid.VID, (int)m_vidPid.PID, m_sleepTime, m_speedMode, m_devSn); + } + } + if (data != nullptr) { if (flag) @@ -109,6 +121,7 @@ void hgscanner::test_callback(const wchar_t* name, test_event ev, void* data, si else info = QObject::tr("failed: ") + QString::fromStdWString((const wchar_t*)data); } + if (m_interface != nullptr) { emit m_interface->testResult(info); @@ -117,6 +130,7 @@ void hgscanner::test_callback(const wchar_t* name, test_event ev, void* data, si { emit m_burnMode->testResult(flag); } + } else if (ev == TEST_EVENT_DISTORTION_VAL) { diff --git a/app/HGProductionTool/hgscanner.h b/app/HGProductionTool/hgscanner.h index 470fbfb..8e0bf21 100644 --- a/app/HGProductionTool/hgscanner.h +++ b/app/HGProductionTool/hgscanner.h @@ -2,6 +2,7 @@ #include "sane/sane_ex.h" #include "ui_helper.h" #include "test_base.h" +#include class Form_mainInterface; class Form_BurnMode; @@ -20,12 +21,29 @@ public: sane_callback cb_; void setDistortValue(double value); + +private: + union VIDPID + { + struct + { + unsigned short VID; + unsigned short PID; + }; + unsigned int Value; + }; + private: class Form_mainInterface *m_interface; class Form_BurnMode *m_burnMode; class Dialog_InputSerialNum *m_inputSnDlg; SANE_Handle devHandle_; +private: double m_distortValue; + VIDPID m_vidPid; + int m_sleepTime; + int m_speedMode; + QString m_devSn; };