From 202e0bb01f5340cdd4bf1bac18b9400e3eb0d038 Mon Sep 17 00:00:00 2001 From: walker-sheng Date: Mon, 1 Feb 2021 13:53:35 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=BF=9B=E8=B7=AF=E9=80=BB=E8=BE=91bug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cbtc/CI/service/RouteService.java | 44 ++++++++++--------- 1 file changed, 24 insertions(+), 20 deletions(-) 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 4d5b0fa56..283d94616 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 @@ -390,27 +390,24 @@ public class RouteService { log.debug(section.debugStr() + "因<预先锁闭>锁闭"); } } - if (!route.isRequisition()) { - // 征用设备 - // 道岔位置转换 - List switchList = route.getSwitchList(); - this.routeSwitchTurn(simulation, switchList); - this.routeFlsControl(simulation, route.getFlsList()); - if (config.isLockFirst()) { - for (SwitchElement switchElement : switchList) { - switchElement.getASwitch().routeLock(); - } - if (!CollectionUtils.isEmpty(route.getFlsList())) { - for (RouteFls routeFls : route.getFlsList()) { - routeFls.lock(); - } + // 征用设备 + // 道岔位置转换 + List switchList = route.getSwitchList(); + this.routeSwitchTurn(simulation, switchList); + this.routeFlsControl(simulation, route.getFlsList()); + if (config.isLockFirst()) { + for (SwitchElement switchElement : switchList) { + switchElement.getASwitch().routeLock(); + } + if (!CollectionUtils.isEmpty(route.getFlsList())) { + for (RouteFls routeFls : route.getFlsList()) { + routeFls.lock(); } } - route.updateRequisition(true); - return; } // 设备已征用,检查进路条件 - boolean onPosition = this.checkSwitchPosition(simulation, route); + boolean onPosition = this.checkSwitchPosition(simulation, route) && + this.isFlsSwitchOnPosition(route.getFlsList()); if (!onPosition) { // 还未转换到位置 return; } @@ -1234,9 +1231,16 @@ public class RouteService { boolean interlocked = this.isInterlocked(route); if (!interlocked) { // 进路信号开放,联锁逻辑不满足,需关闭信号 - this.routeClose(simulation, route); - log.info(String.format("进路[%s]始端信号联锁条件不满足,信号机[%s(%s)]关灯", - route.debugStr(), route.getStart().getName(), route.getStart().getCode())); + if (route.isOpen()) { + this.routeClose(simulation, route); + log.info(String.format("进路[%s]始端信号联锁条件不满足,信号机[%s(%s)]关灯", + route.debugStr(), route.getStart().getName(), route.getStart().getCode())); + } + } + if (route.isOpen()) { + if (this.checkCanOverlapSet(simulation, route) && !route.getOverlap().isLock()) { + this.checkAndSetLockedRouteOverlap(simulation, route); + } } } From 44965d8054c1eb030c8a4dff6dbade327d1d13bc Mon Sep 17 00:00:00 2001 From: walker-sheng Date: Mon, 1 Feb 2021 13:57:32 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=9B=E8=B7=AF?= =?UTF-8?q?=E5=8A=9E=E7=90=86=E8=B6=85=E6=97=B6=E5=A4=B1=E8=B4=A5=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E4=B8=BA20=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rtss/simulation/cbtc/CI/service/RouteService.java | 5 +++-- .../rtss/simulation/cbtc/constant/SimulationConstants.java | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) 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 283d94616..b6f803a34 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 @@ -1,6 +1,7 @@ package club.joylink.rtss.simulation.cbtc.CI.service; import club.joylink.rtss.simulation.cbtc.Simulation; +import club.joylink.rtss.simulation.cbtc.constant.SimulationConstants; import club.joylink.rtss.simulation.cbtc.constant.SimulationModule; import club.joylink.rtss.simulation.cbtc.data.map.*; import club.joylink.rtss.simulation.cbtc.data.support.TrainStopMessage; @@ -355,7 +356,7 @@ public class RouteService { if (Objects.isNull(route.getSettingStartTime())) {//旧数据兼容逻辑 route.setSettingStartTime(simulation.getSystemTime()); } - if (simulation.getSystemTime().isAfter(route.getSettingStartTime().plusSeconds(10))) { + if (simulation.getSystemTime().isAfter(route.getSettingStartTime().plusSeconds(SimulationConstants.ROUTE_SETTING_TIMEOUT))) { route.settingFailed(); simulation.getRepository().removeSettingRoute(route); route.setLock(false); @@ -476,7 +477,7 @@ public class RouteService { } MapConfig config = simulation.getRepository().getConfig(); if (!config.isRouteSettingNoFail()) { - if (simulation.getSystemTime().isAfter(overlap.getSettingStartTime().plusSeconds(10))) { + if (simulation.getSystemTime().isAfter(overlap.getSettingStartTime().plusSeconds(SimulationConstants.ROUTE_SETTING_TIMEOUT))) { overlap.settingFailed(); log.info(String.format("进路延续保护[%s]办理失败", overlap.debugStr())); return; diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/constant/SimulationConstants.java b/src/main/java/club/joylink/rtss/simulation/cbtc/constant/SimulationConstants.java index c09869c9e..de3b93735 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/constant/SimulationConstants.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/constant/SimulationConstants.java @@ -97,6 +97,11 @@ public interface SimulationConstants { */ int ATO_TRAIN_GET_SIGNAL_TO_START_DELAY = 6 * 1000; + /** + * 进路办理超时失败时间,单位秒 + */ + int ROUTE_SETTING_TIMEOUT = 20; + /** * 获取仿真运行计划日期(运营日) * @return