增加EnableDS/DisableDS/EndXfer日志

This commit is contained in:
gb 2023-12-07 15:07:21 +08:00
parent cd6298168a
commit f196fea9b0
1 changed files with 14 additions and 11 deletions

View File

@ -975,7 +975,7 @@ Result huagao_ds::identityOpenDs(const Identity& id)
//if (GetLastError() == ERROR_ALREADY_EXISTS) { //濡傛灉宸茬粡瀛樺湪鍚屽悕鐨凪utex浼氬緱鍒拌繖涓敊璇? //if (GetLastError() == ERROR_ALREADY_EXISTS) { //濡傛灉宸茬粡瀛樺湪鍚屽悕鐨凪utex浼氬緱鍒拌繖涓敊璇?
// CloseHandle(singleton_); // CloseHandle(singleton_);
// singleton_ = NULL; // singleton_ = NULL;
// showmsg("鎻愮ず", 202); // showmsg("骼サ諢ョ縺?, 202);
// //
// return { ReturnCode::Failure, ConditionCode::CapBadOperation }; // return { ReturnCode::Failure, ConditionCode::CapBadOperation };
//} //}
@ -1043,7 +1043,7 @@ Result huagao_ds::identityOpenDs(const Identity& id)
name = wcsrchr(pe, L'\\'); name = wcsrchr(pe, L'\\');
if (name++ == NULL) if (name++ == NULL)
name = pe; 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) // 辷ア莠第<EFBFBD>。PE<EFBFBD>壼・ス蛻<EFBFBD>焚髦<EFBFBD>差謇ォ謠冗ォ?exe
double_check_mode_ = DOUBLE_CHECK_ULTRASONIC; double_check_mode_ = DOUBLE_CHECK_ULTRASONIC;
else else
double_check_mode_ = DOUBLE_CHECK_TWAIN; double_check_mode_ = DOUBLE_CHECK_TWAIN;
@ -1104,7 +1104,7 @@ Result huagao_ds::pendingXfersGet(const Identity&, PendingXfers& data)
// 显示设置界面时不能阻塞在EndXfer否则最后一张图片传输后显示不出来故在此做阻塞调用 // 显示设置界面时不能阻塞在EndXfer否则最后一张图片传输后显示不出来故在此做阻塞调用
int cnt = get_scanned_image_count(-1); int cnt = get_scanned_image_count(-1);
// FIX-2023-05-29: 是否保持设置界面显示由APP决定此处不再由是否显示UI来决定保持一个扫描流程正常结束 // FIX-2023-05-29: 譏ッ蜷ヲ菫晄戟隶セ鄂ョ逡碁擇譏セ遉コ<EFBFBD>檎罰APP蜀ウ螳夲シ梧ュ、螟<EFBFBD>ク榊<EFBFBD>逕ア譏ッ蜷ヲ譏セ遉コUI譚・蜀ウ螳夲シ御ソ晄戟荳€荳ェ謇ォ謠乗オ∫ィ区ュ」蟶ク扈捺<EFBFBD>?
//int cnt = show_setting_ ? 1 : get_scanned_image_count(-1); //int cnt = show_setting_ ? 1 : get_scanned_image_count(-1);
data.setCount(cnt); data.setCount(cnt);
@ -1113,6 +1113,7 @@ Result huagao_ds::pendingXfersGet(const Identity&, PendingXfers& data)
Result huagao_ds::pendingXfersEnd(const Identity& id, PendingXfers& data) Result huagao_ds::pendingXfersEnd(const Identity& id, PendingXfers& data)
{ {
// complete transferring of current image ... // complete transferring of current image ...
load_sane_util::log_info(L"pendingXfersEnd ...\r\n", 1);
pending_xfer_.clear(); pending_xfer_.clear();
if (scanner_.get()) if (scanner_.get())
{ {
@ -1183,6 +1184,7 @@ Result huagao_ds::setupMemXferGet(const Identity& id, SetupMemXfer& data)
} }
Result huagao_ds::userInterfaceDisable(const Identity&, UserInterface& ui) Result huagao_ds::userInterfaceDisable(const Identity&, UserInterface& ui)
{ {
load_sane_util::log_info(L"userInterfaceDisable ...\r\n", 1);
if (scanner_.get()) if (scanner_.get())
{ {
scanner_->stop(); scanner_->stop();
@ -1193,6 +1195,7 @@ Result huagao_ds::userInterfaceDisable(const Identity&, UserInterface& ui)
} }
Result huagao_ds::userInterfaceEnable(const Identity&, UserInterface& ui) Result huagao_ds::userInterfaceEnable(const Identity&, UserInterface& ui)
{ {
load_sane_util::log_info(L"userInterfaceEnable ...\r\n", 1);
notfify_close_ = false; notfify_close_ = false;
bUiOnly_ = false; bUiOnly_ = false;
show_setting_ = false; show_setting_ = false;
@ -1283,9 +1286,9 @@ Result huagao_ds::imageInfoGet(const Identity&, ImageInfo& data)
//if (!scanner_->wait_image()) //if (!scanner_->wait_image())
//{ //{
//// notifyCloseOk(); //// notifyCloseOk();
// return success(); // 濂藉垎鏁伴渶瑕佽繑鍥炴垚鍔? // return success(); // 豼り莱蝙朱潤莨エ貂カ迹穂スス郢鷹婚轤エ蝙夐<EFBFBD>?
//} //}
if (get_scanned_image_count(-1) > 0) // 鏄剧ず璁剧疆鐣岄潰鏃讹紝涓嶈兘闃诲鍦‥ndXfer锛屽惁鍒欐渶鍚庝竴寮犲浘鐗囦紶杈撳悗鏄剧ず涓嶅嚭鏉ワ紝鏁呭湪姝ゅ仛闃诲璋冪敤 if (get_scanned_image_count(-1) > 0) // <EFBFBD>鴬縺夂秩蜑ァ逍<EFBFBD>瀬蟯<EFBFBD>スー髀<EFBFBD>ョケ邏晄カ灘カ亥<EFBFBD><EFBFBD>ッイ赶」骰ヲ窶・ndXfer髞帛アス諠<EFBFBD>穀谺先クカ骰壼コ晉ォエ蟇ョ迥イ豬倬雛蝗ヲ邏カ譚域諜謔鈴巡蜑ァ縺壽カ灘カ<EFBFBD>坏髀峨Ρ邏晞潤蜻ュ貉ェ蟋昴莉幃翼隸イ赶」迺句<EFBFBD>謨?
{ {
ok = scanner_->get_first_image_header(&head, NULL, &res); ok = scanner_->get_first_image_header(&head, NULL, &res);
if (ok) if (ok)
@ -1697,7 +1700,7 @@ Result huagao_ds::call(const Identity& origin, DataGroup dg, Dat dat, Msg msg, v
//FileTools::write_log("D:\\1.txt", "call:datagroup-"+to_string((int)dg)+"dat-"+to_string(int(dat))+"msg-"+to_string(int(msg))); //FileTools::write_log("D:\\1.txt", "call:datagroup-"+to_string((int)dg)+"dat-"+to_string(int(dat))+"msg-"+to_string(int(msg)));
Result rt; Result rt;
//trigger_ProcessEvent(dg, dat, msg); // some APPs may be not trigger (Control, Event, ProcessEvent), we help them :( ... // 浜戦槄鍗锋壂鎻忕涓嶇瓑鐘舵€佹敼鍙橈紝鐩存帴鍙栧浘锛屾澶勮缃竴娆$姸鎬?2022-11-07 //trigger_ProcessEvent(dg, dat, msg); // some APPs may be not trigger (Control, Event, ProcessEvent), we help them :( ... // 豬懈姶讒<EFBFBD>漉髞句」る悉蠢俸〓豸灘カ<EFBFBD>淘髏倩扱竄ャ菴ケ謨シ骰呎ゥ育エ晞姓蟄伜クエ骰呎<EFBFBD>ァ豬倬縛螻セ﨡晄セカ蜍ョ裵慕シ<EFBFBD><EFBFBD>遶エ螽<EFBFBD><EFBFBD>ァク骼?2022-11-07
rt = Base::call(origin, dg, dat, msg, data); rt = Base::call(origin, dg, dat, msg, data);
if (log_all_triple_ || ((int)rt.returnCode() && rt.returnCode() != ReturnCode::NotDsEvent && msg != Msg::ProcessEvent)) if (log_all_triple_ || ((int)rt.returnCode() && rt.returnCode() != ReturnCode::NotDsEvent && msg != Msg::ProcessEvent))
@ -1902,7 +1905,7 @@ void huagao_ds::init_support_caps(void)
return success(); return success();
} }
// data.type // 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()) //骰城萩貉∵、句コィ讚馴<EFBFBD>?(骰懷アセ逧? Twain sample app ,data.m_cont is null,but DotNet髞帛<E9AB9E>晄恐蟋俶欄邏<E6AC84> data.m_cont not is null .
{ {
data = Capability::createEnumeration<CapType::Indicators>({ FALSE,TRUE }, m_bIndicator ? 1 : 0, 1); data = Capability::createEnumeration<CapType::Indicators>({ FALSE,TRUE }, m_bIndicator ? 1 : 0, 1);
} }
@ -2739,7 +2742,7 @@ void huagao_ds::init_support_caps(void)
float sf = trans_range((float)step, (float)l, (float)u, range_l, range_h, true), 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), 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); initf = trans_range((float)init, (float)l, (float)u, range_l, range_h);
sf = 333.30f; // 全通……部分第三方需要固定该值 :( - 2023-10-25 sf = 333.30f; // 蜈ィ騾壺€ヲ窶ヲ驛ィ蛻<EFBFBD>ャャ荳画婿髴€隕∝崋螳夊ッ・蛟?:( - 2023-10-25
switch (msg) { switch (msg) {
case Msg::Get: case Msg::Get:
//sf = 333.333f; //sf = 333.333f;
@ -2788,7 +2791,7 @@ void huagao_ds::init_support_caps(void)
float sf = trans_range((float)step, (float)l, (float)u, range_l, range_h, true), 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), 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); initf = trans_range((float)init, (float)l, (float)u, range_l, range_h);
sf = 333.30f; // 全通……部分第三方需要固定该值 :( - 2023-10-25 sf = 333.30f; // 蜈ィ騾壺€ヲ窶ヲ驛ィ蛻<EFBFBD>ャャ荳画婿髴€隕∝崋螳夊ッ・蛟?:( - 2023-10-25
switch (msg) { switch (msg) {
case Msg::Get: case Msg::Get:
// sf = 333.333f; // sf = 333.333f;
@ -3871,7 +3874,7 @@ int huagao_ds::handle_scanner_event(int ev, bool from_event_proc)
//} //}
//if (!Twpp::success(rc)) //if (!Twpp::success(rc))
//{ //{
// rc = notifyXferReady(); // 濂藉垎鏁伴渶瑕佸啀閫氱煡 FAINT :( - modified on 2022-10-20 // rc = notifyXferReady(); // 豼り莱蝙朱潤莨エ貂カ迹穂スク蝠€髢ォ豌ア辣?FAINT :( - modified on 2022-10-20
// if (!Twpp::success(rc)) // if (!Twpp::success(rc))
// { // {
// wchar_t msg[128] = { 0 }, unk[20] = { 0 }; // wchar_t msg[128] = { 0 }, unk[20] = { 0 };
@ -3884,7 +3887,7 @@ int huagao_ds::handle_scanner_event(int ev, bool from_event_proc)
break; break;
case SANE_EVENT_UI_CLOSE_CANCEL: case SANE_EVENT_UI_CLOSE_CANCEL:
//scanner_->stop(); //scanner_->stop();
//notifyCloseCancel(); // 淇鐐瑰嚮杩涘害妗?鍙栨秷"鎸夐挳锛孶I涓嶈兘姝父缁撴潫鐨凚UG - added on 2023-02-14 //notifyCloseCancel(); // <EFBFBD><EFBFBD>逸イ髏千族蝴ョ譚ゥ豸伜ョウ螯<EFBFBD>?骰呎<E9AAB0>ィ遘?骼ク螟先元髞帛ュカI豸灘カ亥<EFBDB6>蟋晢ス<E699A2>宛郛∵超貎ォ髏ィ蜃啅G - added on 2023-02-14
//break; //break;
case SANE_EVENT_UI_CLOSE_NORMAL: case SANE_EVENT_UI_CLOSE_NORMAL:
case SANE_EVENT_SCAN_FINISHED: case SANE_EVENT_SCAN_FINISHED: