From fb343bba80057853b61d40490c860a1d3eec0b2e Mon Sep 17 00:00:00 2001 From: walker-sheng Date: Fri, 29 Jan 2021 09:53:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BE=A7=E9=98=B2=E9=94=81?= =?UTF-8?q?=E9=97=AD=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../club/joylink/rtss/simulation/cbtc/data/map/RouteFls.java | 4 ++-- .../joylink/rtss/simulation/cbtc/data/map/SwitchElement.java | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/RouteFls.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/RouteFls.java index d8d1858e1..ccdcf7cd6 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/RouteFls.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/RouteFls.java @@ -64,11 +64,11 @@ public class RouteFls { public void lock() { for (FlsElement flsElement : this.getLevel1List()) { SwitchElement pSwitch = flsElement.getPSwitch(); - if (pSwitch != null && !pSwitch.getASwitch().isSectionOccupied()) { + if (pSwitch != null && (pSwitch.isOnPosition() || !pSwitch.getASwitch().isSectionOccupied())) { pSwitch.getASwitch().fpLock(); } else { SwitchElement fpae = flsElement.getFpae(); - if (fpae != null && !fpae.getASwitch().isSectionOccupied()) { + if (fpae != null && (fpae.isOnPosition() || !fpae.getASwitch().isSectionOccupied())) { fpae.getASwitch().fpLock(); } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/SwitchElement.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/SwitchElement.java index 36f472eb6..4633548ec 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/SwitchElement.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/SwitchElement.java @@ -34,4 +34,8 @@ public class SwitchElement { } return true; } + + public boolean isOnPosition() { + return this.aSwitch.isOnPosition(this.isNormal()); + } }