diff --git a/app/HGProductionTool/ProductionTool_zh_CN.qm b/app/HGProductionTool/ProductionTool_zh_CN.qm index d4a8e6c..e604023 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 3f8b438..24c4bde 100644 --- a/app/HGProductionTool/ProductionTool_zh_CN.ts +++ b/app/HGProductionTool/ProductionTool_zh_CN.ts @@ -764,28 +764,28 @@ 下一步 - + 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; };