This commit is contained in:
gb 2023-05-24 16:38:06 +08:00
commit 5f078d3a77
4 changed files with 12 additions and 12 deletions

View File

@ -366,12 +366,12 @@ void hg_scanner::thread_read_int(void)
while (run_)
{
wait_read_int.wait();
if (is_read_int && is_firstopen_)
if (is_read_int && is_firstopen_ && pid_ == 0x300)
{
is_read_int = true;
notify_ui_working_status(STATU_DESC_SCANNER_ERR_DEVICE_DEVS_BOOTING, SANE_EVENT_STATUS, status_);
discard_all_images();
//set_updata0303();
//discard_all_images();
set_updata0303();
notify_ui_working_status(STATU_DESC_SCANNER_ERR_DEVICE_DEVS_START_SUCCES, SANE_EVENT_STATUS, status_);
}
if (is_firstopen_)
@ -4095,7 +4095,7 @@ int hg_scanner::set_auto_flat(int data)
}
int hg_scanner::set_updata0303(void)
{
return 0;
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
}
int hg_scanner::set_device_model(string sts)
{

View File

@ -707,7 +707,7 @@ int hg_scanner_239::discard_all_images(void)
std::lock_guard<std::mutex> lock(io_lock_);
ret = io_->read_interrupt(buf, &size);
}
while (ret == SCANNER_ERR_OK)
while (ret == SCANNER_ERR_OK && size)
{
pre_int++;
if (info->From == setting3399::IMG)
@ -1323,11 +1323,11 @@ int hg_scanner_239::start(void)
if (handled)
return ret;
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;
}
//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;
//}
user_cancel_ = false;
ret = on_is_auto_paper(is_auto_paper_scan);

View File

@ -91,7 +91,7 @@ hg_scanner_300::hg_scanner_300(const char* dev_name,int pid, usb_io* io) : hg_sc
else
init_settings((jsontext3 + jsontext4 + jsontext5).c_str());
}
//initdevice();
initdevice();
wait_read_int.notify();
}
hg_scanner_300::~hg_scanner_300()

View File

@ -636,7 +636,7 @@ int hg_scanner_302::discard_all_images(void)
io_->set_timeout(100);
ret = io_->read_interrupt(buf, &size);
}
while (ret == SCANNER_ERR_OK)
while (ret == SCANNER_ERR_OK && size)
{
pre_int++;
if (info->From == setting3399::IMG)