解决取消扫描时,未取到图导致进度指示器界面卡死的问题
This commit is contained in:
parent
c5b71eb78f
commit
1b3e2be09e
|
@ -807,8 +807,27 @@ void scanner::scan_done(void)
|
||||||
{
|
{
|
||||||
std::string msg(scan_msg_);
|
std::string msg(scan_msg_);
|
||||||
|
|
||||||
while (images_.count())
|
if (err_ != SCANNER_ERR_USER_CANCELED)
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(5));
|
{
|
||||||
|
int cnt = images_.count(), elapse = 0,
|
||||||
|
unit = 5, total = 1000;
|
||||||
|
|
||||||
|
while (cnt)
|
||||||
|
{
|
||||||
|
std::this_thread::sleep_for(std::chrono::milliseconds(unit));
|
||||||
|
elapse++;
|
||||||
|
if (cnt == images_.count())
|
||||||
|
{
|
||||||
|
if (elapse >= total / unit)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
elapse = 0;
|
||||||
|
}
|
||||||
|
cnt = images_.count();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (indicator_)
|
if (indicator_)
|
||||||
indicator_->notify_scan_over(&msg[0], err_ != SCANNER_ERR_OK);
|
indicator_->notify_scan_over(&msg[0], err_ != SCANNER_ERR_OK);
|
||||||
|
|
|
@ -1699,7 +1699,7 @@ Result huagao_ds::call(const Identity& origin, DataGroup dg, Dat dat, Msg msg, v
|
||||||
//trigger_ProcessEvent(dg, dat, msg); // some APPs may be not trigger (Control, Event, ProcessEvent), we help them :( ... // 浜戦槄鍗锋壂鎻忕涓嶇瓑鐘舵€佹敼鍙橈紝鐩存帴鍙栧浘锛屾澶勮缃竴娆$姸鎬?2022-11-07
|
//trigger_ProcessEvent(dg, dat, msg); // some APPs may be not trigger (Control, Event, ProcessEvent), we help them :( ... // 浜戦槄鍗锋壂鎻忕涓嶇瓑鐘舵€佹敼鍙橈紝鐩存帴鍙栧浘锛屾澶勮缃竴娆$姸鎬?2022-11-07
|
||||||
|
|
||||||
rt = Base::call(origin, dg, dat, msg, data);
|
rt = Base::call(origin, dg, dat, msg, data);
|
||||||
if (log_all_triple_ || ((int)rt.returnCode() && rt.returnCode() != ReturnCode::NotDsEvent))
|
if (log_all_triple_ || ((int)rt.returnCode() && rt.returnCode() != ReturnCode::NotDsEvent && msg != Msg::ProcessEvent))
|
||||||
{
|
{
|
||||||
wchar_t dgs[20] = { 0 }, dts[20] = { 0 }, ms[20] = { 0 }, ss[20] = { 0 }, rcs[20] = { 0 }, cs[20] = { 0 };
|
wchar_t dgs[20] = { 0 }, dts[20] = { 0 }, ms[20] = { 0 }, ss[20] = { 0 }, rcs[20] = { 0 }, cs[20] = { 0 };
|
||||||
if (dat == Dat::Capability)
|
if (dat == Dat::Capability)
|
||||||
|
|
Loading…
Reference in New Issue