From a268d6930588902e28efdc4f6e10f9801b239902 Mon Sep 17 00:00:00 2001 From: walker-sheng Date: Fri, 29 Jan 2021 10:20:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8C=BA=E6=AE=B5=E9=9D=9E?= =?UTF-8?q?=E9=80=9A=E4=BF=A1=E8=BD=A6=E5=8D=A0=E7=94=A8=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rtss/simulation/cbtc/data/map/Section.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Section.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Section.java index 09236bb18..e074cd8c2 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Section.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Section.java @@ -491,18 +491,16 @@ public class Section extends MayOutOfOrderDevice { * @return */ public boolean isNonCbtcOccupy() { - synchronized (this){ - boolean ctOcc = this.ctOccupied; - if (!CollectionUtils.isEmpty(this.logicList)) { - for (Section logic : this.logicList) { - if (logic.isCtOccupied()) { - ctOcc = true; - break; - } + boolean nct = this.nctOccupied && !this.ctOccupied; + if (!CollectionUtils.isEmpty(this.logicList)) { + for (Section logic : this.logicList) { + if (logic.isCtOccupied() || !logic.isNctOccupied()) { + nct = false; + break; } } - return !ctOcc && this.nctOccupied; } + return nct; } public List
getAtpSectionListBy(float offset1, float offset2) {