From 5ef51cbe562e3a395520065c0f695fbe7cd9d7cc Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Wed, 24 May 2023 18:24:27 +0800 Subject: [PATCH] =?UTF-8?q?NCC=E6=8A=A5=E8=AD=A6=E9=81=93=E5=B2=94?= =?UTF-8?q?=E5=A4=B1=E8=A1=A8=E6=95=85=E9=9A=9C=E6=94=B9=E4=B8=BA=E6=B1=89?= =?UTF-8?q?=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ATS/service/alarm/NccAlarmService.java | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/alarm/NccAlarmService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/alarm/NccAlarmService.java index 368e049e5..639437cb3 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/alarm/NccAlarmService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/alarm/NccAlarmService.java @@ -6,6 +6,7 @@ import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository; import club.joylink.rtss.simulation.cbtc.data.map.MayOutOfOrderDevice; import club.joylink.rtss.simulation.cbtc.data.map.Section; import club.joylink.rtss.simulation.cbtc.data.map.Station; +import club.joylink.rtss.simulation.cbtc.data.map.Switch.SwitchFault; import club.joylink.rtss.simulation.cbtc.data.plan.StationPlan; import club.joylink.rtss.simulation.cbtc.data.plan.TripPlan; import club.joylink.rtss.simulation.cbtc.data.vo.TrainInfo; @@ -44,9 +45,9 @@ public class NccAlarmService { LocalDateTime correctSystemDateTime = simulation.getCorrectSystemTime(); LocalTime systemTime = simulation.getSystemTime().toLocalTime(); for (TrainInfo trainInfo : repository.getSuperviseTrainList()) { - if (!trainInfo.isPlanTrain()) { - continue; - } + if (!trainInfo.isPlanTrain()) { + continue; + } //查找车次计划的一个未完成车站计划 String groupNumber = trainInfo.getGroupNumber(); TripPlan tripPlan = repository.getTripPlan(trainInfo.getServiceNumber(), @@ -54,13 +55,13 @@ public class NccAlarmService { Optional stationPlanOptional = tripPlan.queryFirstUnfinishedStationPlan(); StationPlan stationPlan = stationPlanOptional.orElse(null); //满足条件则无需监测 - if (stationPlan == null) { - continue; - } + if (stationPlan == null) { + continue; + } int delay = trainDelayMonitoring.computeIfAbsent(groupNumber, k -> 2); - if (delay == -1) { - continue; - } + if (delay == -1) { + continue; + } //延误监测 if (systemTime.isAfter(stationPlan.getArriveTime())) { String color; @@ -76,9 +77,11 @@ public class NccAlarmService { case 10: color = AtsAlarm.Xian3Color.ORANGE; trainDelayMonitoring.put(groupNumber, -1); - Section fromStandTrack = repository.findByCode(trainInfo.getActualLeaveStandTrack(), Section.class); + Section fromStandTrack = repository.findByCode(trainInfo.getActualLeaveStandTrack(), + Section.class); Station fromStation = fromStandTrack == null ? null : fromStandTrack.getStation(); - Section toStandTrack = repository.findByCode(trainInfo.getEstimatedArriveStandTrack(), Section.class); + Section toStandTrack = repository.findByCode(trainInfo.getEstimatedArriveStandTrack(), + Section.class); Station toStation = toStandTrack == null ? null : toStandTrack.getStation(); pisTemplate = String.format("[%s]至[%s]区段列车稍有延误", fromStation == null ? "未知" : fromStation.getName(), @@ -126,8 +129,11 @@ public class NccAlarmService { AtsAlarm atsAlarm = deviceFaultAlarm.get(); MayOutOfOrderDevice device = repository.getByCode(atsAlarm.getDeviceCode(), MayOutOfOrderDevice.class); - return String.format("%s(%s):%s", device.getDeviceType().getName(), device.getCode(), - device.getFault().toString()); + String fault = device.getFault().toString(); + if (SwitchFault.SPLIT.name().equals(fault)) { + fault = "失表"; + } + return String.format("%s(%s):%s", device.getDeviceType().getName(), device.getCode(), fault); } } return "其它原因";