From 298fb9a1a343e59bdfbcb207797f95972a27336a Mon Sep 17 00:00:00 2001 From: walker-sheng Date: Fri, 29 Jan 2021 16:44:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E8=BD=A8=E5=88=97=E8=BD=A6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=81=9C=E7=AB=99=E6=B5=81=E7=A8=8B=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=B1=E8=BD=AC=E6=8D=A2=E8=BD=A8=E5=88=97?= =?UTF-8?q?=E8=BD=A6=E6=B5=81=E7=A8=8B=E5=AF=BC=E8=87=B4=E7=9A=84ATS?= =?UTF-8?q?=E8=BF=9B=E8=B7=AF=E8=A7=A6=E5=8F=91=E9=80=BB=E8=BE=91=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20=E4=BF=AE=E6=94=B9=E8=BF=9B=E8=B7=AF=E5=BB=B6?= =?UTF-8?q?=E7=BB=AD=E4=BF=9D=E6=8A=A4=E9=81=93=E5=B2=94=E9=94=81=E9=97=AD?= =?UTF-8?q?=E9=80=BB=E8=BE=91bug=20=E4=BF=AE=E6=94=B9=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E8=BD=A8=E5=88=97=E8=BD=A6=E5=88=9D=E5=A7=8B=E5=8C=96=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rtss/simulation/cbtc/ATS/service/AtsPlanService.java | 9 ++++++++- .../cbtc/ATS/service/AtsRouteSettingService.java | 2 +- .../rtss/simulation/cbtc/CI/service/RouteService.java | 4 ++++ .../rtss/simulation/cbtc/onboard/ATP/ATPLogicLoop.java | 4 ++++ .../rtss/simulation/cbtc/onboard/ATP/ATPService.java | 2 +- 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsPlanService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsPlanService.java index 592fba715..74a54c8a5 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsPlanService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsPlanService.java @@ -576,7 +576,14 @@ public class AtsPlanService { } // 根据路径获取加载方向 List routePaths = repository.getRoutePaths(startSection, endSection); - boolean right = routePaths.get(0).isRight(); + RoutePath routePath = routePaths.get(0); + boolean right = routePath.isRight(); + if (startSection.isOccupied() || + (Objects.nonNull(startSection.getSectionOf(right)) && + startSection.getSectionOf(right).isOccupied())) { + // 转换轨有车占用,不加载 + return; + } float offset = startSection.getStopPointByDirection(right); SectionPosition headPosition = new SectionPosition(startSection, offset); // 下一计划到达:第一车站到发计划 diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsRouteSettingService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsRouteSettingService.java index 0a970f55b..1ad9c0eef 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsRouteSettingService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsRouteSettingService.java @@ -220,7 +220,7 @@ public class AtsRouteSettingService { if (Objects.nonNull(train.getPlanStandTrack())) { Section nextSection = repository.getByCode(train.getPlanStandTrack(), Section.class); if (!Objects.equals(trainSection, nextSection)) { - if (train.isParking()) { // 列车在站台停车 + if (train.isParking() && !trainSection.isTransferTrack()) { // 列车在站台停车 // 处理站前折返的进路排列 routePaths = repository.queryRoutePaths(trainSection, nextSection); } else if (train.isStop() && !trainSection.isNormalStandTrack() && (trainSection.isTurnBackTrack())) { // 折返轨停车 diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java index 68c998953..4d5b0fa56 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java @@ -523,6 +523,10 @@ public class RouteService { this.routeFlsControl(simulation, flsList); if (config.isLockFirst()) { for (SwitchElement switchElement : switchList) { + if (!switchElement.isOnPosition() && + (switchElement.getASwitch().isSectionOccupied() || switchElement.getASwitch().isLocked())) { + continue; + } switchElement.getASwitch().overlapLock(); } if (!CollectionUtils.isEmpty(flsList)) { diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPLogicLoop.java b/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPLogicLoop.java index 0ebcafd71..d040972db 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPLogicLoop.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPLogicLoop.java @@ -193,6 +193,10 @@ public class ATPLogicLoop { } private void handleStandParkedTrain(Simulation simulation, VirtualRealityTrain train) { + if (train.getHeadPosition().getSection().isTransferTrack()) { + // 列车在转换轨,直接发车 + train.earlyDeparture(); + } StandParkedTrainActivity activity = train.getStandParkedTrainActivity(); int parkRemainTime = train.getParkRemainTime(); if (parkRemainTime > 0) { 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 b98b5086b..f330a4570 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 @@ -214,7 +214,7 @@ public class ATPService { if (train.isStop()) { SectionPosition headPosition = train.getHeadPosition(); Section headSection = headPosition.getSection(); - if (headSection.isNormalStandTrack()) { + if (headSection.isNormalStandTrack() || headSection.isTransferTrack()) { float offset = headPosition.getOffset(); float stopPoint = headSection.getStopPointByDirection(train.isRight()); float dlen = Math.abs(offset - stopPoint);