From 4dcf64d9fff2c665f7b57c644aaee9a5bc31ed2d Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Tue, 2 Aug 2022 13:05:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E9=93=81=E5=BC=95=E5=AF=BC=E6=80=BB?= =?UTF-8?q?=E9=94=81=E5=A4=B1=E8=A1=A8=E9=81=93=E5=B2=94=EF=BC=8C=E5=8F=AF?= =?UTF-8?q?=E5=8A=9E=E7=90=86=E5=BC=95=E5=AF=BC=E8=BF=9B=E8=B7=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../simulation/cbtc/CI/CiApiServiceImpl2.java | 15 ++++++++++----- .../simulation/cbtc/CI/device/CiRouteService.java | 14 ++++++++------ .../cbtc/CI/device/CiSwitchControlService.java | 11 ++++------- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl2.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl2.java index 97ec19564..bf61ea0ca 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl2.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl2.java @@ -451,10 +451,15 @@ public class CiApiServiceImpl2 implements CiApiService { } else if (!CollectionUtils.isEmpty(signal.getRouteList())) { List collect; if (config.isRailway()) { // 大铁配置引导进路 - collect = getCtcGuideRouteList(repository, signal); - if (collect == null) { - return; - } +// collect = getCtcGuideRouteList(repository, signal); +// if (collect == null) { +// return; +// } + collect = signal.getRouteList().stream() + .filter(Route::isTrainRoute) + .collect(Collectors.toList()); + BusinessExceptionAssertEnum.OPERATION_FAIL.assertCollectionNotEmpty(collect, + signal.debugStr() + "无列车进路"); } else { //如果signal锁闭进路为null,筛选最合适的进路(直线进路>分叉进路>折返进路) collect = signal.getRouteList().stream() .filter(r -> !r.isTurnBack() && CollectionUtils.isEmpty(r.getSwitchList())) @@ -743,7 +748,7 @@ public class CiApiServiceImpl2 implements CiApiService { * @param signal 信号机 */ private List getCtcGuideRouteList(SimulationDataRepository repository, Signal signal) { - // 获取已信号机开头的进路集合 + // 获取以信号机开头的进路集合 List routeList = repository.getRouteList().stream() .filter(routePojo -> routePojo.isTrainRoute() && routePojo.getStart().getCode().equals(signal.getCode())) .collect(Collectors.toList()); 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 224b31bf4..44b1e0a67 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 @@ -246,11 +246,11 @@ public class CiRouteService { List multiRouteAspects = route.getMultiRouteAspects(); if (CollectionUtils.isEmpty(multiRouteAspects)) { // 道岔位置转换 - boolean mainRouteSwitchOnPos = this.switchControlService.batchTurnRouteSwitch(simulation, route.getSwitchList()); + boolean mainRouteSwitchOnPos = this.switchControlService.ensureSwitchPosCurrent(simulation, route.getSwitchList(), route.isGuideSetting()); // 预先锁闭 if (mainRouteSwitchOnPos || config.isLockFirst()) { // 进路排列区段预先锁闭 - this.checkAndLockRouteMain(route); + this.checkAndLockRouteMain(route, config.isRailway()); } // 侧防办理 this.flsSetting(simulation, route.getFlsList()); @@ -307,18 +307,20 @@ public class CiRouteService { * 检查并锁闭主进路(不包含侧防和延续保护) * * @param route + * @param railway */ - private void checkAndLockRouteMain(Route route) { + private void checkAndLockRouteMain(Route route, boolean railway) { boolean right = route.isRight(); List
sectionList = route.getSectionList(); List switchList = route.getSwitchList(); for (SwitchElement switchElement : switchList) { - if (switchElement.isOnPosition()) { + if (switchElement.isOnPosition() || (route.isGuideSetting() && switchElement.getASwitch().isGuideMasterLock())) { switchElement.getASwitch().routeLock(route); } } for (Section section : sectionList) { - if (section.isSwitchTrack()) { + //大铁引导进路只锁闭指定区段(为了解决引导总锁方式办理道岔失表的引导进路时,失表道岔的所有区段都锁闭的问题) + if (section.isSwitchTrack() && !(railway && route.isGuideSetting())) { Switch relSwitch = section.getRelSwitch(); relSwitch.sectionRouteLocking(route, right); } else { @@ -631,7 +633,7 @@ public class CiRouteService { } } // 延续保护位置转动 - boolean onPos = this.switchControlService.batchTurnRouteSwitch(simulation, sectionPath.getSwitchList()); + boolean onPos = this.switchControlService.ensureSwitchPosCurrent(simulation, sectionPath.getSwitchList(), false); // 延续保护区段预先锁闭 if (onPos || config.isLockFirst()) { this.checkAndLockOverlap(simulation, overlap); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiSwitchControlService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiSwitchControlService.java index 0dfa5ca5b..a39d8df72 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiSwitchControlService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiSwitchControlService.java @@ -158,18 +158,15 @@ public class CiSwitchControlService { /** * 批量转动道岔到指定位置 - * - * @param simulation - * @param list */ - public boolean batchTurnRouteSwitch(Simulation simulation, List list) { + public boolean ensureSwitchPosCurrent(Simulation simulation, List switchElements, boolean guideSetting) { boolean allOn = true; - if (list == null) { + if (switchElements == null) { return true; } - for (SwitchElement switchElement : list) { + for (SwitchElement switchElement : switchElements) { boolean onPos = this.turnRouteSwitch(simulation, switchElement); - if (!onPos) { + if (!onPos && !(guideSetting && switchElement.getASwitch().isLoss() && switchElement.getASwitch().isGuideMasterLock())) { //不在正确位置并且不是办理引导进路中的引导总锁的失表道岔 allOn = false; } }