清空图像队列,放到启动扫描之前

This commit is contained in:
yangjiaxuan 2023-08-12 18:38:20 +08:00
parent 8e2401be4f
commit f768977515
5 changed files with 14 additions and 8 deletions

View File

@ -1121,9 +1121,9 @@ void hg_scanner::working_begin(void*)
}
void hg_scanner::working_done(void*)
{
imgs_.Clear();
if(user_cancel_)
final_imgs_.clear();
// imgs_.Clear(); // do before start ...
// if(user_cancel_)
// final_imgs_.clear();
if (status_ == SCANNER_ERR_OK && stop_fatal_)
status_ = stop_fatal_;
@ -5205,4 +5205,4 @@ int hg_scanner::image_configuration(SCANCONF& ic)
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.is_colorcast =%d\r\n", ic.is_colorcast);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.isuoloadexceptionimage=%d\r\n", ic.isuoloadexceptionimage);
return ret;
}
}

View File

@ -277,6 +277,8 @@ int hg_scanner_200::start(void)
//discard_prev();
user_cancel_ = false;
imgs_.Clear(); // move from scanning done
final_imgs_.clear(); // move from scanning done
ret = writedown_device_configuration(true);
if (ret == SCANNER_ERR_OK)
writedown_image_configuration();
@ -1052,4 +1054,4 @@ int hg_scanner_200::get_roller_num(int& val)
}
val = usbcb.u32_Data;
return ret;
}
}

View File

@ -1486,6 +1486,7 @@ int hg_scanner_239::stop(void)
}
int hg_scanner_239::reset(void)
{
imgs_.Clear(); // move from scanning done
final_imgs_.clear();
discard_all_images();

View File

@ -318,7 +318,8 @@ int hg_scanner_300::start(void)
if (handled)
return ret;
final_imgs_.clear();
final_imgs_.clear();
imgs_.Clear(); // move from scanning done
//if (is_read_int)
//{
@ -387,6 +388,7 @@ int hg_scanner_300::stop(void)
std::lock_guard<std::mutex> lock(io_lock_);
ret = writeusb(usbcb);
}
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "Write stop command = %d\n", ret);
if (status_ == SCANNER_ERR_DEVICE_BUSY)
{

View File

@ -1126,7 +1126,8 @@ int hg_scanner_302::stop(void)
}
int hg_scanner_302::reset(void)
{
final_imgs_.clear();
imgs_.Clear(); // move from scanning done
final_imgs_.clear();
discard_all_images();
return status_;
@ -1395,4 +1396,4 @@ int hg_scanner_302::get_history_scan_count(int& val)
std::lock_guard<std::mutex> lock(io_lock_);
int ret = read_register(setting3399::SR_GET_SCANN_NUM, &val);
return ret;
}
}