From e687b1dc93270d93cb58debfd56d3b6dce721ef2 Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Tue, 8 Nov 2022 11:22:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=97=B6=E9=97=B4=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- device/device.def | 4 +++- sane/scanner.cpp | 16 ++++++---------- twain/twain/huagaods.cpp | 4 ++++ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/device/device.def b/device/device.def index d4f5f41..a3efd6a 100644 --- a/device/device.def +++ b/device/device.def @@ -19,4 +19,6 @@ EXPORTS hg_scanner_err_name hg_scanner_err_description hg_scanner_log_is_enable - hg_scanner_log \ No newline at end of file + hg_scanner_log + get_current_time + get_current_time_w \ No newline at end of file diff --git a/sane/scanner.cpp b/sane/scanner.cpp index f50deb6..a93d82e 100644 --- a/sane/scanner.cpp +++ b/sane/scanner.cpp @@ -2846,12 +2846,10 @@ void init_log(void) fwrite(&bom, sizeof(bom), 1, g_file_); } - time_t now = time(NULL); - struct tm* t = localtime(&now); - wchar_t ts[128] = { 0 }; + wchar_t ts[128] = { 0 }, now[40] = { 0 }; - swprintf_s(ts, _countof(ts) - 1, L"==================%04d-%02d-%02d %02d:%02d:%02d==================\r\n" - , t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); + get_current_time_w(now); + swprintf_s(ts, _countof(ts) - 1, L"==================%s==================\r\n", now); fwrite(ts, 2, lstrlenW(ts), g_file_); } } @@ -2877,12 +2875,10 @@ void log(const wchar_t* info) if (g_file_) { unsigned short bom = 0x0feff; - time_t now = time(NULL); - struct tm* t = localtime(&now); - wchar_t ts[128] = { 0 }; + wchar_t ts[128] = { 0 }, now[40] = { 0 }; - swprintf_s(ts, _countof(ts) - 1, L"==================%04d-%02d-%02d %02d:%02d:%02d (Truncated when size > 10MB) ==================\r\n" - , t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); + get_current_time_w(now); + swprintf_s(ts, _countof(ts) - 1, L"==================%s (Truncated when size > 10MB) ==================\r\n", now); fwrite(&bom, sizeof(bom), 1, g_file_); fwrite(ts, 2, lstrlenW(ts), g_file_); } diff --git a/twain/twain/huagaods.cpp b/twain/twain/huagaods.cpp index 99f120b..09a6494 100644 --- a/twain/twain/huagaods.cpp +++ b/twain/twain/huagaods.cpp @@ -1333,7 +1333,11 @@ Result huagao_ds::call(const Identity& origin, DataGroup dg, Dat dat, Msg msg, v // we can override almost anything from SourceFromThis, even the top-most source instance call //FileTools::write_log("D:\\1.txt", "call:datagroup-"+to_string((int)dg)+"dat-"+to_string(int(dat))+"msg-"+to_string(int(msg))); if (dat == Dat::ImageNativeXfer && state() == DsState::Enabled) // 云阅卷扫描端不等状态改变,直接取图,此处设置一次状态 2022-11-07 + { + load_sane_util::log_info(L"APP SEQ ERROR: fetch image while status in 'Enabled' yet! we change it to 'XferReady' manually.\r\n", 0); + notifyXferReady(); + } return Base::call(origin, dg, dat, msg, data); }