diff --git a/huagao/CTwainUI.cpp b/huagao/CTwainUI.cpp index 36b5eb57..759319e3 100644 --- a/huagao/CTwainUI.cpp +++ b/huagao/CTwainUI.cpp @@ -85,7 +85,7 @@ BOOL CTwainUI::OnInitDialog() UpdateUI(); UpdateListConfig(); dataChangeFunction(); - setvisable_size(false); + //setvisable_size(false); #ifdef G200 setvisable_sleepmode(false); #endif // G200 diff --git a/huagao/Device/GScan.h b/huagao/Device/GScan.h index be9aae91..ac79bd2c 100644 --- a/huagao/Device/GScan.h +++ b/huagao/Device/GScan.h @@ -191,6 +191,14 @@ public: { return ++imgtransfered; }; + /// + /// 获取折角或者尺寸不符的图像索引 + /// + /// + /// + int geterrorindex() { + return error_index; + }; void UpdateScanInfo(int aquire, int updata) { @@ -256,5 +264,6 @@ protected: int scannum; int lose_image_num; bool is_AndroidOrLinux; + int error_index; }; \ No newline at end of file diff --git a/huagao/Device/GScanO1003399.cpp b/huagao/Device/GScanO1003399.cpp index 5f7ef565..4d916fa2 100644 --- a/huagao/Device/GScanO1003399.cpp +++ b/huagao/Device/GScanO1003399.cpp @@ -318,6 +318,7 @@ void GScanO1003399::config_params(GScanCap& param) void GScanO1003399::Scanner_StartScan(UINT16 count) { + error_index = 0; roller_num = this->count(); scanflag = true; while (m_paths.Size() > 0) @@ -619,8 +620,8 @@ void GScanO1003399::im_rx() if(im_dev_count()<2) return; } - //std::shared_ptr> buffi(new std::vector); - auto& buffi = im_data; + std::shared_ptr> buffi(new std::vector); + //auto& buffi = im_data; int count = front_datasize(); buffi->resize(count); rx_cmd(); @@ -708,7 +709,7 @@ int GScanO1003399::im_dev_count() { return scanner_read_reg(m_usb, SR_IM_COUNT); //!< to-list ; } - +static int num = 0; void GScanO1003399::imgproce(std::shared_ptr>& buff) { auto& buffs= G400Decode(buff).getImageBuffs(); @@ -859,8 +860,12 @@ int GScanO1003399::codeconvter(HGEIntInfo code) { switch (code.Code) { - case 0: + case 1: + error_index = code.Img_Index; return HAVE_DOGEAR; + case 2: + error_index = code.Img_Index; + return SIZE_ERROR; default: break; } diff --git a/huagao/Device/IConfig.h b/huagao/Device/IConfig.h index e6a156a5..75a0205b 100644 --- a/huagao/Device/IConfig.h +++ b/huagao/Device/IConfig.h @@ -127,6 +127,7 @@ struct HGEIntInfo { HGType From; unsigned int Code; + unsigned int Img_Index; }; #define USB_REQ_GET_FPGA_REGS 0x40 diff --git a/huagao/huagaods.cpp b/huagao/huagaods.cpp index 941626ee..c0b0f711 100644 --- a/huagao/huagaods.cpp +++ b/huagao/huagaods.cpp @@ -1964,7 +1964,13 @@ Result HuagaoDs::pendingXfersEnd(const Identity&, PendingXfers& data) { if (guiIndicator->GetSafeHwnd()) guiIndicator->ShowWindow(SW_HIDE); if (ret != -1) { - showmsg("警告", msgs[(UsbSupported)ret], ret); + int index = scanner->geterrorindex(); + if (ret == 82) + showmsg("警告", "在第" + to_string(index) + "页检测到折角,停止扫描!", ret); + else if(ret==75) + showmsg("警告", "在第" + to_string(index) + "页检测到尺寸不符,停止扫描!", ret); + else + showmsg("警告", msgs[(UsbSupported)ret], ret); FileTools::writelog(log_ERROR, msgs[(UsbSupported)ret]); #ifndef G200 scanner->clear_hwerror(); @@ -2574,7 +2580,13 @@ Twpp::Result HuagaoDs::startScan() m_memXferYOff = 0; m_haveError = true; //ShellExecute(guiTwain ? guiTwain->m_hWnd : NULL, TEXT("open"), GetHidedlgPath(), str, NULL, SW_HIDE); - showmsg("警告", msgs[(UsbSupported)retCode]); + int index = scanner->geterrorindex(); + if (retCode == 82) + showmsg("警告", "在第" + to_string(index) + "页检测到折角,停止扫描!", retCode); + else if (retCode == 75) + showmsg("警告", "在第" + to_string(index) + "页检测到尺寸不符,停止扫描!", retCode); + else + showmsg("警告", msgs[(UsbSupported)retCode], retCode); FileTools::writelog(log_ERROR, msgs[(UsbSupported)retCode]); #ifndef G200 scanner->clear_hwerror(); diff --git a/huagao/huagaotwds.rc b/huagao/huagaotwds.rc index 0505be76..9163e816 100644 Binary files a/huagao/huagaotwds.rc and b/huagao/huagaotwds.rc differ