This commit is contained in:
yangjiaxuan 2023-07-24 17:01:28 +08:00
parent 790381e339
commit 32ce54dda2
1 changed files with 13 additions and 13 deletions

View File

@ -1,4 +1,4 @@
#ifdef max
#ifdef max
#undef max
#endif
#ifdef min
@ -951,10 +951,10 @@ 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浼氬緱鍒拌繖涓<EFBFBD>敊璇?
//if (GetLastError() == ERROR_ALREADY_EXISTS) { //濡傛灉宸茬粡瀛樺湪鍚屽悕鐨凪utex浼氬緱鍒拌繖涓敊璇?
// CloseHandle(singleton_);
// singleton_ = NULL;
// showmsg("鎻愮ず", 202);
// showmsg("鎻愮ず", 202);
//
// return { ReturnCode::Failure, ConditionCode::CapBadOperation };
//}
@ -1021,7 +1021,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;
@ -1062,9 +1062,9 @@ Result huagao_ds::pendingXfersGet(const Identity&, PendingXfers& data)
if (!scanner_.get())
return seqError();
// 显示设置界面时不能阻塞在EndXfer否则最后一张图片传输后显示不出来故在此做阻塞调用
// 显示设置界面时不能阻塞在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);
@ -1228,9 +1228,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) // 鏄剧ず璁剧疆鐣岄潰鏃讹紝涓嶈兘闃诲<EFBFBD>鍦‥ndXfer锛屽惁鍒欐渶鍚庝竴寮犲浘鐗囦紶杈撳悗鏄剧ず涓嶅嚭鏉ワ紝鏁呭湪姝ゅ仛闃诲<EFBFBD>璋冪敤
if (get_scanned_image_count(-1) > 0) // 鏄剧ず璁剧疆鐣岄潰鏃讹紝涓嶈兘闃诲鍦‥ndXfer锛屽惁鍒欐渶鍚庝竴寮犲浘鐗囦紶杈撳悗鏄剧ず涓嶅嚭鏉ワ紝鏁呭湪姝ゅ仛闃诲璋冪敤
{
ok = scanner_->get_first_image_header(&head, NULL, &res);
if (ok)
@ -1632,7 +1632,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)));
Result rt;
//trigger_ProcessEvent(dg, dat, msg); // some APPs may be not trigger (Control, Event, ProcessEvent), we help them :( ... // 浜戦槄鍗锋壂鎻忕<EFBFBD>涓嶇瓑鐘舵€佹敼鍙橈紝鐩存帴鍙栧浘锛屾<EFBFBD>澶勮<EFBFBD><EFBFBD>竴娆$姸鎬?2022-11-07
//trigger_ProcessEvent(dg, dat, msg); // some APPs may be not trigger (Control, Event, ProcessEvent), we help them :( ... // 浜戦槄鍗锋壂鎻忕涓嶇瓑鐘舵€佹敼鍙橈紝鐩存帴鍙栧浘锛屾澶勮缃竴娆$姸鎬?2022-11-07
rt = Base::call(origin, dg, dat, msg, data);
if (log_all_triple_ || ((int)rt.returnCode() && rt.returnCode() != ReturnCode::NotDsEvent))
@ -1834,7 +1834,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<CapType::Indicators>({ FALSE,TRUE }, m_bIndicator ? 1 : 0, 1);
}
@ -1940,9 +1940,9 @@ void huagao_ds::init_support_caps(void)
if (Msg::Set == msg || Msg::Reset == msg) {
int ret = SCANNER_ERR_INVALID_PARAMETER;
val = all[sane_opts::RANGE_POS_DEFAULT];
auto mech = data.currentItem<CapType::IBitDepth>();
if (Msg::Set == msg)
{
auto mech = data.currentItem<CapType::IBitDepth>();
if (mech == 1)
val = COLOR_BW;
else if (mech == 8)
@ -3730,7 +3730,7 @@ int huagao_ds::handle_scanner_event(int ev, bool from_event_proc)
//}
//if (!Twpp::success(rc))
//{
// rc = notifyXferReady(); // 濂藉垎鏁伴渶瑕佸啀閫氱煡 FAINT :( - modified on 2022-10-20
// rc = notifyXferReady(); // 濂藉垎鏁伴渶瑕佸啀閫氱煡 FAINT :( - modified on 2022-10-20
// if (!Twpp::success(rc))
// {
// wchar_t msg[128] = { 0 }, unk[20] = { 0 };
@ -3743,7 +3743,7 @@ int huagao_ds::handle_scanner_event(int ev, bool from_event_proc)
break;
case SANE_EVENT_UI_CLOSE_CANCEL:
//scanner_->stop();
//notifyCloseCancel(); // 淇<EFBFBD><EFBFBD>鐐瑰嚮杩涘害妗?鍙栨秷"鎸夐挳锛孶I涓嶈兘姝父缁撴潫鐨凚UG - added on 2023-02-14
//notifyCloseCancel(); // 淇鐐瑰嚮杩涘害妗?鍙栨秷"鎸夐挳锛孶I涓嶈兘姝父缁撴潫鐨凚UG - added on 2023-02-14
//break;
case SANE_EVENT_UI_CLOSE_NORMAL:
case SANE_EVENT_SCAN_FINISHED: