From 53d1853a089a77804c7fcfddc9b38ce0d848e018 Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Mon, 6 Mar 2023 15:26:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=98=BE=E7=A4=BA=E5=9B=BA?= =?UTF-8?q?=E4=BB=B6=E5=8F=B7=EF=BC=8C=E5=8E=86=E5=8F=B2=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E5=BC=A0=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/HGProductionTool/ProductionTool_zh_CN.qm | Bin 12810 -> 12706 bytes app/HGProductionTool/ProductionTool_zh_CN.ts | 145 ++++++++++--------- app/HGProductionTool/analysisjson.cpp | 3 +- app/HGProductionTool/analysisjson.h | 1 + app/HGProductionTool/form_maininterface.cpp | 71 ++++++--- app/HGProductionTool/form_maininterface.h | 7 +- app/HGProductionTool/form_maininterface.ui | 11 +- app/HGProductionTool/hgscanner.cpp | 8 +- app/HGProductionTool/hgscanner.h | 1 + code/base/test_base.cpp | 3 +- 10 files changed, 152 insertions(+), 98 deletions(-) diff --git a/app/HGProductionTool/ProductionTool_zh_CN.qm b/app/HGProductionTool/ProductionTool_zh_CN.qm index e604023b972d2a3185cc07e6ace46b5c33f33c5c..ef4ce5822832e51b6e859eaa9aa5df50c0ac100a 100644 GIT binary patch delta 1101 zcmZWmdrVVz6h622+4f$D3@9yqLVKabJ;(+sXy$@CArTeGl7Zq%xs*nr*ix8IBZkOg z6|wnkiy_V>;Fe6lbg7!XBreKKS+bf1$#hk-M`k25IyIY2COh5SVzNJeIr*J@-}%1t zopAH8=TPRN8~|n-Acy^@=0+oq`pBCmDj0cx38jx*Ep_GY1!iUdAU_W5nmz#IZeaJV z1Taki-#P+divoXm62MhOR#5A04Zuf(_}d0*t`|TQz_D%zfPn_bc&aWV`8dZ-(Bq5ztQ)Qv}V0J4!tDszoJp_(6f z2B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uA!hAP* zeviFCXLYPqh_fBie_5;}!A$)~zmt|Rum9FcxogG{Ir%D(P|pSgi}RMDb6g>NjfU=@ zc(OZd7_6V6u38NvJrjWL9mB}L$HXkKTS8nziJ}|ppjkexr1#pXYFx?xlXPP$m6Fnj z>Ghpf_9xK;Ft#fPhk`Vu`;@5|s!n)7ncGQ2G~ZC>{4P@Q8*|P~68o63aC;4TY%`V~ zAwK<1W7#>XH?1@_ezTi)`I~Y76##bFxUDt1G3nom{J!!`vXzKYpQ0z(m_MaPKfCIQpWu}cOA%aE6aR4Lb#83ik> z`%Y|=+a^3+HOHUh!tq+-g+yPZ)#~wARjHn!H4rQf)&|&Gdt&H)i<`6Wm|eu*K}P4Q zbrl}fT3#CXuSE5-8M`?{zsS8~R_!gp9dz6hw6`Mgug1~>pX)CAB?VRf;N1#rt2vsb z*tW8HXKd)a?HWfvMxHO&c)Qt?D-PT~5OrR)u7FiLZR{_{Q)%}sc2(TAIj-Q3a6BBy Z{=YZEEjkIPH5H|mtjUoQdMm|X_!}p*Q6&HX diff --git a/app/HGProductionTool/ProductionTool_zh_CN.ts b/app/HGProductionTool/ProductionTool_zh_CN.ts index 24c4bde..2b4bcc3 100644 --- a/app/HGProductionTool/ProductionTool_zh_CN.ts +++ b/app/HGProductionTool/ProductionTool_zh_CN.ts @@ -683,111 +683,102 @@ Form - - - SN: - - - devStatus - - - - SpeedMode: 速度模式: - + SleepTime: 休眠时间: - + VidPid: VIDPID: - + Privious Step 上一步 - + PASS 通过 - + FAIL 不通过 - + START 开始测试 - + PrePage 上一张 - + NextPage 下一张 - + LeftRotate 左旋转 - + RightRotate 右旋转 - + STOP 关闭 - + + DevInfo: + 设备信息: + + + SHOWIMG 加载图片 - + Next Step 下一步 - Device has connected - 设备已连接 + 设备已连接 - Device hasnot connected - 设备未连接 + 设备未连接 - + Device type: 设备型号: - + SerialNum: 序列号: - - connect status: - 设备连接状态: + 设备连接状态: speed mode: @@ -798,23 +789,23 @@ 休眠时间: - + load last image which uploaded last time 加载上一次上传的图片 - Device has disconnected - 设备已断开 + 设备已断开 - + tips 提示 - - + + + destortion value: 畸变修正值: @@ -827,85 +818,90 @@ 取消 - + 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 + + + device history scan count: + 设备历史扫描张数: - + device serial number:%1 + 设备序列号:%1 + + + ID 序号 - + Test items 测试项 - + status 测试状态 - + not test 未测试 - + not pass 不通过 - + not support 不支持 - + pass 通过 @@ -931,29 +927,46 @@ Pid: - - + + device roller count: 设备滚轴张数: - - + + image pixel: 标准圆:宽 * 高: - + + FirmwareNum: + 固件号: + + + + device serial number:%1 + + 设备序列号:%1 + + + + + device firmware number:%1 + 设备固件版本号:%1 + + + minute 分钟 - + VID: VID: - + PID: PID: @@ -1169,19 +1182,19 @@ QObject - + success: success 成功: - - + + failed: 失败: - + Not find test item 没有找到该测试项 diff --git a/app/HGProductionTool/analysisjson.cpp b/app/HGProductionTool/analysisjson.cpp index 146c853..50ea670 100644 --- a/app/HGProductionTool/analysisjson.cpp +++ b/app/HGProductionTool/analysisjson.cpp @@ -39,7 +39,8 @@ std::vector AnalysisJson::GetNode() obj[key].toObject()["err-level"].toInt(), obj[key].toObject()["desc"].toString(), obj[key].toObject()["station"].toString(), - obj[key].toObject()["resolution"].toInt()}); + obj[key].toObject()["resolution"].toInt(), + obj[key].toObject()["correct-value"].toInt()}); } return nodes; } diff --git a/app/HGProductionTool/analysisjson.h b/app/HGProductionTool/analysisjson.h index b50b881..99f7043 100644 --- a/app/HGProductionTool/analysisjson.h +++ b/app/HGProductionTool/analysisjson.h @@ -15,6 +15,7 @@ public: QString desc; QString station; int resolution; + int correct_value; }; struct json_global{ diff --git a/app/HGProductionTool/form_maininterface.cpp b/app/HGProductionTool/form_maininterface.cpp index a075300..51f5ae2 100644 --- a/app/HGProductionTool/form_maininterface.cpp +++ b/app/HGProductionTool/form_maininterface.cpp @@ -54,18 +54,14 @@ 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); + connect(this, SIGNAL(testGetDevCfgInfo(int,int,int,int,QString,QString)), this, SLOT(on_testGetDevCfgInfo(int,int,int,int,QString,QString)), Qt::QueuedConnection); + connect(this, SIGNAL(testOpenCacheFile(QString)), this, SLOT(on_testOpenCacheFile(QString)), Qt::QueuedConnection); - QString str; if (m_handle) { - str = tr("Device has connected"); m_hg = new hgscanner(this, nullptr, nullptr, m_handle); } - else - str = tr("Device hasnot connected"); - ui->label_sn->setText(tr("Device type:") + m_devType + tr(" SerialNum:") + m_serialNum); - ui->label_devStatus->setText(tr(" connect status:") + str); + ui->label_devInfo->setText(tr("Device type:") + m_devType + tr(" SerialNum:") + m_serialNum + " " + tr("FirmwareNum:") + m_devFwNum); ui->label_speedMode->setText(tr(" speed mode:") + getSpeedMode()); ui->label_sleepTime->setText(tr(" sleep time:") + getSleepTime()); @@ -144,8 +140,6 @@ hgscanner *Form_mainInterface::getScanner() void Form_mainInterface::setDevDisconnect() { - QString str = tr("Device has disconnected"); - ui->label_devStatus->setText(tr(" connect status:") + str); m_disconnect = true; } @@ -249,7 +243,7 @@ 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) +void Form_mainInterface::on_testGetDevCfgInfo(int vid, int pid, int sleepTime, int speedMode, QString devSn, QString devFw) { char buf[10]; sprintf(buf, "%x", vid); @@ -260,17 +254,30 @@ void Form_mainInterface::on_testGetDevCfgInfo(int vid, int pid, int sleepTime, i 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)); + str.append(tr("device serial number:%1\n\t").arg(devSn)); + str.append(tr("device firmware number:%1").arg(devFw)); m_textTips->setViewContent(str); } +void Form_mainInterface::on_testOpenCacheFile(QString name) +{ + if (name == HGPDTTOOLDB_NAME_IMAGE_GRAY_QUALITY && m_curDpi == 600) + { + if (m_view != nullptr) + { + m_view->doubleClicked(); + } + } +} + void Form_mainInterface::on_viewerDblClick() { if (m_multiIndex != -1) { - QString strFileName = m_list_images[m_multiIndex]; - QFileInfo fileInfo(strFileName); +// QString strFileName = m_list_images[m_multiIndex]; + QString cacheFilePath = getCachePath(); + QFileInfo fileInfo(cacheFilePath); auto pathDir = fileInfo.path(); QString strFilePath = "file:///" + pathDir; QDesktopServices::openUrl(QUrl(strFilePath)); @@ -607,6 +614,17 @@ int Form_mainInterface::getRollerNum() return -1; } +int Form_mainInterface::getHistoryCount() +{ + SANE_Int historyCount = 0; + unsigned int historyCountSize = sizeof(SANE_Int); + SANE_Status ret = sane_io_control(m_handle, IO_CTRL_CODE_GET_HISTORY_SCAN_NUM, &historyCount, &historyCountSize); + if (ret == SANE_STATUS_GOOD) + return historyCount >= 0 ? historyCount : -1; + else + return -1; +} + void Form_mainInterface::on_tableWidget_currentItemChanged(QTableWidgetItem *current, QTableWidgetItem *previous) { (void)previous; @@ -640,9 +658,9 @@ void Form_mainInterface::on_tableWidget_currentItemChanged(QTableWidgetItem *cur ui->stackedWidget->setCurrentWidget(m_textTips); m_view->clearImage(); - std::string name = m_map_title_name.value(title).name.toStdString(); + QString name = m_map_title_name.value(title).name; HGUInt imageCount = 0; - HGPdtToolDb_GetDeviceEntryImageCount(m_pdtToolDbDevice, name.c_str(), &imageCount); + HGPdtToolDb_GetDeviceEntryImageCount(m_pdtToolDbDevice, name.toStdString().c_str(), &imageCount); if (imageCount > 0) { // ui->pbtn_showImg->setVisible(true); @@ -655,11 +673,17 @@ void Form_mainInterface::on_tableWidget_currentItemChanged(QTableWidgetItem *cur // if (dir.exists()) // dir.removeRecursively(); - if (name == "CLEAR_ROLLER_COUNT") + if (name.toStdWString() == HGPDTTOOLDB_NAME_CLEAR_ROLLER_COUNT) { QString str(tr("device roller count:") + QString::number(getRollerNum())); m_textTips->setViewContent(str); } + + if (name.toStdWString() == HGPDTTOOLDB_NAME_CLEAR_HISTORY_COUNT) + { + QString str(tr("device history scan count:") + QString::number(getHistoryCount())); + m_textTips->setViewContent(str); + } } } @@ -684,6 +708,7 @@ void Form_mainInterface::on_pbtn_start_clicked() { QString title = item->text(); QString name = m_map_title_name.value(title).name; + int correct_value = m_map_title_name.value(title).correct_value; int dpi = m_map_title_name.value(title).resolution; wchar_t buf[5] = {0}; if (dpi > 0) @@ -691,6 +716,10 @@ void Form_mainInterface::on_pbtn_start_clicked() m_curDpi = dpi; swprintf(buf, L"%d", dpi); } + else if (correct_value > -1 && correct_value < 7) + { + swprintf(buf, L"%d", correct_value); + } if (m_hg != nullptr) { @@ -698,17 +727,23 @@ void Form_mainInterface::on_pbtn_start_clicked() m_isTesting = true; m_mainwnd->addTestingRef(); - if (buf != nullptr && dpi > 0) + if (buf != nullptr && (dpi > 0 || (correct_value > -1 && correct_value < 7))) func_test_go(name.toStdWString().c_str(), (const wchar_t*)buf, m_hg); else func_test_go(name.toStdWString().c_str(), L"null", m_hg); } - if (name == "CLEAR_ROLLER_COUNT") + if (name == HGPDTTOOLDB_NAME_CLEAR_ROLLER_COUNT) { QString str(tr("device roller count:") + QString::number(getRollerNum())); m_textTips->setViewContent(str); } + + if (name == HGPDTTOOLDB_NAME_CLEAR_HISTORY_COUNT) + { + QString str(tr("device history scan count:") + QString::number(getHistoryCount())); + m_textTips->setViewContent(str); + } } } diff --git a/app/HGProductionTool/form_maininterface.h b/app/HGProductionTool/form_maininterface.h index 0e7bcc0..b1af35f 100644 --- a/app/HGProductionTool/form_maininterface.h +++ b/app/HGProductionTool/form_maininterface.h @@ -40,14 +40,16 @@ 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); + void testGetDevCfgInfo(int vid, int pid, int sleepTime, int speedMode, QString devSn, QString devFw); + void testOpenCacheFile(QString name); 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_testGetDevCfgInfo(int vid, int pid, int sleepTime, int speedMode, QString devSn, QString devFw); + void on_testOpenCacheFile(QString name); void on_viewerDblClick(); @@ -89,6 +91,7 @@ private: QString getDevVid(); QString getDevPid(); int getRollerNum(); + int getHistoryCount(); private: union VIDPID diff --git a/app/HGProductionTool/form_maininterface.ui b/app/HGProductionTool/form_maininterface.ui index 869fcbb..f367c63 100644 --- a/app/HGProductionTool/form_maininterface.ui +++ b/app/HGProductionTool/form_maininterface.ui @@ -17,16 +17,9 @@ - + - SN: - - - - - - - devStatus + DevInfo: diff --git a/app/HGProductionTool/hgscanner.cpp b/app/HGProductionTool/hgscanner.cpp index b6d898a..77fc551 100644 --- a/app/HGProductionTool/hgscanner.cpp +++ b/app/HGProductionTool/hgscanner.cpp @@ -15,6 +15,7 @@ hgscanner::hgscanner(Form_mainInterface *form, Form_BurnMode *burnMode, Dialog_I , m_sleepTime(0) , m_speedMode(0) , m_devSn("") + , m_devFw("") { cb_ = nullptr; } @@ -60,6 +61,10 @@ void hgscanner::test_callback(const wchar_t* name, test_event ev, void* data, si { m_devSn = QString::fromStdWString((const wchar_t*)data); } + else if (ev == TEST_EVEB_GET_DEVICE_CONFIG_FW) + { + m_devFw = QString::fromStdWString((const wchar_t*)data); + } if (ev == TEST_EVENT_TIPS) { @@ -110,7 +115,7 @@ void hgscanner::test_callback(const wchar_t* name, test_event ev, void* data, si { if (m_interface != nullptr) { - emit m_interface->testGetDevCfgInfo((int)m_vidPid.VID, (int)m_vidPid.PID, m_sleepTime, m_speedMode, m_devSn); + emit m_interface->testGetDevCfgInfo((int)m_vidPid.VID, (int)m_vidPid.PID, m_sleepTime, m_speedMode, m_devSn, m_devFw); } } @@ -125,6 +130,7 @@ void hgscanner::test_callback(const wchar_t* name, test_event ev, void* data, si if (m_interface != nullptr) { emit m_interface->testResult(info); + emit m_interface->testOpenCacheFile(QString::fromStdWString(name)); } else if (m_burnMode != nullptr) { diff --git a/app/HGProductionTool/hgscanner.h b/app/HGProductionTool/hgscanner.h index 8e0bf21..2ea9ecf 100644 --- a/app/HGProductionTool/hgscanner.h +++ b/app/HGProductionTool/hgscanner.h @@ -45,5 +45,6 @@ private: int m_sleepTime; int m_speedMode; QString m_devSn; + QString m_devFw; }; diff --git a/code/base/test_base.cpp b/code/base/test_base.cpp index 67787fe..bf5c0e6 100644 --- a/code/base/test_base.cpp +++ b/code/base/test_base.cpp @@ -550,6 +550,7 @@ public: test_map_[HGPDTTOOLDB_NAME_PAPER_SEPARATION_STRENGTH] = &test::test_paper_separation_strength; test_map_[HGPDTTOOLDB_NAME_MECH_PAPER_FEEDING_INCLINATION] = &test::test_mech_paper_feeding_inclination; test_map_[HGPDTTOOLDB_NAME_CLEAR_ROLLER_COUNT] = &test::test_clear_roller_count; + test_map_[HGPDTTOOLDB_NAME_CLEAR_HISTORY_COUNT] = &test::test_clear_history_count; test_map_[HGPDTTOOLDB_NAME_COVER_SENSOR] = &test::test_single_page_test; test_map_[HGPDTTOOLDB_NAME_SINGLE_PAGE_TEST] = &test::test_single_page_test; @@ -1173,7 +1174,7 @@ public: else { type = false; - info = L"清除历史计数成功"; + info = L"清除历史计数失败"; } helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT, (void*)info, type);