From 20f23b54688212464ab617eb607f3f13b83b89e5 Mon Sep 17 00:00:00 2001 From: walker-sheng Date: Mon, 30 Aug 2021 17:08:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=97=E8=BD=A6=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E6=8E=88=E6=9D=83=E2=80=94=E2=80=94=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=9C=AA=E9=94=81=E9=97=AD=E5=8C=BA=E6=AE=B5=E4=BD=9C=E4=B8=BA?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E6=8E=88=E6=9D=83=E7=BB=88=E7=82=B9=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../simulation/cbtc/ATP/ground/MaService.java | 16 ++++++++++++++++ .../simulation/cbtc/onboard/ATP/ATPService.java | 2 ++ 2 files changed, 18 insertions(+) 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 5b0b2855b..a88d51a1d 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 @@ -416,6 +416,22 @@ public class MaService { // 道岔故障进路,直接构建返回 ma = this.checkAndUpdateMa(ma, new Ma(train, section, MaType.Fault_Route)); } + // 反向锁闭区段 + if (right != route.getStart().isRight()) { // 列车方向和区段进路方向相反 + Signal aheadSignal = section.getSignalOf(right); + if (aheadSignal == null || aheadSignal.getLockedRoute() == null || + !aheadSignal.getLockedRoute().isOpen()) { + ma = this.checkAndUpdateMa(ma, new Ma(train, section, MaType.Closed_Section)); + } + } + } else if(front) { + if (!section.isRouteLock() && !section.isOverlapLock()) {//列车前方区段未锁闭 + Signal aheadSignal = section.getSignalOf(right); + if (aheadSignal == null || aheadSignal.getLockedRoute() == null || + !aheadSignal.getLockedRoute().isOpen()) { + ma = this.checkAndUpdateMa(ma, new Ma(train, section, MaType.Closed_Section)); + } + } } if (section.isClosed()) { // 关闭的区段 diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPService.java index 56a116f7b..95adfdafc 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPService.java @@ -273,6 +273,8 @@ public class ATPService { // 车尾变车头,车头变车尾 train.setHeadPosition(newHeadPosition); train.setRight(!right); + // 清除旧的移动授权 + train.setMa2(null); } public void changeEndsProgress(VirtualRealityTrain train) {