diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/assist/AssistService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/assist/AssistService.java index e97c43cfa..c3d674539 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/assist/AssistService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/assist/AssistService.java @@ -100,9 +100,10 @@ public class AssistService { Indicator deliverIndicator = getStationIndicatorByType(curStation, labelEnum, IndicatorTypeEnum.DELIVER); // 如果都没有亮 if (deliverIndicator != null && receiveIndicator != null && !deliverIndicator.isOn() && !receiveIndicator.isOn()) { + // X、S方向为接车方向默认亮起 if (DirectionLabelEnum.X.equals(labelEnum) || DirectionLabelEnum.S.equals(labelEnum)) { receiveIndicator.setOn(true); - } else { + } else { // 其他方向默认发车灯亮起 deliverIndicator.setOn(true); } } @@ -116,7 +117,6 @@ public class AssistService { } } - /** * 改方按钮按下校验 */ @@ -124,6 +124,9 @@ public class AssistService { if (button == null) { throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:按钮不存在"); } + if (button.getStand() == null) { + throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:按钮未绑定站台"); + } // 由数据控制,不做逻辑判断 // List stationList = simulation.getRepository().getStationList(); // // 当前站位置 @@ -135,12 +138,12 @@ public class AssistService { // 获取区间指示灯 Indicator sectionIndicator = getStationIndicatorByType(button.getStation(), button.getLabel(), IndicatorTypeEnum.SECTION); // 获取区间路径,判断本站台与相邻站台是否空闲 - if (IndicatorStatusEnum.R.equals(sectionIndicator.getAspect())) { + if (sectionIndicator != null && IndicatorStatusEnum.R.equals(sectionIndicator.getAspect())) { throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:区段非空闲"); } // 判断接车灯进路是否办理 Indicator receiveIndicator = getStationIndicatorByType(button.getStation(), button.getLabel(), IndicatorTypeEnum.RECEIVE); - if (receiveIndicator.getRoute().isLock()) { + if (receiveIndicator != null && receiveIndicator.getRoute() != null && receiveIndicator.getRoute().isLock()) { throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:进路冲突"); } // 获取靠停列车