diff --git a/sane/scanned_img.cpp b/sane/scanned_img.cpp index a81b997..69e093b 100644 --- a/sane/scanned_img.cpp +++ b/sane/scanned_img.cpp @@ -385,7 +385,7 @@ scanned_img::scanned_img(SANE_Handle dev, SANE_Parameters head, void* data, unsi , twain_xfer xfer, SANE_FinalImgFormat* fmt) : head_(head), dpi_(dpi), header_size_(0) , file_(tmp_file ? tmp_file : L""), dev_(dev), status_(IMG_STATUS_OK) { - const bool prepare_data = true; + const bool prepare_data = false; // Compatible with apps that have different actual image retrieval modes from the previously set modes, the data is re-organized at fetch - prepare_data_for_transfer if (fmt) fmt_ = *fmt; diff --git a/twain/twain/huagaods.cpp b/twain/twain/huagaods.cpp index 4b500fd..be515de 100644 --- a/twain/twain/huagaods.cpp +++ b/twain/twain/huagaods.cpp @@ -972,7 +972,7 @@ Twpp::Result huagao_ds::deviceEventGet(const Twpp::Identity& origin, Twpp::Devic Result huagao_ds::identityOpenDs(const Identity& id) { //singleton_ = CreateMutexA(NULL, FALSE, "LookitApp"); - //if (GetLastError() == ERROR_ALREADY_EXISTS) { //婵″倹鐏夊鑼病鐎涙ê婀崥灞芥倳閻ㄥ嚜utex娴兼艾绶遍崚鎷岀箹娑擃亪鏁婄拠? + //if (GetLastError() == ERROR_ALREADY_EXISTS) { //婵″倹鐏夊鑼病鐎涙ê婀崥灞芥倳閻ㄥ嚜utex娴兼艾绶遍崚鎷岀箹娑擃亪鏁婄? // CloseHandle(singleton_); // singleton_ = NULL; // showmsg("閹绘劗銇?, 202); @@ -983,8 +983,9 @@ Result huagao_ds::identityOpenDs(const Identity& id) load_sane_util::initialize(me_); if (!load_sane_util::is_ok()) { - CloseHandle(singleton_); - singleton_ = NULL; + //CloseHandle(singleton_); + //singleton_ = NULL; + load_sane_util::to_log(1, L"huagao_ds::identityOpenDs: %s\r\n", "load_sane_util::initialize failed"); return bummer(); } @@ -996,9 +997,10 @@ Result huagao_ds::identityOpenDs(const Identity& id) if (result.returnCode() != ReturnCode::Success) { - CloseHandle(singleton_); - singleton_ = NULL; + //CloseHandle(singleton_); + //singleton_ = NULL; load_sane_util::uninitialize(); + load_sane_util::to_log(1, L"huagao_ds::identityOpenDs: selectIdentity failed: %d\r\n", (int)result.status()); return result; } @@ -1043,7 +1045,7 @@ Result huagao_ds::identityOpenDs(const Identity& id) name = wcsrchr(pe, L'\\'); if (name++ == NULL) name = pe; - if (wcsicmp(name, L"\u597D\u5206\u6570\u9605\u5377\u626B\u63CF\u7AEF.exe") == 0) // 爱云校PE:好分数阅卷扫描端.exe + if (wcsicmp(name, L"\u597D\u5206\u6570\u9605\u5377\u626B\u63CF\u7AEF.exe") == 0) // 爱云校PE:好分数阅卷扫描?exe double_check_mode_ = DOUBLE_CHECK_ULTRASONIC; else double_check_mode_ = DOUBLE_CHECK_TWAIN; @@ -1104,7 +1106,7 @@ Result huagao_ds::pendingXfersGet(const Identity&, PendingXfers& data) // 显示设置界面时,不能阻塞在EndXfer,否则最后一张图片传输后显示不出来,故在此做阻塞调用 int cnt = get_scanned_image_count(-1); - // FIX-2023-05-29: 是否保持设置界面显示,由APP决定,此处不再由是否显示UI来决定,保持一个扫描流程正常结束 + // FIX-2023-05-29: 是否保持设置界面显示,由APP决定,此处不再由是否显示UI来决定,保持一个扫描流程正常结? //int cnt = show_setting_ ? 1 : get_scanned_image_count(-1); data.setCount(cnt); @@ -1286,9 +1288,9 @@ Result huagao_ds::imageInfoGet(const Identity&, ImageInfo& data) //if (!scanner_->wait_image()) //{ //// notifyCloseOk(); - // return success(); // 婵傝棄鍨庨弫浼存付鐟曚浇绻戦崶鐐村灇閸? + // return success(); // 婵傝棄鍨庨弫浼存付鐟曚浇绻戦崶鐐村灇? //} - if (get_scanned_image_count(-1) > 0) // 閺勫墽銇氱拋鍓х枂閻e矂娼伴弮璁圭礉娑撳秷鍏橀梼璇差敚閸︹€dXfer閿涘苯鎯侀崚娆愭付閸氬簼绔村鐘叉禈閻楀洣绱舵潏鎾虫倵閺勫墽銇氭稉宥呭毉閺夈儻绱濋弫鍛躬濮濄倕浠涢梼璇差敚鐠嬪啰鏁? + if (get_scanned_image_count(-1) > 0) // 閺勫墽銇氱拋鍓х枂閻e矂娼伴弮璁圭礉娑撳秷鍏橀梼璇差敚閸︹€dXfer閿涘苯鎯侀崚娆愭付閸氬簼绔村鐘叉禈閻楀洣绱舵潏鎾虫倵閺勫墽銇氭稉宥呭毉閺夈儻绱濋弫鍛躬濮濄倕浠涢梼璇差敚鐠嬪啰? { ok = scanner_->get_first_image_header(&head, NULL, &res); if (ok) @@ -1905,7 +1907,7 @@ void huagao_ds::init_support_caps(void) return success(); } // data.type - if (!data.operator bool()) //閸忛攱婀佹搴ㄦ珦閹?(閸滃本鐨? Twain sample app ,data.m_cont is null,but DotNet閿涘牆鎷板鏃撶礆 data.m_cont not is null . + if (!data.operator bool()) //閸忛攱婀佹搴ㄦ珦閹?(閸滃本鐨? Twain sample app ,data.m_cont is null,but DotNet閿涘牆鎷板鏃撶?data.m_cont not is null . { data = Capability::createEnumeration({ FALSE,TRUE }, m_bIndicator ? 1 : 0, 1); } @@ -2742,7 +2744,7 @@ void huagao_ds::init_support_caps(void) float sf = trans_range((float)step, (float)l, (float)u, range_l, range_h, true), nf = trans_range((float)now, (float)l, (float)u, range_l, range_h), initf = trans_range((float)init, (float)l, (float)u, range_l, range_h); - sf = 333.30f; // 全通……部分第三方需要固定该值 :( - 2023-10-25 + sf = 333.30f; // 全通……部分第三方需要固定该?:( - 2023-10-25 switch (msg) { case Msg::Get: //sf = 333.333f; @@ -2791,7 +2793,7 @@ void huagao_ds::init_support_caps(void) float sf = trans_range((float)step, (float)l, (float)u, range_l, range_h, true), nf = trans_range((float)now, (float)l, (float)u, range_l, range_h), initf = trans_range((float)init, (float)l, (float)u, range_l, range_h); - sf = 333.30f; // 全通……部分第三方需要固定该值 :( - 2023-10-25 + sf = 333.30f; // 全通……部分第三方需要固定该?:( - 2023-10-25 switch (msg) { case Msg::Get: // sf = 333.333f; @@ -3887,7 +3889,7 @@ int huagao_ds::handle_scanner_event(int ev, bool from_event_proc) break; case SANE_EVENT_UI_CLOSE_CANCEL: //scanner_->stop(); - //notifyCloseCancel(); // 娣囶喖顦查悙鐟板毊鏉╂稑瀹冲?閸欐牗绉?閹稿鎸抽敍瀛禝娑撳秷鍏樺锝呯埗缂佹挻娼惃鍑歎G - added on 2023-02-14 + //notifyCloseCancel(); // 娣囶喖顦查悙鐟板毊鏉╂稑瀹冲?閸欐牗绉?閹稿鎸抽敍瀛禝娑撳秷鍏樺锝呯埗缂佹挻娼惃鍑歎G - added on 2023-02-14 //break; case SANE_EVENT_UI_CLOSE_NORMAL: case SANE_EVENT_SCAN_FINISHED: