From 36c01e2943051e46c71da6b6f4a78c74ccc4a415 Mon Sep 17 00:00:00 2001 From: 13038267101 Date: Fri, 5 May 2023 18:33:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hgdriver/hgdev/hg_scanner.cpp | 27 ++++++------- hgdriver/wrapper/huagaoxxx_warraper_ex.cpp | 4 +- sdk/hginclude/huagaoxxx_warraper_ex.h | 44 ++++++++++++++++++---- 3 files changed, 52 insertions(+), 23 deletions(-) diff --git a/hgdriver/hgdev/hg_scanner.cpp b/hgdriver/hgdev/hg_scanner.cpp index 21d11d0..a2dc132 100644 --- a/hgdriver/hgdev/hg_scanner.cpp +++ b/hgdriver/hgdev/hg_scanner.cpp @@ -1160,6 +1160,7 @@ void hg_scanner::working_done(void*) { VLOG_MINI_3(LOG_LEVEL_DEBUG_INFO, "[%s] EXIT All Thread--->Total picture: [%d] and scanner status [%s].\n", hg_log::current_time().c_str(), final_img_index_, hg_scanner_err_description(status_)); } + VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "----------Main End scan status----------%s:\n", hg_scanner_err_description(status_)); test_1_paper_ = false; } @@ -4537,20 +4538,20 @@ int hg_scanner::image_configuration(SCANCONF& ic) VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.sharpen=%d\r\n", ic.sharpen); VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.discardblank_percent=%d\r\n", ic.discardblank_percent); VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.detachnoise.is_detachnoise=%d\r\n", ic.detachnoise.is_detachnoise); - VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.detachnoise.detachnoise=%d\r\n ", ic.detachnoise.detachnoise); - VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.detachnoise.refuseInflow=%d\r\n ", ic.refuseInflow); - VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.detachnoise.refuseInflow=%d\r\n ", ic.refuseInflow); - VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.removeMorr=%d\r\n ", ic.removeMorr); - VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.errorExtention=%d\r\n ", ic.errorExtention); - VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.textureRemove=%d\r\n ", ic.refuseInflow); - VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.fillhole.is_fillhole=%d\r\n ", ic.fillhole.is_fillhole); + VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.detachnoise.detachnoise=%d\r\n", ic.detachnoise.detachnoise); + VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.detachnoise.refuseInflow=%d\r\n", ic.refuseInflow); + VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.detachnoise.refuseInflow=%d\r\n", ic.refuseInflow); + VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.removeMorr=%d\r\n", ic.removeMorr); + VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.errorExtention=%d\r\n", ic.errorExtention); + VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.textureRemove=%d\r\n", ic.refuseInflow); + VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.fillhole.is_fillhole=%d\r\n", ic.fillhole.is_fillhole); VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.ic.fillhole.fillholeratio=%d\r\n ", ic.fillhole.fillholeratio); - VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.fadeback=%d\r\n ", ic.fadeback); - VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.cropRect.enable=%d\r\n ", ic.cropRect.enable); - VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.cropRect.width=%d\r\n ", ic.cropRect.width); - VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.cropRect.height=%d\r\n ", ic.cropRect.height); - VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.cropRect.x=%d\r\n ", ic.cropRect.x); - VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.cropRect.y=%d\r\n ", ic.cropRect.y); + VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.fadeback=%d\r\n", ic.fadeback); + VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.cropRect.enable=%d\r\n", ic.cropRect.enable); + VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.cropRect.width=%d\r\n", ic.cropRect.width); + VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.cropRect.height=%d\r\n", ic.cropRect.height); + VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.cropRect.x=%d\r\n", ic.cropRect.x); + VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.cropRect.y=%d\r\n", ic.cropRect.y); return ret; } \ No newline at end of file diff --git a/hgdriver/wrapper/huagaoxxx_warraper_ex.cpp b/hgdriver/wrapper/huagaoxxx_warraper_ex.cpp index 35cc03f..6ad7ee1 100644 --- a/hgdriver/wrapper/huagaoxxx_warraper_ex.cpp +++ b/hgdriver/wrapper/huagaoxxx_warraper_ex.cpp @@ -444,7 +444,7 @@ extern "C" if (t) *t = *l; if (tmbuf) - sprintf(tmbuf, "%04d-%02d-%02d %02d:%02d:%02d", l->tm_year + 1900, l->tm_mon + 1, l->tm_mday, l->tm_hour, l->tm_min, l->tm_sec); + sprintf(tmbuf, "%04d-%02d-%02d %02d:%02d:%02d--->", l->tm_year + 1900, l->tm_mon + 1, l->tm_mday, l->tm_hour, l->tm_min, l->tm_sec); } void hg_get_current_time_w(wchar_t* tmbuf, struct tm* t) { @@ -454,7 +454,7 @@ extern "C" if (t) *t = *l; if (tmbuf) - swprintf(tmbuf, 40, L"%04d-%02d-%02d %02d:%02d:%02d", l->tm_year + 1900, l->tm_mon + 1, l->tm_mday, l->tm_hour, l->tm_min, l->tm_sec); + swprintf(tmbuf, 40, L"%04d-%02d-%02d %02d:%02d:%02d--->", l->tm_year + 1900, l->tm_mon + 1, l->tm_mday, l->tm_hour, l->tm_min, l->tm_sec); } } diff --git a/sdk/hginclude/huagaoxxx_warraper_ex.h b/sdk/hginclude/huagaoxxx_warraper_ex.h index 0429472..ca19437 100644 --- a/sdk/hginclude/huagaoxxx_warraper_ex.h +++ b/sdk/hginclude/huagaoxxx_warraper_ex.h @@ -500,14 +500,27 @@ if (NULL != (p)) {free((p)); \ #define LOG_INFO(level, info) \ if(hg_scanner_log_is_enable(level)) \ - hg_scanner_log(info); + {\ + char* msgbuf = (char*)malloc(VLOG_MINI_BYTES); \ + if (msgbuf != NULL) \ + { \ + hg_get_current_time(msgbuf);\ + strcpy(msgbuf+strlen(msgbuf),info); \ + hg_scanner_log(msgbuf); \ + SAFE_FREE(msgbuf); \ + } \ + } \ + #define VLOG_1(level, bytes, fmt, arg1) \ if(hg_scanner_log_is_enable(level)) \ { \ char* msgbuf = (char*)malloc(bytes); \ if (msgbuf != NULL) \ - sprintf(msgbuf, fmt, arg1); \ + { \ + hg_get_current_time(msgbuf);\ + sprintf(msgbuf +strlen(msgbuf), fmt, arg1); \ + } \ hg_scanner_log(msgbuf); \ SAFE_FREE(msgbuf); \ } @@ -516,9 +529,12 @@ if (NULL != (p)) {free((p)); \ #define VLOG_2(level, bytes, fmt, arg1, arg2) \ if(hg_scanner_log_is_enable(level)) \ { \ - char* msgbuf = (char*)malloc(bytes); \ + char* msgbuf = (char*)malloc(bytes); \ if (msgbuf != NULL) \ - sprintf(msgbuf, fmt, arg1, arg2); \ + { \ + hg_get_current_time(msgbuf);\ + sprintf(msgbuf+strlen(msgbuf), fmt, arg1, arg2); \ + } \ hg_scanner_log(msgbuf); \ SAFE_FREE(msgbuf); \ } @@ -529,7 +545,10 @@ if (NULL != (p)) {free((p)); \ { \ char* msgbuf = (char*)malloc(bytes); \ if (msgbuf != NULL) \ - sprintf(msgbuf, fmt, arg1, arg2, arg3); \ + { \ + hg_get_current_time(msgbuf);\ + sprintf(msgbuf +strlen(msgbuf), fmt, arg1, arg2, arg3); \ + }\ hg_scanner_log(msgbuf); \ SAFE_FREE(msgbuf); \ } @@ -540,7 +559,10 @@ if (NULL != (p)) {free((p)); \ { \ char* msgbuf = (char*)malloc(bytes); \ if (msgbuf != NULL) \ - sprintf(msgbuf, fmt, arg1, arg2, arg3, arg4); \ + { \ + hg_get_current_time(msgbuf);\ + sprintf(msgbuf+strlen(msgbuf), fmt, arg1, arg2, arg3, arg4); \ +}\ hg_scanner_log(msgbuf); \ SAFE_FREE(msgbuf); \ } @@ -552,7 +574,10 @@ if (NULL != (p)) {free((p)); \ { \ char* msgbuf = (char*)malloc(bytes); \ if(msgbuf) \ - sprintf(msgbuf, fmt, arg1, arg2, arg3, arg4, arg5); \ + { \ +hg_get_current_time(msgbuf);\ + sprintf(msgbuf+strlen(msgbuf), fmt, arg1, arg2, arg3, arg4, arg5); \ + }\ hg_scanner_log(msgbuf); \ SAFE_FREE(msgbuf); \ } @@ -564,7 +589,10 @@ if (NULL != (p)) {free((p)); \ { \ char* msgbuf = (char*)malloc(bytes); \ if (msgbuf != NULL) \ - sprintf(msgbuf, fmt, arg1, arg2, arg3, arg4, arg5, arg6); \ + { \ + hg_get_current_time(msgbuf);\ + sprintf(msgbuf+strlen(msgbuf), fmt, arg1, arg2, arg3, arg4, arg5, arg6); \ + }\ hg_scanner_log(msgbuf); \ SAFE_FREE(msgbuf); \ }