双张提示,只弹第一次

This commit is contained in:
gb 2023-10-17 17:52:13 +08:00
parent 56146725d6
commit 80ffb60c34
2 changed files with 22 additions and 5 deletions

View File

@ -1588,6 +1588,7 @@ int scanner::set_is_multiout(bool enable)
int scanner::thread_start(void)
{
scan_over_ = false;
double_handle_ = DOUBLE_FEED_NEED_UI;
int ret = hg_sane_middleware::instance()->start(handle_, NULL);
@ -3575,6 +3576,8 @@ int scanner::handle_device_event(int ev_code, void* data, unsigned int* len)
wchar_t name[40] = { 0 };
if (simg->flag.statu && callback::abnormal_image)
{
if (double_handle_ == DOUBLE_FEED_NEED_UI)
{
if (callback::abnormal_image(simg) == SANE_Abnormal_Image_Discard)
{
@ -3583,8 +3586,14 @@ int scanner::handle_device_event(int ev_code, void* data, unsigned int* len)
swprintf_s(info, _countof(info) - 1, L"Discard image %d for the status is: %d\r\n", simg->src_id, simg->flag.statu);
log_info(info, LOG_LEVEL_DEBUG_INFO);
return 0;
double_handle_ = DOUBLE_FEED_DISCARD;
}
else
double_handle_ = DOUBLE_FEED_KEEP;
}
if (double_handle_ == DOUBLE_FEED_DISCARD)
return 0;
}
swprintf_s(name, _countof(name) - 1, L"img_%05u.bmp", ++img_ind_);

View File

@ -40,6 +40,13 @@ class scanner : public ISaneInvoker, virtual public refer
int bytes;
}SIMPLEOPT;
enum
{
DOUBLE_FEED_NEED_UI = 0, // 需要用户抉择
DOUBLE_FEED_KEEP, // 用户选择保存
DOUBLE_FEED_DISCARD, // 用户选择丢弃
};
SANE_Handle handle_;
SCANNERID id_;
int err_;
@ -47,6 +54,7 @@ class scanner : public ISaneInvoker, virtual public refer
int prev_start_result_;
int dpi_;
int fetch_imgs_ = 0; // count for images has fetched by APP
int double_handle_ = DOUBLE_FEED_NEED_UI; //
bool is_bIndicator;
bool is_show_setting_;
unsigned int img_ind_;