From 76fe31d729ab39b11302e5e120b1cce7ce3a9e2d Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Wed, 11 May 2022 16:40:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E7=AB=99=E4=B8=8A=E7=9A=84=E5=BC=95?= =?UTF-8?q?=E5=AF=BC=E6=80=BB=E9=94=81=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rtss/simulation/cbtc/build/InterlockBuilder2.java | 11 ++++++----- .../rtss/simulation/cbtc/data/map/Station.java | 2 ++ .../simulation/cbtc/data/status/StationStatus.java | 2 ++ .../rtss/simulation/cbtc/data/vo/StationStatusVO.java | 4 +++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/build/InterlockBuilder2.java b/src/main/java/club/joylink/rtss/simulation/cbtc/build/InterlockBuilder2.java index 8324402b2..980efaf72 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/build/InterlockBuilder2.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/build/InterlockBuilder2.java @@ -31,6 +31,8 @@ public class InterlockBuilder2 { MapLogicDataNewVO logicData = map.getLogicDataNew(); MapGraphDataNewVO graphData = map.getGraphDataNew(); + MapCiGenerateConfig generateConfig = graphData.getGenerateConfig(); + Map elementMap = mapDataBuildResult.getDeviceMap(); List errMsgList = mapDataBuildResult.getErrMsgList(); // ------------侧防start------------- @@ -47,8 +49,7 @@ public class InterlockBuilder2 { // 接近区段 InterlockBuilder2.buildApproachSections(logicData, elementMap, errMsgList); // ------------进路start------------- - List routeList = logicData.getRouteList(); - if (!CollectionUtils.isEmpty(routeList) && !CollectionUtils.isEmpty(routeList.get(0).getBtnCodeList())) { + if (generateConfig != null && generateConfig.isRailway()) { InterlockBuilder2.buildRailRoute(graphData, logicData, elementMap, errMsgList, flsMap); } else { InterlockBuilder2.buildRoute(logicData, elementMap, errMsgList, flsMap); @@ -88,7 +89,7 @@ public class InterlockBuilder2 { // if (!errMsgList.isEmpty()) { // return; // } - InterlockBuilder2.buildRoutePathFromStationRunLevel(map.getLineCode(), stationRunLevelList, mapDataBuildResult, errMsgList); + InterlockBuilder2.buildRoutePathFromStationRunLevel(generateConfig, stationRunLevelList, mapDataBuildResult, errMsgList); // buildParkTimes(logicData, elementMap, mapDataBuildResult.getParkTimeMap(), errMsgList); } @@ -1095,12 +1096,12 @@ public class InterlockBuilder2 { return stationRunLevelList; } - private static void buildRoutePathFromStationRunLevel(String lineCode, List stationRunLevelList, + private static void buildRoutePathFromStationRunLevel(MapCiGenerateConfig generateConfig, List stationRunLevelList, SimulationBuilder.SimulationDeviceBuildResult buildResult, List errMsgList) { Map> routePathMap = buildResult.getRoutePathMap(); Map deviceMap = buildResult.getDeviceMap(); - if (lineCode.equals("16")) { + if (generateConfig != null && generateConfig.isRailway()) { List
sections = deviceMap.values().stream() .filter(device -> device instanceof Section) .map(device -> (Section) device) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Station.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Station.java index d9266fb10..a0b87d355 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Station.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Station.java @@ -214,6 +214,8 @@ public class Station extends MayOutOfOrderDevice { emergencyController = false; controlApplicant = null; preResetValidDuration = new AtomicInteger(0); + sGuideMasterLock = false; + xGuideMasterLock = false; } public List getStandOf(boolean right) { diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/StationStatus.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/StationStatus.java index 99a1c9edb..92b365002 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/StationStatus.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/StationStatus.java @@ -194,6 +194,8 @@ public class StationStatus extends DeviceStatus { statusVO.setControlApplicant(controlApplicant); statusVO.setPreResetValidDuration(preResetValidDuration); statusVO.setInterlockMachineStarting(interlockMachineStarting); + statusVO.setSGuideMasterLock(sGuideMasterLock); + statusVO.setXGuideMasterLock(xGuideMasterLock); return statusVO; } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/StationStatusVO.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/StationStatusVO.java index b270a0210..93c18b616 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/StationStatusVO.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/StationStatusVO.java @@ -79,9 +79,11 @@ public class StationStatusVO extends DeviceStatusVO { @JsonSerialize(using = Boolean2NumSerializer.class) private Boolean interlockMachineStarting; + @JsonSerialize(using = Boolean2NumSerializer.class) private Boolean sGuideMasterLock; - private Boolean XGuideMasterLock; + @JsonSerialize(using = Boolean2NumSerializer.class) + private Boolean xGuideMasterLock; public StationStatusVO(Station station) { super(station.getCode(), station.getDeviceType());