带纸扫描 错误情况未退出
This commit is contained in:
parent
7de96f6dff
commit
e6026342bc
|
@ -1348,13 +1348,12 @@ void hg_scanner_239::thread_get_dves_image(void)
|
||||||
std::lock_guard<std::mutex> lock(io_lock_);
|
std::lock_guard<std::mutex> lock(io_lock_);
|
||||||
|
|
||||||
memset(buf, 0, size);
|
memset(buf, 0, size);
|
||||||
|
io_->set_timeout(500); //2023 11 30之前一直使用1000ms ,但是为了能够快速响应下次的状态信息返回这里设置为500ms
|
||||||
ret = io_->read_interrupt(buf, &size);
|
ret = io_->read_interrupt(buf, &size);
|
||||||
io_->set_timeout(1000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret == SCANNER_ERR_TIMEOUT)
|
if (ret == SCANNER_ERR_TIMEOUT)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(400));
|
|
||||||
if (sw.elapsed_s() > 120 && !is_auto_scan())
|
if (sw.elapsed_s() > 120 && !is_auto_scan())
|
||||||
{
|
{
|
||||||
status_ = ret;
|
status_ = ret;
|
||||||
|
@ -1443,7 +1442,6 @@ void hg_scanner_239::thread_get_dves_image(void)
|
||||||
if (!svdevs_err_.empty())
|
if (!svdevs_err_.empty())
|
||||||
{
|
{
|
||||||
status_ = svdevs_err_.front();
|
status_ = svdevs_err_.front();
|
||||||
svdevs_err_.clear();
|
|
||||||
}
|
}
|
||||||
LOG_INFO(LOG_LEVEL_DEBUG_INFO, "received 'STOPSCAN' message in usb thread, check remaining image and finish scanning ...\n");
|
LOG_INFO(LOG_LEVEL_DEBUG_INFO, "received 'STOPSCAN' message in usb thread, check remaining image and finish scanning ...\n");
|
||||||
|
|
||||||
|
@ -1508,7 +1506,11 @@ void hg_scanner_239::thread_get_dves_image(void)
|
||||||
notify_ui_working_status(str.c_str(), SANE_EVENT_ERROR, status_);
|
notify_ui_working_status(str.c_str(), SANE_EVENT_ERROR, status_);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
svdevs_err_.clear();
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (info->From == setting3399::V4L2)
|
else if (info->From == setting3399::V4L2)
|
||||||
|
|
Loading…
Reference in New Issue