ソースを参照

update PAD-TMS

root 1 週間 前
コミット
37e28996a9

+ 16 - 13
internal/app/stc/broadcast/stc-broadcast.go

@@ -331,29 +331,32 @@ func processPacket(packet []byte) {
 		//检查是否有任务正在创建
 		action.WaitTaskCreate("PAD-TMS")
 
-		if priority.CheckPriority("PAD-TMS") {
+		if packet[8] == 0x01 { //answer PAD
+			if priority.CheckPriority("PAD-TMS") {
 
-			//Before Answer PAD
-			if packet[8] == 0x01 {
+				//Before Answer PAD
+				//if packet[8] == 0x01 {
 
 				runningTaskName := action.InterruptRunningTask("PAD-TMS") //PAD-TMS interrupt other
 				if runningTaskName != "" {
 					time.Sleep(time.Millisecond * 100) //wait endpoint release
 				}
-			}
-
-			AlarmHandleTMS(packet)
+				//}
 
-			if active.QueueTimer != nil {
-				if active.QueueTimer.Stop() {
-					utils.LoggerDebug.Printf("Stop PAD timer true !")
-				} else {
-					utils.LoggerDebug.Printf("Stop PAD timer false !")
+				if active.QueueTimer != nil {
+					if active.QueueTimer.Stop() {
+						utils.LoggerDebug.Printf("Stop PAD timer true !")
+					} else {
+						utils.LoggerDebug.Printf("Stop PAD timer false !")
+					}
 				}
-			}
 
+				AlarmHandleTMS(packet)
+			} else {
+				alstatus.PaStatus("", "PAD-TMS", "refuse")
+			}
 		} else {
-			alstatus.PaStatus("", "PAD-TMS", "refuse")
+			AlarmHandleTMS(packet)
 		}
 
 		time.Sleep(3 * time.Second)

+ 1 - 1
internal/app/stc/priority/index.go

@@ -145,7 +145,7 @@ func CheckPriority(runType string) bool {
 
 			switch runType {
 			case "PAD-ICP":
-				return false
+				return true
 			case "PAD-TMS":
 				return false
 			case "EMG":