Browse Source

Merge remote-tracking branch 'origin/211130/shapan' into 211130/shapan

泡泡 4 years ago
parent
commit
6665ee5434
1 changed files with 4 additions and 4 deletions
  1. 4 4
      trainControl.py

+ 4 - 4
trainControl.py

@@ -14,7 +14,7 @@ ser = None
 #串口打开
 def openSer():
 
-    ser = serial.Serial("COM8", 9600, timeout=0.5)
+    ser = serial.Serial("COM5", 9600, timeout=0.5)
     # 字节大小
     ser.bytesize = 8
     # 无校验
@@ -51,14 +51,14 @@ def start(ser):
         print("火车上报位置信息为 : ", data)
         if data == b'\xc0\x1c\xed\xc0\xb1\xed' or data == b'\xc0\xb1\xed':
             print("火车在左上报")
-            res = requests.get("http://127.0.0.1:8080/api/train/updateTrainLocal?local=l")
+            res = requests.get("http://127.0.0.1:8082/api/train/updateTrainLocal?local=l")
             print(res.text)
         if data == b'\xc0,\xed\xc0\xb2\xed' or data == b'\xc0\xb2\xed':
             print("火车在右上报")
-            res = requests.get("http://127.0.0.1:8080/api/train/updateTrainLocal?local=r")
+            res = requests.get("http://127.0.0.1:8082/api/train/updateTrainLocal?local=r")
             print(res.text)
         if data == b'\xc0\xb1\xedZ\xa5':
-            res = requests.get("http://127.0.0.1:8080/api/train/updateTrainLocal?local=l")
+            res = requests.get("http://127.0.0.1:8082/api/train/updateTrainLocal?local=l")
             print(res.text)
             print("火车复位上报")
         time.sleep(0.1)