rambo 8 mesiacov pred
rodič
commit
69d755ad51

+ 2 - 0
python/mcu/DeviceControl.py

@@ -1269,6 +1269,7 @@ class DeviceControl(BaseClass, metaclass=SingletonType):
                     "current_time":datetime.datetime.now(settings.TIME_ZONE).strftime("%Y-%m-%d %H:%M:%S"),
                 },
             )
+            self.controlDevice("laser_position", 0)
             self.msg_type = "mcu"
             for index, action in enumerate(config_list):
                 await asyncio.sleep(0.1)
@@ -1328,6 +1329,7 @@ class DeviceControl(BaseClass, metaclass=SingletonType):
                 device_status=2,
             )
             self.msg_type = "mcu"
+            self.controlDevice("laser_position", 1)
 
     async def run_mcu_config_single(self, config_info, goods_art_no):
         '''独立拍照  仅作测试用'''

+ 4 - 3
python/mcu/McuDeviationSet.py

@@ -1,7 +1,7 @@
 from collections import defaultdict
 from .McuDebug import McuDebug
 from functools import partial
-import time
+import time, asyncio
 import settings
 
 
@@ -164,7 +164,7 @@ class McuDeviationSet:
                 return True
 
     def change_value(self, value, name):
-        value = round(value, 2)
+        value = round(float(value), 2)
         print("change_value===>", value, name)
         if name == "相机电机":
             self.mcu_debug.camera_high_motor(value=value)
@@ -234,7 +234,8 @@ class McuDeviationSet:
         self.mcu.to_init_device_origin_point(device_name="mcu", is_force=True)
 
     def get_mcu_deviation(self):
-        self.mcu.get_deviation()
+        loop = asyncio.get_event_loop()
+        loop.create_task(self.mcu.get_deviation(), name="get_mcu_deviation")
 
     def get_mcu_deviation_info(self, data):
         if "_type" not in data:

BIN
python/requestments.txt