调整第一次打开设备的时候,需要处理的事件(测试版,不一定可行)
This commit is contained in:
parent
42f428483f
commit
ee537730a0
|
@ -356,9 +356,13 @@ void hg_scanner::thread_read_int(void)
|
|||
}
|
||||
void hg_scanner::thread_handle_usb(void)
|
||||
{
|
||||
int cnt = 0;
|
||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "[thread_handle_usb 'START' !!!]:[%d]\n", cnt);
|
||||
while (run_)
|
||||
{
|
||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "[thread_handle_usb 'WAIT' !!!]:[%d]\n", cnt);
|
||||
wait_usb_.wait();
|
||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "[thread_handle_usb 'NOTIFY' !!!]:[%d]\n", cnt);
|
||||
if (!run_)
|
||||
break;
|
||||
|
||||
|
@ -367,7 +371,7 @@ void hg_scanner::thread_handle_usb(void)
|
|||
std::this_thread::sleep_for(std::chrono::milliseconds(3000));
|
||||
if (scan_life_)
|
||||
{
|
||||
LOG_INFO(LOG_LEVEL_FATAL, "image process is still running!\n");
|
||||
VLOG_MINI_1(LOG_LEVEL_FATAL, "[thread_handle_usb image process is still running!]:[%d]\n", cnt);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -377,7 +381,11 @@ void hg_scanner::thread_handle_usb(void)
|
|||
thread_handle_usb_read();
|
||||
if (scan_life_->release() == 0)
|
||||
scan_life_ = NULL;
|
||||
|
||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "[thread_handle_usb_read 'GET IMAGE END'!!!]:[%d]\n", cnt);
|
||||
cnt++;
|
||||
}
|
||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "[thread_handle_usb EXIT !!!]:[%d]\n", cnt);
|
||||
}
|
||||
void hg_scanner::thread_image_handle(void)
|
||||
{
|
||||
|
|
|
@ -1323,10 +1323,14 @@ void hg_scanner_239::thread_handle_usb_read(void)
|
|||
|
||||
int hg_scanner_239::start(void)
|
||||
{
|
||||
if (is_read_int)
|
||||
StopWatch sw;
|
||||
while (is_read_int)
|
||||
{
|
||||
VLOG_MINI_1(LOG_LEVEL_WARNING, "device status is(%s)\n", hg_log::lang_load(ID_STATU_DESC_SCANNER_ERR_DEVICE_BUSY));
|
||||
return SCANNER_ERR_DEVICE_DEVS_BOOTING;
|
||||
if (sw.elapsed_s() > 10)
|
||||
{
|
||||
break;
|
||||
}
|
||||
VLOG_MINI_1(LOG_LEVEL_WARNING, "device status is(%s)\n", STATU_DESC_SCANNER_ERR_DEVICE_DEVS_BOOTING);
|
||||
}
|
||||
bool handled = false;
|
||||
int ret = try_third_app_handle_start(handled),
|
||||
|
|
|
@ -127,7 +127,7 @@ void hg_scanner_300::thread_handle_usb_read(void)
|
|||
status_ = ret = SCANNER_ERR_USER_CANCELED;
|
||||
VLOG_MINI_2(LOG_LEVEL_DEBUG_INFO, "%s:%s\n", hg_log::lang_load(ID_STATU_DESC_SCANNER_ERR_DEVICE_GET_USER_CANCEL_SCAN), hg_scanner_err_name(status_));
|
||||
}
|
||||
VLOG_MINI_2(LOG_LEVEL_DEBUG_INFO, "%s:%s\n", "'STOPSCAN' message in usb thread\n" , hg_scanner_err_name(status_));
|
||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "'STOPSCAN' message in usb thread:%s\n" , hg_scanner_err_name(status_));
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ int hg_scanner_300::discard_all_images(void)
|
|||
std::lock_guard<std::mutex> lock(io_lock_);
|
||||
int ret = io_->read_bulk(&str[0], &block);
|
||||
}
|
||||
while (ret != SCANNER_ERR_TIMEOUT)
|
||||
while (ret == SCANNER_ERR_OK)
|
||||
{
|
||||
cnt++;
|
||||
{
|
||||
|
@ -292,12 +292,20 @@ int hg_scanner_300::discard_all_images(void)
|
|||
}
|
||||
int hg_scanner_300::start(void)
|
||||
{
|
||||
if (is_read_int)
|
||||
//if (is_read_int)
|
||||
//{
|
||||
// VLOG_MINI_1(LOG_LEVEL_WARNING, "device status is(%s)\n", STATU_DESC_SCANNER_ERR_DEVICE_DEVS_BOOTING);
|
||||
// return SCANNER_ERR_DEVICE_DEVS_BOOTING;
|
||||
//}
|
||||
StopWatch sw;
|
||||
while (is_read_int)
|
||||
{
|
||||
VLOG_MINI_1(LOG_LEVEL_WARNING, "device status is(%s)\n", STATU_DESC_SCANNER_ERR_DEVICE_DEVS_BOOTING);
|
||||
return SCANNER_ERR_DEVICE_DEVS_BOOTING;
|
||||
if (sw.elapsed_s() > 10)
|
||||
{
|
||||
break;
|
||||
}
|
||||
VLOG_MINI_1(LOG_LEVEL_WARNING, "device status is(%s)\n", STATU_DESC_SCANNER_ERR_DEVICE_DEVS_BOOTING);
|
||||
}
|
||||
|
||||
//discard_all_images();
|
||||
bool handled = false;
|
||||
int ret = try_third_app_handle_start(handled),
|
||||
|
|
Loading…
Reference in New Issue