Merge branch 'main-v2' of ssh://120.27.199.238:222/Havoc420mac/mi-task into main-v2

This commit is contained in:
hav 2025-08-20 10:50:12 +08:00
commit 9164ab14ef

View File

@ -366,7 +366,7 @@ class ImageProcessor:
interval: 扫描间隔单位秒
"""
if self.scan_thread is not None and self.scan_thread.is_alive():
self.log.warning("异步扫描已经在运行中", "警告")
# self.log.warning("异步扫描已经在运行中", "警告")
print('scan,warn')
return
@ -375,7 +375,7 @@ class ImageProcessor:
self.scan_thread = Thread(target=self._async_scan_worker, args=(interval,))
self.scan_thread.daemon = True # 设为守护线程,主线程结束时自动结束
self.scan_thread.start()
self.log.info("启动异步 QR 码扫描线程", "启动")
# self.log.info("启动异步 QR 码扫描线程", "启动")
print('start')
def stop_async_scan(self):
@ -383,7 +383,7 @@ class ImageProcessor:
self.enable_async_scan = False
if self.scan_thread and self.scan_thread.is_alive():
self.scan_thread.join(timeout=1.0)
self.log.info("异步 QR 码扫描线程已停止", "停止")
# self.log.info("异步 QR 码扫描线程已停止", "停止")
print('stop')
def _async_scan_worker(self, interval):
@ -407,11 +407,11 @@ class ImageProcessor:
if qr_data:
self.last_qr_result = qr_data
self.last_qr_time = current_time
self.log.success(f"异步扫描到 QR 码: {qr_data}", "扫描")
# self.log.success(f"异步扫描到 QR 码: {qr_data}", "扫描")
print(f"异步扫描到 QR 码: {qr_data}")
except Exception as e:
self.is_scanning = False
self.log.error(f"异步 QR 码扫描出错: {e}", "错误")
# self.log.error(f"异步 QR 码扫描出错: {e}", "错误")
print(f"异步 QR 码扫描出错: {e}")
else:
print('no img')