diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/ZCLogicLoop.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/ZCLogicLoop.java index ee288324b..d4b4ad74d 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/ZCLogicLoop.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/ZCLogicLoop.java @@ -128,19 +128,6 @@ public class ZCLogicLoop { if (headPosition.getSection().isFault()) { endList.add(new MovementAuthority.End(headPosition.getSection(), MovementAuthority.EndType.FAULT_SECTION)); } - // 前方列车 - VirtualRealityTrain frontTrain = this.queryFrontTrain(train, trainList); - if (Objects.nonNull(frontTrain)) { - Section baseSection; - if (Objects.equals(frontTrain.isRight(), train.isRight())) { - baseSection = frontTrain.calculateTailPosition().getSection(); - } else { - baseSection = frontTrain.getHeadPosition().getSection(); - } - endList.add(new MovementAuthority.End(frontTrain, - MovementAuthority.EndType.FRONT_TRAIN, - baseSection)); - } int count = 0; while (count < 50) { ++count; @@ -202,6 +189,19 @@ public class ZCLogicLoop { section = temp; } + // 前方列车 + VirtualRealityTrain frontTrain = this.queryFrontTrain(train, trainList); + if (Objects.nonNull(frontTrain)) { + Section baseSection; + if (Objects.equals(frontTrain.isRight(), train.isRight())) { + baseSection = frontTrain.calculateTailPosition().getSection(); + } else { + baseSection = frontTrain.getHeadPosition().getSection(); + } + endList.add(new MovementAuthority.End(frontTrain, + MovementAuthority.EndType.FRONT_TRAIN, + baseSection)); + } return endList; }