diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/MaService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/MaService.java index b7520a523..e65d21b4d 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/MaService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/MaService.java @@ -381,8 +381,9 @@ public class MaService { boolean right = train.isRight(); Ma ma = null; boolean front = false; + int iterMax = 50; Section section = tailPosition.getSection(); - for (int i = 0; i < 50 && section != null; i++) { + for (int i = 0, j = 0; i < iterMax && j < 3 && section != null; i++) { if (section.equals(headPosition.getSection())) { front = true; } @@ -433,7 +434,14 @@ public class MaService { } section = next; if (ma != null) { - break; + if (ma.distanceToEoa <= 0) { + break; + } + if (j == 0) { + j = 1; + } else { + j++; + } } } return ma; diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityTrain.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityTrain.java index 6bea68caa..fc3b01234 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityTrain.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityTrain.java @@ -687,6 +687,7 @@ public class VirtualRealityTrain extends VirtualRealityDevice { return; } this.fk = Math.min(fk, getCurrentFkMax()); + this.fb = Math.min(fb, getCurrentFbMax()); if (fk > 0) { this.tbControl = TrainTBControl.TRACTION; @@ -1053,7 +1054,8 @@ public class VirtualRealityTrain extends VirtualRealityDevice { * 设置紧急制动的功率和制动力 */ public void emergencyBreak() { - enforceUpdateTBForce(0, 350); + this.fk = 0; + this.fb = 350; } public boolean isInTheStandArea() {