浏览代码

2022/01/15 检查节点增加雷达信息打印

wk 2 年之前
父节点
当前提交
cf2db13c16

+ 2 - 2
入口引导提示节点/ui_config.json

@@ -2,7 +2,7 @@
   "db": {"ip": "192.168.1.233","port": 3306,"database": "ct_project","user": "zx","password": "zx123456"},
   "rabbitmq": {"ip":"192.168.1.233","port":5672,"user":"zx","password":"zx123456"},
   "led": {"ip": "192.168.1.163","port": 5005},
-  "entrance_id": 2,
-  "unit":1,
+  "entrance_id": 3,
+  "unit":2,
   "prj": {"ip": "192.168.1.193","port": 4352,"type": 2}
 }

+ 23 - 9
入口引导提示节点/window_screen_pyqt.py

@@ -243,12 +243,11 @@ class Frame(QMainWindow):
                     #上一时刻静止且正确,当前噪声,不显示当前数据,显示上一正确数据
                     measure_info.CopyFrom(self.last_moving_statu)
         #先判断光电
-        if is_moving:
-            if icpu_statu.back_io==1:
-                self.panel_txt.ShowImg(self.images["请调整"])
-                self.panel_arrow.FlashImg(self.images["向前调整"])
-                self.last_show="调整"
-                return
+        if icpu_statu.back_io==1:
+            self.panel_txt.ShowImg(self.images["请调整"])
+            self.panel_arrow.FlashImg(self.images["向前调整"])
+            self.last_show="调整"
+            return
 
         #光电正常
         if lidar_statu==MeasureStatu["无数据"]:
@@ -258,9 +257,9 @@ class Frame(QMainWindow):
             return
         elif lidar_statu==MeasureStatu["噪声"]:
             if self.last_moving_statu is None and self.flag is True:
-                self.panel_txt.ShowImg(self.images["检查杂物"])
-                self.panel_arrow.ShowImg(self.images["检查杂物"])
-                self.last_show = "检查杂物"
+                self.panel_txt.ShowImg(self.images['请调整'])
+                self.panel_arrow.ShowImg(self.images["请调整"])
+                self.last_show = "请调整"
                 return
             if self.last_show=="超时":
                 self.panel_txt.ShowImg(self.images["空闲"])
@@ -297,6 +296,21 @@ class Frame(QMainWindow):
                 self.panel_arrow.ShowImg(self.images['超宽车辆'])
                 self.last_show="超宽"
                 return
+            if (border_statu>>1)&0x01==1:
+                self.panel_txt.ShowImg(self.images['请调整'])
+                self.panel_arrow.FlashImg(self.images["向前调整"])
+                self.last_show = "调整"
+                return
+            if (border_statu>>2)&0x01==1:
+                self.panel_txt.ShowImg(self.images['请调整'])
+                self.panel_arrow.FlashImg(self.images["向右调整"])
+                self.last_show = "调整"
+                return
+            if (border_statu>>3)&0x01==1:
+                self.panel_txt.ShowImg(self.images['请调整'])
+                self.panel_arrow.FlashImg(self.images["向左调整"])
+                self.last_show = "调整"
+                return
             border=border_statu&0x0f
             if (border in ArrowType.keys()) is False:
                 self.panel_txt.ShowImg(self.images['检查杂物'])

+ 11 - 4
指令检查节点/CheckEntrance.py

@@ -40,10 +40,15 @@ class EntranceChecker(threading.Thread):
         park = message.park_table()
         park.CopyFrom(park_table)
         measure_info = message.measure_info()
-        tf.Parse(self.measure_statu.statu, measure_info)
+        if self.measure_statu.statu is not None and self.measure_statu.timeout() is False:
+            tf.Parse(self.measure_statu.statu, measure_info)
+        else:
+            park.statu.execute_statu = message.eError
+            park.statu.statu_description = "服务器超时,请联系管理员!"
+            return tf.MessageToString(park, as_utf8=True)
         tm = time.time()
         if self.error_str == 'OK':
-            while time.time() - tm < 0.5:
+            while time.time() - tm < 1:
                 if measure_info.border_statu == MeasureStatu["ok"] and measure_info.ground_status == 0:
                     park.statu.execute_statu = message.eNormal
                     park.statu.statu_description = self.error_str
@@ -57,7 +62,10 @@ class EntranceChecker(threading.Thread):
                     elif im_mcpu_statu.heighth == 4:
                         park.entrance_measure_info.height = 1.90
                     return tf.MessageToString(park, as_utf8=True)
-                time.sleep(0.1)
+                else:
+                    if self.measure_statu.statu is not None and self.measure_statu.timeout() is False:
+                        tf.Parse(self.measure_statu.statu, measure_info)
+                time.sleep(0.05)
             park.statu.execute_statu = message.eError
             park.statu.statu_description = "请检查入口处是否有人员逗留!"
             return tf.MessageToString(park, as_utf8=True)
@@ -169,7 +177,6 @@ class EntranceChecker(threading.Thread):
                     self.last_show="超宽"
                     continue
                 border=border_statu&0x0f
-
                 if (border in ArrowType.keys()) is False:
                     self.error_str='服务器超时,请联系管理员!'
                     self.last_show = "超时"

+ 13 - 6
指令检查节点/node.py

@@ -25,12 +25,15 @@ statu_ex_keys = [
     ["statu_ex","dispatch_3_statu_port"]
 ]
 # mq参数
-mq_ip = "192.168.1.233"
+# mq_ip = "192.168.1.233"
+mq_ip = "127.0.0.1"
+
 mq_port = 5672
-mq_user = "zx"
-mq_password = "zx123456"
+# mq_user = "zx"
+# mq_password = "zx123456"
+mq_user = "wk"
+mq_password = "123456"
 ex_name = "command_ex"
-
 def user_command_callback(body):
     if body.find("car_number")>=0:
         check_park_command(body)
@@ -111,8 +114,12 @@ for i in range(6):
 
 if __name__ == '__main__':
 # 消费指令消息
-    statu = message.table_statu()
-    statu.execute_statu = message.eNormal
+    statu = message.park_table()
+    statu.statu.execute_statu = message.eNormal
+    statu.car_number = "鄂AWK0001"
+    statu.terminal_id = 5
+    statu.unit_id = 3
+    print(statu)
     body = tf.MessageToString(statu, as_utf8=True)
     while True:
         g_rabbitmq.publish("statu_ex", "command_check_statu_port",body)