|
|
@@ -148,9 +148,8 @@ class ProgramItem(BaseClass):
|
|
|
# self.mcu.to_get_mcu_base_info()
|
|
|
_s = time.time()
|
|
|
last_num_1 = self.mcu.last_mcu_info_data["num"]
|
|
|
- self.mcu.cleanAllReceiveData()
|
|
|
+ await self.mcu.cleanAllReceiveData()
|
|
|
while 1:
|
|
|
- await asyncio.sleep(0.01)
|
|
|
if self.mcu.action_state != 1:
|
|
|
# 外部终止,停止运行
|
|
|
return False
|
|
|
@@ -169,11 +168,11 @@ class ProgramItem(BaseClass):
|
|
|
else:
|
|
|
self.mcu.to_get_mcu_base_info()
|
|
|
await self.mcu.send_all_cmd()
|
|
|
- time.sleep(0.5)
|
|
|
+ await asyncio.sleep(0.5)
|
|
|
self.mcu.get_basic_info_mcu()
|
|
|
# return True
|
|
|
|
|
|
- time.sleep(0.1)
|
|
|
+ await asyncio.sleep(0.1)
|
|
|
# self.mcu.to_get_mcu_base_info()
|
|
|
|
|
|
async def run(self, total_len=5, *args):
|
|
|
@@ -227,7 +226,7 @@ class ProgramItem(BaseClass):
|
|
|
self.mcu.send_all_cmd()
|
|
|
|
|
|
async def do_run(self, *args):
|
|
|
- await asyncio.sleep(0.01)
|
|
|
+ await asyncio.sleep(0.001)
|
|
|
# if not self.goods_art_no: # and self.action_name != "初始化位置"
|
|
|
# return False
|
|
|
start_time = time.time()
|
|
|
@@ -276,14 +275,14 @@ class ProgramItem(BaseClass):
|
|
|
# MCU运动是否有停止检查,设定超时时间
|
|
|
await self.mcu.send_all_cmd()
|
|
|
if self.mode_type != "其他配置":
|
|
|
- time.sleep(1.2)
|
|
|
+ await asyncio.sleep(1.2)
|
|
|
print("二次检查")
|
|
|
if await self.check_mcu_move_is_stop(re_check=True) is False:
|
|
|
print("MCU检测运动未停止,自动退出, 提前退出")
|
|
|
return
|
|
|
|
|
|
if self.delay_time:
|
|
|
- time.sleep(self.delay_time)
|
|
|
+ await asyncio.sleep(self.delay_time)
|
|
|
if self.is_photograph:
|
|
|
# print("photograph==================")
|
|
|
self.mcu.to_deal_device(device_name="buzzer", times=1)
|
|
|
@@ -313,7 +312,7 @@ class ProgramItem(BaseClass):
|
|
|
|
|
|
if self.after_delay_time:
|
|
|
print("拍照后延时:{}".format(self.after_delay_time))
|
|
|
- time.sleep(self.after_delay_time)
|
|
|
+ await asyncio.sleep(self.after_delay_time)
|
|
|
return True
|
|
|
|
|
|
async def RunSmartShooter(self, goods_art_no,record_id):
|