From 7b320c0a2e3d435984c329679093e5e4c5f07b81 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Tue, 24 May 2022 18:31:09 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=BC=95=E5=AF=BC=E8=BF=9B=E8=B7=AF?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cbtc/CI/device/CiRouteService.java | 43 +++++++++++++++---- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiRouteService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiRouteService.java index 4603e6afc..727b8f52c 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiRouteService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiRouteService.java @@ -30,6 +30,7 @@ public class CiRouteService { /** * 进路排列检查 + * * @param simulation * @param route * @return @@ -174,22 +175,35 @@ public class CiRouteService { /** * 排列引导进路 + * * @param simulation * @param route */ public void setGuide(Simulation simulation, Route route) { - // 引导进路开始办理 - LocalDateTime systemTime = simulation.getSystemTime(); - route.startGuideSetting(systemTime); - // 道岔征用 - for (SwitchElement switchElement : route.getSwitchList()) { - switchElement.getASwitch().ciUse(switchElement.isNormal()); + // 进路检查 + Route.CheckFailMessage failMessage = routeSetCheck(simulation, route); + if (failMessage == null) { + if (route.isLock() && !route.isFleetMode()) { + log.info("进路[{}]已经锁闭", route.debugStr()); + return; + } + // 引导进路开始办理 + LocalDateTime systemTime = simulation.getSystemTime(); + route.startGuideSetting(systemTime); + // 道岔征用 + for (SwitchElement switchElement : route.getSwitchList()) { + switchElement.getASwitch().ciUse(switchElement.isNormal()); + } + simulation.getRepository().addSettingRoute(route); + } + if (Objects.nonNull(failMessage)) { + log.info(String.format("进路[%s]排列检查失败,无法排列:%s", route.debugStr(), failMessage.debugStr())); } - simulation.getRepository().addSettingRoute(route); } /** * 排列进路 + * * @param simulation * @param route * @return @@ -220,6 +234,7 @@ public class CiRouteService { /** * 排列进路过程控制 + * * @param simulation * @param route */ @@ -295,6 +310,7 @@ public class CiRouteService { /** * 检查并锁闭主进路(不包含侧防和延续保护) + * * @param route */ private void checkAndLockRouteMain(Route route) { @@ -319,6 +335,7 @@ public class CiRouteService { /** * 解锁进路 + * * @param simulation * @param route */ @@ -380,6 +397,7 @@ public class CiRouteService { /** * 延时解锁进路 + * * @param simulation * @param route */ @@ -416,6 +434,7 @@ public class CiRouteService { /** * 道岔区段故障解锁 + * * @param simulation * @param aSwitch * @param route @@ -460,6 +479,7 @@ public class CiRouteService { /** * 列车逐段解锁进路 + * * @param simulation * @param route */ @@ -495,7 +515,7 @@ public class CiRouteService { if (!logic.isOccupied() && /*!logic.isInvalid() &&*/ logic.isRouteLockOn(right)) { logic.routeUnlocking(route); logic.overlapUnlocking(); - } else if(logic.isOccupied() /*|| logic.isInvalid()*/) { + } else if (logic.isOccupied() /*|| logic.isInvalid()*/) { break; } } @@ -523,7 +543,7 @@ public class CiRouteService { } if (relSwitch.isLinkedSwitch(aSwitch) || relSwitch.isBConnectTo(aSwitch)) { // if (!aSwitch.getA().isRouteLock()) { //当两条进路锁闭同一个道岔时,一条进路解锁,道岔的A区段可能仍旧被另一条进路锁闭着,导致无法解锁,故去掉此判断 - aSwitch.routeUnlock(route); + aSwitch.routeUnlock(route); // aSwitch.overlapUnLock(); //应该不需要,暂时注掉 // } } @@ -564,6 +584,7 @@ public class CiRouteService { /** * 延续保护办理 + * * @param simulation * @param overlap */ @@ -589,6 +610,7 @@ public class CiRouteService { /** * 延续保护办理过程 + * * @param simulation * @param overlap */ @@ -666,6 +688,7 @@ public class CiRouteService { /** * 取消自动进路 + * * @param route */ public void cancelFleet(Route route) { @@ -676,6 +699,7 @@ public class CiRouteService { /** * 设置联锁自动触发 + * * @param route */ public void setCIAutoTrigger(Route route) { @@ -690,6 +714,7 @@ public class CiRouteService { /** * 取消联锁自动触发 + * * @param route */ public void cancelCIAutoTrigger(Route route) {