NCC报警道岔失表故障改为汉字

This commit is contained in:
joylink_zhangsai 2023-05-24 18:24:27 +08:00
parent c6b74613dc
commit 5ef51cbe56

View File

@ -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<StationPlan> 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 "其它原因";