From 91ad31582581c54bff2243c0f7a3d0470e0a1e6b Mon Sep 17 00:00:00 2001 From: weizhihong Date: Wed, 19 Apr 2023 17:21:35 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E6=94=B9=E6=96=B9?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=8A=AC=E8=B5=B7=E9=AA=8C=E8=AF=81=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assist/StationDirectionService.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/assist/StationDirectionService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/assist/StationDirectionService.java index 39b1e78e6..7d1d6e618 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/assist/StationDirectionService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/assist/StationDirectionService.java @@ -73,6 +73,26 @@ public class StationDirectionService { } }; + /** + * 改方按钮抬起验证 + */ + private final ButtonValidInterface turnDirectionPressUpValid = (simulation, stationDirection) -> { + // 原接车站无发车进路锁闭 + boolean isDeliverConflict = stationDirection.getDeliverRouteList().stream().anyMatch(Route::isLock); + if (isDeliverConflict) { + throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:存在发车进路"); + } + // 原发车站无发车进路锁闭 + StationDirection relativeDirection = getRelativeStationDirection(simulation, stationDirection); + boolean isReceiverConflict = relativeDirection != null; + if (isReceiverConflict) { + isReceiverConflict = relativeDirection.getReceiveRouteList().stream().anyMatch(Route::isLock); + } + if (isReceiverConflict) { + throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:相对方向存在接车进路"); + } + }; + /** * 总辅助校验 */ @@ -311,6 +331,8 @@ public class StationDirectionService { this.operationButtonValidMap = new HashMap<>(); // 改方按下验证函数 this.operationButtonValidMap.put(Operation.Type.ASSIST_PRESS_DOWN_TURN_DIRECTION, this.turnDirectionPressDownValid); + // 改方抬起验证函数 + this.operationButtonValidMap.put(Operation.Type.ASSIST_PRESS_UP_TURN_DIRECTION, this.turnDirectionPressUpValid); // 总辅助按下验证函数 this.operationButtonValidMap.put(Operation.Type.ASSIST_PRESS_MAIN_ASSIST, this.turnAssistValid); // 接辅助按下验证函数