From 8d3cfc90ba21c44c29ace5b1459484f302b7453d Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Fri, 2 Apr 2021 18:54:47 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E6=8E=88=E6=9D=83=E8=AE=A1?= =?UTF-8?q?=E7=AE=97bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cbtc/ATP/ground/ZCLogicLoop.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) 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; }