فهرست منبع

重拍报错问题

rambo 4 ماه پیش
والد
کامیت
1cf3a70cbc
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      python/mcu/DeviceControl.py

+ 3 - 3
python/mcu/DeviceControl.py

@@ -341,8 +341,8 @@ class DeviceControl(BaseClass, metaclass=SingletonType):
             self.send_data_queue.append(data)
         self.lock.release()
     async def send_all_cmd(self):
+        await asyncio.sleep(0.001)
         while True:
-            await asyncio.sleep(0.001)
             if self.send_data_queue:
                 self.sendSocketMessage(msg="正在发送命令", device_status=1)
                 data = self.send_data_queue.pop(0)
@@ -1432,7 +1432,7 @@ class DeviceControl(BaseClass, metaclass=SingletonType):
             self.msg_type = "mcu"
             self.is_runn_action = True
             for index, action in enumerate(config_list):
-                await asyncio.sleep(0.1)
+                # await asyncio.sleep(0.01)
                 if self.is_stop_action == True:
                     self.is_stop_action = False
                     break
@@ -1515,7 +1515,7 @@ class DeviceControl(BaseClass, metaclass=SingletonType):
                 return
             self.msg_type = "photo_take"
             program_item.smart_shooter = smart_shooter
-            program_item.run(3)
+            await program_item.run(3)
             self.sendSocketMessage(
                 code=0,
                 msg="{} 执行完成~".format(program_item.action_name),