From 17edb388d8d7a3161452ed958817cd7b8b2ccb8e Mon Sep 17 00:00:00 2001 From: weizhihong Date: Thu, 21 Apr 2022 11:06:11 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E8=BD=A6=E7=AB=99?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=8C=87=E7=A4=BA=E7=81=AF=E5=88=97=E8=A1=A8?= =?UTF-8?q?BUG=E3=80=91=20=E3=80=90=E5=A2=9E=E5=8A=A0=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=9E=9A=E4=B8=BE=E7=B1=BB=E5=9E=8B=E3=80=91=20=E3=80=90?= =?UTF-8?q?=E6=8C=87=E7=A4=BA=E7=81=AF=E3=80=81=E6=8C=89=E9=92=AE=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E7=B1=BB=E5=9E=8B=E7=AD=9B=E9=80=89=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: weizhihong --- .../cbtc/build/MapDeviceBuilder.java | 27 ++-- .../simulation/cbtc/data/map/Station.java | 135 +++++++++--------- .../vo/map/graph/MapIndicatorLightVO.java | 7 +- .../rtss/vo/map/graph/MapSignalButtonVO.java | 23 ++- 4 files changed, 110 insertions(+), 82 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/build/MapDeviceBuilder.java b/src/main/java/club/joylink/rtss/simulation/cbtc/build/MapDeviceBuilder.java index 6f0b350ab..0cb4bf267 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/build/MapDeviceBuilder.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/build/MapDeviceBuilder.java @@ -1,7 +1,6 @@ package club.joylink.rtss.simulation.cbtc.build; import club.joylink.rtss.constants.BusinessConsts; -import club.joylink.rtss.constants.DirectionLabelEnum; import club.joylink.rtss.exception.BusinessExceptionAssertEnum; import club.joylink.rtss.simulation.cbtc.constant.SignalModel; import club.joylink.rtss.simulation.cbtc.data.map.*; @@ -1517,14 +1516,14 @@ public class MapDeviceBuilder { */ private static void buildAssistIndicator(Map elementMap , List errMsgList, List indicatorList) { + // 区间占用\辅助状态\总辅助\发车辅助\接车辅助\接发车箭头\复原\事故\闭塞 + List indicatorTypeList = Arrays.asList( + "SectionOccupied", "AssistStatus", "TotalAssist", "DepartAssist", "PickAssist", "PickOrDepartArrow", + "Recovery", "Accident", "Occlusion" + ); indicatorList .stream() - .filter(mapIndicatorLightVO -> - Arrays.stream(DirectionLabelEnum.values()) - .filter(e -> e.equals(mapIndicatorLightVO.getLabelEnum())) - .findAny() - .isPresent() - ) + .filter(mapIndicatorLightVO -> indicatorTypeList.contains(mapIndicatorLightVO.getType())) .forEach(mapSignalButtonVO -> { if (elementMap.containsKey(mapSignalButtonVO.getCode())) { errMsgList.add(String.format("指示灯[%s]必须唯一", mapSignalButtonVO.getCode())); @@ -1547,14 +1546,16 @@ public class MapDeviceBuilder { */ private static void buildAssistButton(Map elementMap , List errMsgList, List signalButtonList) { + // 总、接、发、改方 + List buttonTypeList = Arrays.asList( + MapSignalButtonVO.Type.ASSIST, + MapSignalButtonVO.Type.PICK_ASSIST, + MapSignalButtonVO.Type.DEPART_ASSIST, + MapSignalButtonVO.Type.CHANGE_DIRECTION + ); signalButtonList .stream() - .filter(mapSignalButtonVO -> - Arrays.stream(DirectionLabelEnum.values()) - .filter(e -> e.equals(mapSignalButtonVO.getLabelEnum())) - .findAny() - .isPresent() - ) + .filter(mapSignalButtonVO -> buttonTypeList.contains(mapSignalButtonVO.getType())) .forEach(mapSignalButtonVO -> { if (elementMap.containsKey(mapSignalButtonVO.getCode())) { errMsgList.add(String.format("按钮[%s]必须唯一", mapSignalButtonVO.getCode())); 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 1de1c5ace..27fd23dd7 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 @@ -23,11 +23,11 @@ import java.util.stream.Collectors; public class Station extends MayOutOfOrderDevice { public Station(String code, String name) { super(code, name, DeviceType.STATION); - this.transferList = new ArrayList<>(); - this.turnBackList = new ArrayList<>(); - this.rdStandList = new ArrayList<>(); - this.ldStandList = new ArrayList<>(); - this.controlMode = ControlMode.Center; + transferList = new ArrayList<>(); + turnBackList = new ArrayList<>(); + rdStandList = new ArrayList<>(); + ldStandList = new ArrayList<>(); + controlMode = ControlMode.Center; } /** @@ -183,52 +183,52 @@ public class Station extends MayOutOfOrderDevice { /** * 按钮列表 */ - private List