From 6c5da045f73ae1affbad7362ca3a5f088420dcf1 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Mon, 29 Nov 2021 17:30:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9E=E9=94=81=E9=87=8D=E5=90=AF=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E4=BA=A4=E5=87=BA=E8=BD=A6=E7=AB=99=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cbtc/ATS/service/AtsStationService.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsStationService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsStationService.java index 4445c4c66..fe30dbd91 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsStationService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsStationService.java @@ -516,12 +516,15 @@ public class AtsStationService { station.setRestartTime(LocalTime.now()); Station.Fault.INTERLOCK_FAULT.fix(station); //恢复联锁机故障 SimulationDataRepository repository = simulation.getRepository(); - for (StatusDevice value : station.getDeviceMap().values()) { - if (value instanceof Section) { //联锁区所有区段故障锁闭 - Section section = (Section) value; - section.recursivelySetFaultLock(true); - } else if (value instanceof Station) { //联锁区所有车站交出控制权 - Station station1 = (Station) value; + //该站范围内区段故障锁闭 + station.getDeviceMap().values().stream() + .filter(v -> v instanceof Section) + .map(v -> (Section) v) + .forEach(section -> section.recursivelySetFaultLock(true)); + //车站交出控制权 + station.setControlMode(Station.ControlMode.None); + for (Station station1 : repository.getStationList()) { + if (Objects.equals(station, station1.getDeviceStation())) { station1.setControlMode(Station.ControlMode.None); } }