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