From 63da590542c6399c46aac443c77628468d454038 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Mon, 26 Jul 2021 10:55:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=81=9C=E7=AB=99=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ATS/service/stage/AtsHeadTrainStageService.java | 5 +++++ .../ATS/service/stage/AtsManualTrainStageService.java | 5 +++++ .../ATS/service/stage/AtsPlanTrainStageService.java | 7 +++++++ .../cbtc/ATS/service/stage/AtsStageService.java | 5 +++++ .../cbtc/ATS/service/stage/AtsTrainStageHandler.java | 11 ++++++++--- 5 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/stage/AtsHeadTrainStageService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/stage/AtsHeadTrainStageService.java index 30fd5d7a1..788b5bf15 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/stage/AtsHeadTrainStageService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/stage/AtsHeadTrainStageService.java @@ -55,6 +55,11 @@ public class AtsHeadTrainStageService implements AtsStageService { @Override public void handleNormalStandParking(Simulation simulation, TrainInfo trainInfo, Section parkSection) { + //环路类目的地码可能需要处理 + } + + @Override + public void ready2DepartFromNormalStand(Simulation simulation, TrainInfo trainInfo, Section parkSection) { DestinationCodeDefinition dcd = simulation.getRepository().getDestinationCodeDefinition(trainInfo.getDestinationCode()); if (Objects.equals(dcd.getSection(), parkSection)) { handleArriveDestination(simulation, trainInfo); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/stage/AtsManualTrainStageService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/stage/AtsManualTrainStageService.java index c7ee875f7..b70b890f9 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/stage/AtsManualTrainStageService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/stage/AtsManualTrainStageService.java @@ -43,6 +43,11 @@ public class AtsManualTrainStageService implements AtsStageService { } + @Override + public void ready2DepartFromNormalStand(Simulation simulation, TrainInfo trainInfo, Section parkSection) { + + } + @Override public void handleTurnBackTrackParking(Simulation simulation, TrainInfo trainInfo, Section parkSection) { diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/stage/AtsPlanTrainStageService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/stage/AtsPlanTrainStageService.java index c516defe0..f7d732943 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/stage/AtsPlanTrainStageService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/stage/AtsPlanTrainStageService.java @@ -75,6 +75,13 @@ public class AtsPlanTrainStageService implements AtsStageService { this.updateNextPlan(simulation, trainInfo, nextTripPlan, nextTripPlan.getFirstStationPlan()); return; } + } + + @Override + public void ready2DepartFromNormalStand(Simulation simulation, TrainInfo trainInfo, Section parkSection) { + SimulationDataRepository repository = simulation.getRepository(); + TripPlan tripPlan = repository.getTripPlan(trainInfo.getServiceNumber(), trainInfo.getTripNumber()); + StationPlan stationPlan = tripPlan.queryStationPlan(parkSection); if (stationPlan == null) { // 非计划中的停靠站台轨,暂不处理 return; diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/stage/AtsStageService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/stage/AtsStageService.java index 99293835c..29347350e 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/stage/AtsStageService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/stage/AtsStageService.java @@ -21,6 +21,11 @@ public interface AtsStageService { */ void handleNormalStandParking(Simulation simulation, TrainInfo trainInfo, Section parkSection); + /** + * 准备从正常站台发车 + */ + void ready2DepartFromNormalStand(Simulation simulation, TrainInfo trainInfo, Section parkSection); + /** * 处理折返轨停车 * @param simulation diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/stage/AtsTrainStageHandler.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/stage/AtsTrainStageHandler.java index 92a47101f..2d1bf8224 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/stage/AtsTrainStageHandler.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/stage/AtsTrainStageHandler.java @@ -6,8 +6,6 @@ import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.constant.SimulationModule; import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository; import club.joylink.rtss.simulation.cbtc.data.map.*; -import club.joylink.rtss.simulation.cbtc.data.plan.StationPlan; -import club.joylink.rtss.simulation.cbtc.data.support.RoutePath; import club.joylink.rtss.simulation.cbtc.data.vo.TrainInfo; import club.joylink.rtss.simulation.cbtc.onboard.ATP.OnboardAtpApiService; import org.springframework.beans.factory.annotation.Autowired; @@ -33,6 +31,7 @@ public class AtsTrainStageHandler { /** * 处理列车回库 + * * @param simulation * @param train */ @@ -50,6 +49,7 @@ public class AtsTrainStageHandler { /** * 处理列车站台停靠(包括正常站台轨、折返轨、转换轨) + * * @param simulation * @param trainInfo */ @@ -63,7 +63,11 @@ public class AtsTrainStageHandler { stageService.handleNormalStandParking(simulation, trainInfo, parkSection); List standList = parkSection.getStandList(); int remainTime = standList.get(0).getRemainTime(); - if (remainTime < 10000) { // 通知列车可以关门了 + if (remainTime < 2 && !trainInfo.isDoorOpen() && + (this.atsStandService.isStandDoorCloseOrInterlockRelease(simulation, parkSection)) && + !this.atsStandService.isHoldTrain(parkSection)) { //即将发车 + stageService.ready2DepartFromNormalStand(simulation, trainInfo, parkSection); + } else if (remainTime < 10000) { // 通知列车可以关门了 this.onboardAtpApiService.departure(simulation, trainInfo.getGroupNumber()); } } else { // 折返轨 @@ -76,6 +80,7 @@ public class AtsTrainStageHandler { /** * 处理列车跳停车站 + * * @param simulation * @param trainInfo */