From 6abb5978acd6eb6bddba3a999973e8d92cc701f4 Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Fri, 23 Sep 2022 15:24:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8A=E4=BC=A0=E5=8D=A1?= =?UTF-8?q?=E7=BA=B8=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scanner/VersionDll.cpp | 18 ++++++++++++++++++ app/scanner/VersionDll.h | 4 ++++ app/scanner/mainwindow.cpp | 6 ++++++ 3 files changed, 28 insertions(+) diff --git a/app/scanner/VersionDll.cpp b/app/scanner/VersionDll.cpp index 2e11219e..f9d4cabe 100644 --- a/app/scanner/VersionDll.cpp +++ b/app/scanner/VersionDll.cpp @@ -26,6 +26,7 @@ VersionDll::VersionDll() m_funcPostUserCloseInfo = NULL; m_funcPostUserLoginInfo = NULL; m_funcPostUserLogoutInfo = NULL; + m_funcPostDevicePaperJamInfo = NULL; m_mgr = NULL; Load(); @@ -215,6 +216,13 @@ HGResult VersionDll::Load() break; } + HGBase_GetDllProcAddress(m_dll, "HGVersion_PostDevicePaperJamInfo", (HGPointer *)&m_funcPostDevicePaperJamInfo); + if (NULL == m_funcPostDevicePaperJamInfo) + { + ok = false; + break; + } + m_funcCreateMgr(&m_mgr); if (NULL == m_mgr) { @@ -443,3 +451,13 @@ HGResult VersionDll::PostUserLogoutInfo(const HGChar *appName) return m_funcPostUserLogoutInfo(m_mgr, appName); } + +HGResult VersionDll::PostDevicePaperJamInfo(const HGChar* devName, const HGChar* devSN, const HGChar* devType, const HGChar* devFW) +{ + if (NULL == m_funcPostDevicePaperJamInfo) + { + return HGBASE_ERR_FAIL; + } + + return m_funcPostDevicePaperJamInfo(m_mgr, devName, devSN, devType, devFW); +} diff --git a/app/scanner/VersionDll.h b/app/scanner/VersionDll.h index d92c0f8e..022e40de 100644 --- a/app/scanner/VersionDll.h +++ b/app/scanner/VersionDll.h @@ -33,6 +33,8 @@ public: HGResult PostUserCloseInfo(const HGChar* appName); HGResult PostUserLoginInfo(const HGChar* appName); HGResult PostUserLogoutInfo(const HGChar* appName); + HGResult PostDevicePaperJamInfo(const HGChar* devName, const HGChar* devSN, const HGChar* devType, const HGChar* devFW); + private: typedef HGResult (HGAPI *HGVersion_CreateMgr)(HGVersionMgr *mgr); typedef HGResult (HGAPI *HGVersion_DestroyMgr)(HGVersionMgr mgr); @@ -55,6 +57,7 @@ private: typedef HGResult (HGAPI *HGVersion_PostUserCloseInfo)(HGVersionMgr mgr, const HGChar* appName); typedef HGResult (HGAPI *HGVersion_PostUserLoginInfo)(HGVersionMgr mgr, const HGChar* appName); typedef HGResult (HGAPI *HGVersion_PostUserLogoutInfo)(HGVersionMgr mgr, const HGChar* appName); + typedef HGResult (HGAPI *HGVersion_PostDevicePaperJamInfo)(HGVersionMgr mgr, const HGChar* devName, const HGChar* devSN, const HGChar* devType, const HGChar* devFW); private: HGDll m_dll; @@ -79,6 +82,7 @@ private: HGVersion_PostUserCloseInfo m_funcPostUserCloseInfo; HGVersion_PostUserLoginInfo m_funcPostUserLoginInfo; HGVersion_PostUserLogoutInfo m_funcPostUserLogoutInfo; + HGVersion_PostDevicePaperJamInfo m_funcPostDevicePaperJamInfo; HGVersionMgr m_mgr; }; diff --git a/app/scanner/mainwindow.cpp b/app/scanner/mainwindow.cpp index b68da0b8..69503a4f 100644 --- a/app/scanner/mainwindow.cpp +++ b/app/scanner/mainwindow.cpp @@ -1095,6 +1095,12 @@ void MainWindow::on_scan_finish(QString finishInfo, int err) } } + if(err == SCANNER_ERR_DEVICE_PAPER_JAMMED) + { + m_versionDll->PostDevicePaperJamInfo(m_currDeviceName.toStdString().c_str(), + m_devSerialNum.toStdString().c_str(), "", m_devVersionNum.toStdString().c_str()); + } + m_versionDll->PostDeviceScanCountInfo(m_currDeviceName.toStdString().c_str(), m_devSerialNum.toStdString().c_str(), "", m_devVersionNum.toStdString().c_str(), m_currScanCount); m_currScanCount = 0; m_isScanning = false;