浏览代码

调试模式

rambo 7 月之前
父节点
当前提交
82b32974fd
共有 3 个文件被更改,包括 5 次插入3 次删除
  1. 2 1
      python/mcu/McuDeviationSet.py
  2. 2 1
      python/mcu/OtherSet.py
  3. 1 1
      python/mcu/RemoteControlV2.py

+ 2 - 1
python/mcu/McuDeviationSet.py

@@ -19,7 +19,8 @@ class McuDeviationSet:
         # self.set_enable_by_mcu()
         # self.show()
         self.last_value = defaultdict(float)
-        self.mcu_debug = McuDebug(mcu, is_debug=True, is_deviation=False)
+        is_debug = True if settings.IS_DEBUG == "true" else False
+        self.mcu_debug = McuDebug(mcu, is_debug=is_debug, is_deviation=False)
         loop = asyncio.get_event_loop()
         loop.create_task(self.get_mcu_deviation(), name="get_mcu_deviation")
         # # 运动到设定位

+ 2 - 1
python/mcu/OtherSet.py

@@ -12,7 +12,8 @@ class OtherSet():
         self.mcu = mcu
         self.get_value_flag = False
         self.last_value = defaultdict(float)
-        self.mcu_debug = McuDebug(mcu, is_debug=True, is_deviation=False)
+        is_debug = True if settings.IS_DEBUG == "true" else False
+        self.mcu_debug = McuDebug(mcu, is_debug=is_debug, is_deviation=False)
         # self.ampy_run = None
         # 自动获取数据
         # QTimer.singleShot(500, self.get_data_from_mcu)

+ 1 - 1
python/mcu/RemoteControlV2.py

@@ -357,7 +357,7 @@ class RemoteControlV2(BaseClass):
                 self.sendSocketMessage(0, "处理单拍消息", data=_data, device_status=-1)
                 self.msg_type = "blue_tooth"
             self.sendSocketMessage(code=0, msg="", data=message, device_status=2)
-            if settings.IS_DEBUG:
+            if settings.IS_DEBUG == "true":
                 print("收到按键", button_value)
             return