From 39ab1f9c0b19ef4d1971315440feeff7f9fe3ffb Mon Sep 17 00:00:00 2001 From: thesai <1021828630@qq.com> Date: Thu, 25 Nov 2021 10:05:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=97=E4=BA=AC=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/StationGeneratorNew.java | 27 ++++++-- .../cbtc/ATS/operation/Operation.java | 4 ++ .../handler/FaultOperateHandler.java | 10 +++ .../handler/ServerOperateHandle.java | 22 ++++++ .../operation/service/ServerFaultService.java | 68 +++++++++++++++++++ .../cbtc/ATS/service/AtsStationService.java | 12 +++- .../simulation/cbtc/CI/CiApiServiceImpl2.java | 20 +++++- .../CI/device/CiDeviceStatusCollector.java | 2 +- .../simulation/cbtc/CI/device/CiService.java | 7 +- .../cbtc/build/MapDeviceBuilder.java | 3 + .../cbtc/data/SimulationDataRepository.java | 7 ++ .../simulation/cbtc/data/map/MapElement.java | 2 + .../cbtc/data/map/MayOutOfOrderDevice.java | 7 +- .../simulation/cbtc/data/map/Section.java | 60 +++++++++++++++- .../rtss/simulation/cbtc/data/map/Server.java | 21 ++++++ .../rtss/simulation/cbtc/data/map/Signal.java | 14 +++- .../simulation/cbtc/data/map/Station.java | 4 +- .../cbtc/data/map/StatusDevice.java | 12 ++++ .../rtss/simulation/cbtc/data/map/Switch.java | 50 ++++++++++++++ .../cbtc/data/status/PSDStatus.java | 9 +++ .../cbtc/data/status/SectionStatus.java | 21 ++++++ .../cbtc/data/status/SignalStatus.java | 10 +++ .../cbtc/data/status/StandStatus.java | 10 +++ .../cbtc/data/status/StationStatus.java | 9 +++ .../cbtc/data/status/SwitchStatus.java | 11 +++ .../simulation/cbtc/data/vo/PSDStatusVO.java | 3 + .../cbtc/data/vo/SectionStatusVO.java | 5 ++ .../cbtc/data/vo/SignalStatusVO.java | 3 + .../cbtc/data/vo/StandStatusVO.java | 3 + .../cbtc/data/vo/StationStatusVO.java | 2 + .../cbtc/data/vo/SwitchStatusVO.java | 11 +++ .../cbtc/data/vr/VirtualRealityTrain.java | 7 +- 32 files changed, 435 insertions(+), 21 deletions(-) create mode 100644 src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/ServerOperateHandle.java create mode 100644 src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/service/ServerFaultService.java create mode 100644 src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Server.java diff --git a/src/main/java/club/joylink/rtss/services/training/generatornew/base/StationGeneratorNew.java b/src/main/java/club/joylink/rtss/services/training/generatornew/base/StationGeneratorNew.java index eb1394437..bc5e7a8a3 100644 --- a/src/main/java/club/joylink/rtss/services/training/generatornew/base/StationGeneratorNew.java +++ b/src/main/java/club/joylink/rtss/services/training/generatornew/base/StationGeneratorNew.java @@ -5,9 +5,11 @@ import club.joylink.rtss.constants.MapPrdTypeEnum; import club.joylink.rtss.services.training.data.GenerateConfig; import club.joylink.rtss.services.training.generatornew.GeneratorNew; import club.joylink.rtss.services.training.generatornew.annotation.GeneratorSelectorNew; +import club.joylink.rtss.simulation.cbtc.ATS.operation.AtsOperationDispatcher; import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.data.map.*; +import club.joylink.rtss.simulation.cbtc.member.SimulationMember; import club.joylink.rtss.simulation.cbtc.tool.DeviceStatusModifyTool; import club.joylink.rtss.vo.client.training.TrainingNewVO; import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO; @@ -15,15 +17,17 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import java.time.LocalTime; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; +import java.util.*; import java.util.stream.Collectors; @GeneratorSelectorNew(operateObject = Operation.Object.Station) public class StationGeneratorNew implements GeneratorNew { @Autowired private DeviceStatusModifyTool deviceStatusModifyTool; + + @Autowired + private AtsOperationDispatcher atsOperationDispatcher; + @Override public List generate(GenerateConfig config, Simulation simulation, OperateDefinitionVO operateDefinitionVO) { List trainingVOList = new ArrayList<>(); @@ -238,7 +242,7 @@ public class StationGeneratorNew implements GeneratorNew { } } break; - case Station_Restart: + case Station_Restart: { if(!station.isInterlock())continue; if (BusinessConsts.MapPrd.PrdType.Type01.equals(config.getPrdType())) { if(station.isCentralized()) { @@ -247,12 +251,23 @@ public class StationGeneratorNew implements GeneratorNew { station.getDeviceStation().setControlMode(Station.ControlMode.Local); } } + SimulationMember member = new SimulationMember("", SimulationMember.Type.DISPATCHER, null); + String operate = Operation.Type.Station_Restart_Interlock_Machine.name(); + Map param = new HashMap<>(); + param.put("stationCode", station.getCode()); + atsOperationDispatcher.execute(simulation, member, operate, param); station.setInterlockMachineStarting(true); break; - case Station_Release: + } + case Station_Release: { if(!station.isInterlock())continue; - Station.Fault.INTERLOCK_FAULT.apply(station); + SimulationMember member = new SimulationMember("", SimulationMember.Type.DISPATCHER, null); + String operate = Operation.Type.Server_ATP_Restart.name(); + Map param = new HashMap<>(); + atsOperationDispatcher.execute(simulation, member, operate, param); + station.setInterlockMachineStarting(true); break; + } default: // 其他操作,不生成 continue; diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java index bbf817877..a735f71da 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java @@ -431,6 +431,10 @@ public class Operation { RunPlan_Add_Trip, /** 删除计划 */ RunPlan_Delete_Trip, + + //--------------------------- 服务器 --------------------------- + /** ATP系统重启 */ + Server_ATP_Restart } /**操作对象枚举*/ diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/FaultOperateHandler.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/FaultOperateHandler.java index b8c56d947..864c18451 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/FaultOperateHandler.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/FaultOperateHandler.java @@ -43,6 +43,9 @@ public class FaultOperateHandler { @Autowired private StationFaultService stationFaultService; + @Autowired + private ServerFaultService serverFaultService; + /** * 设备设置故障 * @@ -155,6 +158,13 @@ public class FaultOperateHandler { } catenaryFaultService.fixFault(simulation, mayOutOfOrderDevice, param); return; + case SERVER: + if (isSet) { + serverFaultService.setFault(simulation, mayOutOfOrderDevice, param); + } else { + serverFaultService.fixFault(simulation, mayOutOfOrderDevice, param); + } + return; default: break; } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/ServerOperateHandle.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/ServerOperateHandle.java new file mode 100644 index 000000000..f89f06c73 --- /dev/null +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/ServerOperateHandle.java @@ -0,0 +1,22 @@ +package club.joylink.rtss.simulation.cbtc.ATS.operation.handler; + +import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation; +import club.joylink.rtss.simulation.cbtc.ATS.operation.annotation.OperateHandler; +import club.joylink.rtss.simulation.cbtc.ATS.operation.annotation.OperateHandlerMapping; +import club.joylink.rtss.simulation.cbtc.Simulation; +import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository; +import club.joylink.rtss.simulation.cbtc.data.map.Server; +import lombok.extern.slf4j.Slf4j; + +@Slf4j +@OperateHandler +public class ServerOperateHandle { + @OperateHandlerMapping(type = Operation.Type.Server_ATP_Restart) + public void atpRestart(Simulation simulation) { + SimulationDataRepository repository = simulation.getRepository(); + repository.getSectionList().forEach(section -> { + section.setSpeedLimitBeforeFault(section.getSpeedUpLimit()); + section.setSpeedUpLimit(5); + }); + } +} diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/service/ServerFaultService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/service/ServerFaultService.java new file mode 100644 index 000000000..5e09517a8 --- /dev/null +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/service/ServerFaultService.java @@ -0,0 +1,68 @@ +package club.joylink.rtss.simulation.cbtc.ATS.operation.service; + +import club.joylink.rtss.simulation.cbtc.ATS.operation.vo.FaultParam; +import club.joylink.rtss.simulation.cbtc.Simulation; +import club.joylink.rtss.simulation.cbtc.communication.vo.fault.DeviceFaultInfo; +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.Server; +import club.joylink.rtss.simulation.cbtc.data.map.Signal; +import club.joylink.rtss.simulation.cbtc.data.map.StatusDevice; +import club.joylink.rtss.simulation.cbtc.event.SimulationDeviceFaultOverEvent; +import club.joylink.rtss.simulation.cbtc.event.SimulationDeviceFaultSetEvent; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class ServerFaultService implements DeviceFaultService{ + @Autowired + private ApplicationContext applicationContext; + + @Override + public void setFault(Simulation simulation, MayOutOfOrderDevice device, FaultParam param) { + Server.Fault deviceFault = checkAndGetFault(param); + boolean apply = deviceFault.apply(device); + SimulationDataRepository repository = simulation.getRepository(); + switch (deviceFault) { + case ATP_FAULT: + repository.getSectionList().forEach(section -> { + section.setSpeedLimitBeforeFault(section.getSpeedUpLimit()); + section.setSpeedUpLimit(5); + }); + break; + case ATS_FAULT: + List statusDevices = repository.getStatusDevices(); + statusDevices.forEach(statusDevice -> statusDevice.setAtsNoStatus(true)); + break; + } + if (apply) { + this.applicationContext.publishEvent(new SimulationDeviceFaultSetEvent(this, + simulation, new DeviceFaultInfo(device.getCode(), device.getDeviceType(), deviceFault))); + } + } + + @Override + public void fixFault(Simulation simulation, MayOutOfOrderDevice device, FaultParam param) { + Server.Fault fault = checkAndGetFault(param); + fault.fix(device); + SimulationDataRepository repository = simulation.getRepository(); + switch (fault) { + case ATP_FAULT: + break; + case ATS_FAULT: + List statusDevices = repository.getStatusDevices(); + statusDevices.forEach(statusDevice -> statusDevice.setAtsNoStatus(false)); + break; + } + this.applicationContext.publishEvent(new SimulationDeviceFaultOverEvent(this, + simulation, new DeviceFaultInfo(device.getCode(), device.getDeviceType(), fault))); + } + + @Override + public Server.Fault checkAndGetFault(FaultParam param) { + return Server.Fault.valueOf(param.getFaultType()); + } +} 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 0ca9910e3..4445c4c66 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 @@ -514,7 +514,17 @@ public class AtsStationService { } station.setInterlockMachineStarting(true); station.setRestartTime(LocalTime.now()); - Station.Fault.INTERLOCK_FAULT.fix(station); + 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; + station1.setControlMode(Station.ControlMode.None); + } + } } public void openAutoSetting(Simulation simulation, String stationCode) { diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl2.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl2.java index 0ac4251bd..12537d6e9 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl2.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl2.java @@ -95,6 +95,12 @@ public class CiApiServiceImpl2 implements CiApiService { log.info(String.format("道岔[%s(%s)]锁闭,不能转动", aSwitch.getName(), aSwitch.getCode())); throw new SimulationException(SimulationExceptionType.Operation_Handle_FAIL, "道岔锁闭,不能进行定操"); } + if (Switch.SwitchFault.SPLIT_4.equals(aSwitch.getFault())) { + int times = aSwitch.getTurnTimes().incrementAndGet(); + if (times == 4) { + Switch.SwitchFault.SPLIT_4.fix(aSwitch); + } + } } @Override @@ -465,11 +471,21 @@ public class CiApiServiceImpl2 implements CiApiService { deviceStation = station.getDeviceStation(); } deviceStation.setInterlockMachineStarting(false); + SimulationDataRepository repository = simulation.getRepository(); + repository.getSectionList().forEach(section -> section.setFaultLock(false)); //所有区段取消故障锁闭 } @Override public void release(Simulation simulation, Station station) { - + for (Section section : simulation.getRepository().getSectionList()) { + Integer speedLimitBeforeFault = section.getSpeedLimitBeforeFault(); + if (speedLimitBeforeFault != null) { + section.setSpeedUpLimit(speedLimitBeforeFault); + section.setSpeedLimitBeforeFault(null); + } + } + Server server = simulation.getRepository().getByCode(Server.CODE, Server.class); + Server.Fault.ATP_FAULT.fix(server); } @Override @@ -521,7 +537,7 @@ public class CiApiServiceImpl2 implements CiApiService { BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(axleSection != null && axleSection.isAxleCounter(), section.debugStr() + "不是计轴区段也不归属于任何计轴区段"); VirtualRealitySectionAxleCounter virtualAxleCounter = axleSection.getVirtualAxleCounter(); - if (!virtualAxleCounter.isOccupy()){ + if (!virtualAxleCounter.isOccupy()) { VirtualRealitySectionAxleCounter.Fault.FAULT.apply(virtualAxleCounter); Section.AxleFault.ARB.apply(axleSection); } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiDeviceStatusCollector.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiDeviceStatusCollector.java index 05bba2654..c5aba0b24 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiDeviceStatusCollector.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiDeviceStatusCollector.java @@ -34,7 +34,7 @@ public class CiDeviceStatusCollector { private void collectPsd(SimulationDataRepository repository, List psdList) { for (PSD psd : psdList) { VirtualRealityScreenDoor vrPsd = psd.getVirtualScreenDoor(); - if (vrPsd != null) { + if (psd.isNoStatus() || vrPsd != null) { psd.apply(vrPsd.isClose(), vrPsd.isLock(), vrPsd.isInterlockRelease()); } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiService.java index 12084c0a2..27a672868 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiService.java @@ -164,6 +164,11 @@ public class CiService { } } level = Signal.LEVEL_Guide; // 引导级 + Signal signal = route.getStart(); + if (Signal.SignalFault.JZJTS.equals(signal.getFault()) + || (!signal.isCbtcMode() && Signal.SignalFault.LIGHTING_UNIT_FAULT_NAME.equals(signal.getFault())) + || (!signal.isCbtcMode() && Signal.SignalFault.LIGHTING_UNIT_FAULT_HEAD.equals(signal.getFault()))) + return level; // 进路侧防检查 List flsList = route.getFlsList(); if (!CollectionUtils.isEmpty(flsList)) { @@ -231,7 +236,7 @@ public class CiService { } } } - if (route.getStart().isCbtcMode()) { + if (signal.isCbtcMode()) { level = Signal.LEVEL_Atp; // ATP级 } // 区段占用检查 diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/build/MapDeviceBuilder.java b/src/main/java/club/joylink/rtss/simulation/cbtc/build/MapDeviceBuilder.java index 4dda6f50b..a0881fcff 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/build/MapDeviceBuilder.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/build/MapDeviceBuilder.java @@ -30,6 +30,9 @@ public class MapDeviceBuilder { Map elementMap = mapDataBuildResult.getDeviceMap(); Map deviceMap = mapDataBuildResult.getVrDeviceMap(); List errMsgList = mapDataBuildResult.getErrMsgList(); + // server + Server server = new Server(); + elementMap.put(server.getCode(), server); // ZC List zcList = graphData.getZcList(); zcList.forEach(mapZcVO -> { diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/SimulationDataRepository.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/SimulationDataRepository.java index 684bf8fd6..640b5a6cb 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/SimulationDataRepository.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/SimulationDataRepository.java @@ -1187,4 +1187,11 @@ public class SimulationDataRepository { .assertNotNull(vrPsl, String.format("%s无对应的vrPsl", vrPsd.debugStr())); return vrPsl; } + + public List getStatusDevices() { + return deviceMap.values().stream() + .filter(device -> device instanceof StatusDevice) + .map(device -> (StatusDevice) device) + .collect(Collectors.toList()); + } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/MapElement.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/MapElement.java index ed2d63c13..4668a1a54 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/MapElement.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/MapElement.java @@ -65,6 +65,8 @@ public abstract class MapElement { IBP, /** 就地控制盘 */ PSL, + /** 服务器 */ + SERVER, } /** 设备唯一编号 */ diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/MayOutOfOrderDevice.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/MayOutOfOrderDevice.java index dbf7eb5e7..997471a36 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/MayOutOfOrderDevice.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/MayOutOfOrderDevice.java @@ -41,7 +41,12 @@ public abstract class MayOutOfOrderDevice extends StatusDevice { @JsonSubTypes.Type(value = ZC.Fault.class, name = "ZC$Fault$1") }) public interface DeviceFault { - boolean apply(MayOutOfOrderDevice device); + default boolean apply(MayOutOfOrderDevice device) { + if (this.equals(device.getFault())) + return false; + device.setFault(this); + return true; + }; default void fix(MayOutOfOrderDevice device) { if (this.equals(device.fault)) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Section.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Section.java index 0ab5d176b..8637ac02f 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Section.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Section.java @@ -1,5 +1,6 @@ package club.joylink.rtss.simulation.cbtc.data.map; +import club.joylink.rtss.exception.BusinessExceptionAssertEnum; import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository; import club.joylink.rtss.simulation.cbtc.data.support.RoutePath; import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition; @@ -219,6 +220,11 @@ public class Section extends DelayUnlockDevice { */ private int speedUpLimit = -1; + /** + * ATP故障前的限速 + */ + private Integer speedLimitBeforeFault; + /** * 延时解锁 */ @@ -253,6 +259,7 @@ public class Section extends DelayUnlockDevice { this.invalid = false; this.faultLock = false; this.speedUpLimit = -1; + this.speedLimitBeforeFault = null; this.delayUnlock = false; this.closeInit = false; this.openInit = false; @@ -1085,6 +1092,13 @@ public class Section extends DelayUnlockDevice { } } + public Section getAxleCounterSection() { + Section axleSection = findAxleCounterSection(); + BusinessExceptionAssertEnum.DATA_ERROR.assertNotNull(axleSection, + this.debugStr() + "无归属计轴区段"); + return axleSection; + } + public boolean isAheadOf(SimulationDataRepository repository, Section other, boolean right) { List routePaths = repository.queryRoutePathsByEndAndContainsSection(this, other); if (CollectionUtils.isEmpty(routePaths)) @@ -1208,6 +1222,36 @@ public class Section extends DelayUnlockDevice { return null; } + @Override + public void loseStatus() { + setNoStatus(true); + if (!CollectionUtils.isEmpty(this.getLogicList())) { + for (Section section : this.getLogicList()) { + section.loseStatus(); + } + } + } + + @Override + public void restoreStatus() { + setNoStatus(false); + if (!CollectionUtils.isEmpty(this.getLogicList())) { + for (Section section : this.getLogicList()) { + section.restoreStatus(); + } + } + } + + /** + * 递归地设置故障锁闭 + */ + public void recursivelySetFaultLock(boolean faultLock) { + this.setFaultLock(faultLock); + if (!CollectionUtils.isEmpty(this.logicList)) { + logicList.forEach(section -> section.recursivelySetFaultLock(faultLock)); + } + } + public enum SectionRoadType { /** * 左行线 @@ -1270,17 +1314,27 @@ public class Section extends DelayUnlockDevice { }, /** - * 无法从真实设备采集状态(哈尔滨灰显)【可能没用了】 + * 无法从真实设备采集状态(哈尔滨灰显) */ UNABLE_COLLECT_STATUS { @Override public boolean apply(MayOutOfOrderDevice device) { Section section = (Section) device; - if (this.equals(section.getFault())) + Section axleSection = section.getAxleCounterSection(); + if (this.equals(axleSection.getFault())) return false; - section.setFault(this); + axleSection.setFault(this); + axleSection.loseStatus(); return true; } + + @Override + public void fix(MayOutOfOrderDevice device) { + super.fix(device); + Section section = (Section) device; + Section axleSection = section.getAxleCounterSection(); + axleSection.restoreStatus(); + } }, CBTC_OCCUPIED_FAULT { diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Server.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Server.java new file mode 100644 index 000000000..38d5b780c --- /dev/null +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Server.java @@ -0,0 +1,21 @@ +package club.joylink.rtss.simulation.cbtc.data.map; + +import lombok.Getter; + +/** + * 服务器 + */ +@Getter +public class Server extends MayOutOfOrderDevice{ + + public static final String CODE = "Server"; + + public Server() { + super(CODE, CODE, DeviceType.SERVER); + } + + public enum Fault implements DeviceFault{ + ATP_FAULT, + ATS_FAULT, + } +} diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Signal.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Signal.java index 1b18c06c6..b7b609bd0 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Signal.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Signal.java @@ -694,7 +694,19 @@ public class Signal extends DelayUnlockDevice { } return true; } - }; + }, + /** + * 机柱机头闪(信号机最多只能到引导级) + */ + JZJTS, + /** + * 轨旁无线服务器故障-点灯单元故障(CTC级别“正常”(不知道怎么算不正常)无影响,非CTC级别只能到引导级) + */ + //信号机编号闪 + LIGHTING_UNIT_FAULT_NAME, + //机头闪 + LIGHTING_UNIT_FAULT_HEAD, + ; @Override public void fix(MayOutOfOrderDevice device) { diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Station.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Station.java index 534b780ed..20713208e 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Station.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Station.java @@ -550,7 +550,7 @@ public class Station extends MayOutOfOrderDevice { station = station.getDeviceStation(); } for (StatusDevice statusDevice : station.deviceMap.values()) { - statusDevice.setNoStatus(true); + statusDevice.loseStatus(); } if (Objects.equals(this, station.getFault())) { return false; @@ -568,7 +568,7 @@ public class Station extends MayOutOfOrderDevice { if (!Objects.equals(this, device.getFault())) return; for (StatusDevice statusDevice : station.deviceMap.values()) { - statusDevice.setNoStatus(false); + statusDevice.restoreStatus(); } station.setFault(null); } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/StatusDevice.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/StatusDevice.java index 15b110542..7a75e7018 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/StatusDevice.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/StatusDevice.java @@ -9,11 +9,23 @@ public abstract class StatusDevice extends MapNamedElement { /** 无状态(灰显) */ private boolean noStatus; + /** 行调界面无状态 */ + private boolean atsNoStatus; + protected StatusDevice(String code, String name, DeviceType deviceType) { super(code, name, deviceType); } public void reset() { this.noStatus = false; + this.atsNoStatus = false; + } + + public void loseStatus() { + setNoStatus(true); + } + + public void restoreStatus() { + setNoStatus(false); } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Switch.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Switch.java index 1e199cedd..ca6a90553 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Switch.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Switch.java @@ -6,6 +6,7 @@ import lombok.Getter; import lombok.Setter; import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; /** @@ -132,6 +133,11 @@ public class Switch extends DelayUnlockDevice { */ private Boolean lastTurnToNormal; + /** + * 该道岔转动次数(仅在道岔应用了转动4次后恢复的故障时记录) + */ + private AtomicInteger turnTimes; + @Override public void reset() { super.reset(); @@ -152,6 +158,7 @@ public class Switch extends DelayUnlockDevice { this.init = false; this.lastTurnToNormal = null; this.forceTurnRemain = 0; + this.turnTimes = null; } /** @@ -561,6 +568,23 @@ public class Switch extends DelayUnlockDevice { } }, + /** + * 转动4次后恢复的失表故障 + */ + SPLIT_4{ + @Override + public boolean apply(MayOutOfOrderDevice device) { + Switch aSwitch = (Switch) device; + if (Objects.equals(aSwitch.getFault(), this)) { + return false; + } + aSwitch.setFault(this); + aSwitch.setPos(SwitchIndication.NO); + aSwitch.setTurnTimes(new AtomicInteger(0)); + return true; + } + }, + /** * 定位失表 */ @@ -657,6 +681,32 @@ public class Switch extends DelayUnlockDevice { Switch aSwitch = (Switch) device; Section.AxleFault.CBTC_OCCUPIED_FAULT.fix(aSwitch.getA()); } + }, + + /** + * 道岔区段灰显 + */ + SECTION_NO_STATUS { + @Override + public boolean apply(MayOutOfOrderDevice device) { + boolean apply = super.apply(device); + if (!apply) + return false; + Switch aSwitch = (Switch) device; + aSwitch.loseStatus(); + aSwitch.getAllSections().forEach(Section::loseStatus); + aSwitch.getA().getParent().loseStatus(); + return true; + } + + @Override + public void fix(MayOutOfOrderDevice device) { + super.fix(device); + Switch aSwitch = (Switch) device; + aSwitch.restoreStatus(); + aSwitch.getAllSections().forEach(Section::restoreStatus); + aSwitch.getA().getParent().restoreStatus(); + } } } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/PSDStatus.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/PSDStatus.java index b4cb13ecf..87bd71752 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/PSDStatus.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/PSDStatus.java @@ -36,6 +36,9 @@ public class PSDStatus extends DeviceStatus { @JsonSerialize(using = Boolean2NumSerializer.class) private boolean noStatus; + @JsonSerialize(using = Boolean2NumSerializer.class) + private boolean atsNoStatus; + public PSDStatus(PSD psd) { super(psd.getCode(), psd.getDeviceType()); this.close = psd.isCloseAndLock(); @@ -68,6 +71,11 @@ public class PSDStatus extends DeviceStatus { status.setNoStatus(noStatus); change = true; } + if (!Objects.equals(this.atsNoStatus, psd.isAtsNoStatus())) { + this.atsNoStatus = psd.isAtsNoStatus(); + status.setAtsNoStatus(atsNoStatus); + change = true; + } return change; } @@ -77,6 +85,7 @@ public class PSDStatus extends DeviceStatus { statusVO.setClose(close); statusVO.setInterlockRelease(interlockRelease); statusVO.setNoStatus(noStatus); + statusVO.setAtsNoStatus(atsNoStatus); return statusVO; } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/SectionStatus.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/SectionStatus.java index 4eaca86dc..cf61c9388 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/SectionStatus.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/SectionStatus.java @@ -1,6 +1,7 @@ package club.joylink.rtss.simulation.cbtc.data.status; import club.joylink.rtss.simulation.cbtc.data.map.MapElement; +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.vo.DeviceStatusVO; import club.joylink.rtss.simulation.cbtc.data.vo.SectionStatusVO; @@ -81,6 +82,12 @@ public class SectionStatus extends DeviceStatus { @JsonSerialize(using = Boolean2NumSerializer.class) private boolean noStatus; + /** + * ats无状态 + */ + @JsonSerialize(using = Boolean2NumSerializer.class) + private boolean atsNoStatus; + /** * 计轴预复位 */ @@ -108,6 +115,7 @@ public class SectionStatus extends DeviceStatus { this.faultLock = section.isFaultLock(); this.speedUpLimit = section.getSpeedUpLimit(); this.noStatus = section.isNoStatus(); + this.atsNoStatus = section.isAtsNoStatus(); this.preReset = section.isPreReset(); this.delayUnlock = section.isDelayUnlock(); this.closed = section.isClosed(); @@ -174,6 +182,11 @@ public class SectionStatus extends DeviceStatus { status.setNoStatus(noStatus); change = true; } + if (!Objects.equals(this.atsNoStatus, section.isAtsNoStatus())) { + this.atsNoStatus = section.isAtsNoStatus(); + status.setAtsNoStatus(atsNoStatus); + change = true; + } if (!Objects.equals(this.preReset, section.isPreReset())) { this.preReset = section.isPreReset(); status.setPreReset(this.preReset); @@ -189,6 +202,12 @@ public class SectionStatus extends DeviceStatus { status.setClosed(this.closed); change = true; } + String fault = section.getFault() == null ? null : section.getFault().toString(); + if (!Objects.equals(this.fault, fault)) { + this.fault = fault; + status.setFault(fault); + change = true; + } return change; } @@ -206,9 +225,11 @@ public class SectionStatus extends DeviceStatus { statusVO.setLockRight(lockRight); statusVO.setBlockade(blockade); statusVO.setNoStatus(noStatus); + statusVO.setAtsNoStatus(atsNoStatus); statusVO.setPreReset(preReset); statusVO.setDelayUnlock(delayUnlock); statusVO.setClosed(closed); + statusVO.setFault(fault); return statusVO; } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/SignalStatus.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/SignalStatus.java index 5b231f085..413466f5c 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/SignalStatus.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/SignalStatus.java @@ -55,6 +55,9 @@ public class SignalStatus extends DeviceStatus { @JsonSerialize(using = Boolean2NumSerializer.class) private boolean noStatus; + @JsonSerialize(using = Boolean2NumSerializer.class) + private boolean atsNoStatus; + @JsonSerialize(using = Boolean2NumSerializer.class) private boolean approachLock; @@ -74,6 +77,7 @@ public class SignalStatus extends DeviceStatus { this.aspect = signal.getAspect(); this.remainTime = signal.getRemain(); this.noStatus = signal.isNoStatus(); + this.atsNoStatus = signal.isAtsNoStatus(); this.approachLock = signal.isApproachLock(); this.overlapLock = signal.isOverlapLock(); this.fault = Objects.nonNull(signal.getFault())?((Signal.SignalFault)signal.getFault()).name():null; @@ -129,6 +133,11 @@ public class SignalStatus extends DeviceStatus { status.setNoStatus(noStatus); change = true; } + if (!Objects.equals(this.atsNoStatus, signal.isAtsNoStatus())) { + this.atsNoStatus = signal.isAtsNoStatus(); + status.setAtsNoStatus(this.atsNoStatus); + change = true; + } if (!Objects.equals(this.approachLock, signal.isApproachLock())) { this.approachLock = signal.isApproachLock(); status.setApproachLock(approachLock); @@ -163,6 +172,7 @@ public class SignalStatus extends DeviceStatus { statusVO.setReblockade(this.reblockade); statusVO.setLockedRouteCode(lockedRouteCode); statusVO.setNoStatus(noStatus); + statusVO.setAtsNoStatus(atsNoStatus); statusVO.setApproachLock(approachLock); statusVO.setOverlapLock(overlapLock); statusVO.setFault(fault); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/StandStatus.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/StandStatus.java index db2879f68..8f3a6a5f0 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/StandStatus.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/StandStatus.java @@ -85,6 +85,9 @@ public class StandStatus extends DeviceStatus { @JsonSerialize(using = Boolean2NumSerializer.class) private boolean noStatus; + @JsonSerialize(using = Boolean2NumSerializer.class) + private boolean atsNoStatus; + @JsonSerialize(using = Boolean2NumSerializer.class) private boolean closed; @@ -120,6 +123,7 @@ public class StandStatus extends DeviceStatus { this.parkingAlwaysValid = stand.isParkingAlwaysValid(); this.typeStrategy = stand.getTypeStrategy(); this.noStatus = stand.isNoStatus(); + this.atsNoStatus = stand.isAtsNoStatus(); this.closed = stand.isClosed(); this.fault = Objects.nonNull(stand.getFault())?((Stand.Fault)stand.getFault()).name():null; } @@ -232,6 +236,11 @@ public class StandStatus extends DeviceStatus { status.setNoStatus(noStatus); change = true; } + if (!Objects.equals(this.atsNoStatus, stand.isAtsNoStatus())) { + this.atsNoStatus = stand.isAtsNoStatus(); + status.setAtsNoStatus(this.atsNoStatus); + change = true; + } if (!Objects.equals(this.closed, stand.isClosed())) { this.closed = stand.isClosed(); status.setClosed(this.closed); @@ -270,6 +279,7 @@ public class StandStatus extends DeviceStatus { statusVO.setTrainParking(trainParking); statusVO.setRemainTime(remainTime); statusVO.setNoStatus(noStatus); + statusVO.setAtsNoStatus(atsNoStatus); statusVO.setClosed(closed); statusVO.setFault(fault); return statusVO; diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/StationStatus.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/StationStatus.java index cf1940246..ed7a73f66 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/StationStatus.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/StationStatus.java @@ -74,6 +74,8 @@ public class StationStatus extends DeviceStatus { */ private int preResetValidDuration; + private boolean interlockMachineStarting; + public StationStatus(Station station) { super(station.getCode(), station.getDeviceType()); this.controlMode = station.getControlMode(); @@ -87,6 +89,7 @@ public class StationStatus extends DeviceStatus { this.emergencyController = station.isEmergencyController(); this.controlApplicant = station.getControlApplicantId(); this.preResetValidDuration = station.getPreResetValidDurationInSeconds(); + this.interlockMachineStarting = station.isInterlockMachineStarting(); } @Override @@ -150,6 +153,11 @@ public class StationStatus extends DeviceStatus { this.preResetValidDuration = station.getPreResetValidDurationInSeconds(); status.setPreResetValidDuration(this.preResetValidDuration); } + if (!Objects.equals(this.interlockMachineStarting, station.isInterlockMachineStarting())) { + change = true; + this.interlockMachineStarting = station.isInterlockMachineStarting(); + status.setInterlockMachineStarting(this.interlockMachineStarting); + } return change; } @@ -167,6 +175,7 @@ public class StationStatus extends DeviceStatus { statusVO.setEmergencyController(emergencyController); statusVO.setControlApplicant(controlApplicant); statusVO.setPreResetValidDuration(preResetValidDuration); + statusVO.setInterlockMachineStarting(interlockMachineStarting); return statusVO; } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/SwitchStatus.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/SwitchStatus.java index 72c53914b..3b0192eaa 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/SwitchStatus.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/SwitchStatus.java @@ -59,6 +59,9 @@ public class SwitchStatus extends DeviceStatus { @JsonSerialize(using = Boolean2NumSerializer.class) private boolean noStatus; + @JsonSerialize(using = Boolean2NumSerializer.class) + private boolean atsNoStatus; + @JsonSerialize(using = Boolean2NumSerializer.class) private boolean preReset; @@ -97,11 +100,13 @@ public class SwitchStatus extends DeviceStatus { this.pos = aSwitch.getPos(); this.delayTime = aSwitch.getRemain() / 1000; this.noStatus = aSwitch.isNoStatus(); + this.atsNoStatus = aSwitch.isAtsNoStatus(); this.preReset = aSwitch.isPreReset(); this.auto = aSwitch.isAuto(); this.dispatcherReserve = aSwitch.isDispatcherReserve(); this.interlockReserve = aSwitch.isInterlockReserve(); this.blockadeInvalid = aSwitch.isBlockadeInvalid(); + this.fault = (Switch.SwitchFault) aSwitch.getFault(); } @Override @@ -150,6 +155,11 @@ public class SwitchStatus extends DeviceStatus { status.setNoStatus(this.noStatus); change = true; } + if (!Objects.equals(this.atsNoStatus, aSwitch.isAtsNoStatus())) { + this.atsNoStatus = aSwitch.isAtsNoStatus(); + status.setAtsNoStatus(this.atsNoStatus); + change = true; + } if (!Objects.equals(this.preReset, aSwitch.isPreReset())) { this.preReset = aSwitch.isPreReset(); status.setPreReset(this.preReset); @@ -193,6 +203,7 @@ public class SwitchStatus extends DeviceStatus { statusVO.setBlockade(blockade); statusVO.setSingleLock(singleLock); statusVO.setNoStatus(noStatus); + statusVO.setAtsNoStatus(atsNoStatus); statusVO.setPreReset(preReset); statusVO.setAuto(auto); statusVO.setDispatcherReserve(dispatcherReserve); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/PSDStatusVO.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/PSDStatusVO.java index dce11c6cf..312fab9af 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/PSDStatusVO.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/PSDStatusVO.java @@ -29,6 +29,9 @@ public class PSDStatusVO extends DeviceStatusVO { @JsonSerialize(using = Boolean2NumSerializer.class) private Boolean noStatus; + @JsonSerialize(using = Boolean2NumSerializer.class) + private Boolean atsNoStatus; + public PSDStatusVO(PSD psd) { super(psd.getCode(), psd.getDeviceType()); } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/SectionStatusVO.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/SectionStatusVO.java index 4843f8a98..c38ac9910 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/SectionStatusVO.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/SectionStatusVO.java @@ -2,6 +2,7 @@ package club.joylink.rtss.simulation.cbtc.data.vo; import club.joylink.rtss.simulation.cbtc.data.map.Section; import club.joylink.rtss.util.jsonSerialize.Boolean2NumSerializer; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import lombok.Getter; import lombok.Setter; @@ -55,6 +56,9 @@ public class SectionStatusVO extends DeviceStatusVO { @JsonSerialize(using = Boolean2NumSerializer.class) private Boolean noStatus; + @JsonSerialize(using = Boolean2NumSerializer.class) + private Boolean atsNoStatus; + @JsonSerialize(using = Boolean2NumSerializer.class) private Boolean preReset; @@ -64,6 +68,7 @@ public class SectionStatusVO extends DeviceStatusVO { @JsonSerialize(using = Boolean2NumSerializer.class) private Boolean closed; + @JsonInclude private String fault; public SectionStatusVO(Section section) { diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/SignalStatusVO.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/SignalStatusVO.java index 99bdc8f04..b85f54575 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/SignalStatusVO.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/SignalStatusVO.java @@ -51,6 +51,9 @@ public class SignalStatusVO extends DeviceStatusVO{ @JsonSerialize(using = Boolean2NumSerializer.class) private Boolean noStatus; + @JsonSerialize(using = Boolean2NumSerializer.class) + private Boolean atsNoStatus; + @JsonSerialize(using = Boolean2NumSerializer.class) private Boolean approachLock; diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/StandStatusVO.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/StandStatusVO.java index 75fd685be..6a3cd89da 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/StandStatusVO.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/StandStatusVO.java @@ -86,6 +86,9 @@ public class StandStatusVO extends DeviceStatusVO { @JsonSerialize(using = Boolean2NumSerializer.class) private Boolean noStatus; + @JsonSerialize(using = Boolean2NumSerializer.class) + private Boolean atsNoStatus; + @JsonSerialize(using = Boolean2NumSerializer.class) private Boolean closed; diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/StationStatusVO.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/StationStatusVO.java index 11897069a..829730093 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/StationStatusVO.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/StationStatusVO.java @@ -70,6 +70,8 @@ public class StationStatusVO extends DeviceStatusVO { private Integer preResetValidDuration; + private Boolean interlockMachineStarting; + public StationStatusVO(Station station) { super(station.getCode(), station.getDeviceType()); } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/SwitchStatusVO.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/SwitchStatusVO.java index e68cf45f4..4d5d8a874 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/SwitchStatusVO.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/SwitchStatusVO.java @@ -52,6 +52,9 @@ public class SwitchStatusVO extends DeviceStatusVO { @JsonSerialize(using = Boolean2NumSerializer.class) private Boolean noStatus; + @JsonSerialize(using = Boolean2NumSerializer.class) + private boolean atsNoStatus; + @JsonSerialize(using = Boolean2NumSerializer.class) private Boolean preReset; @@ -73,4 +76,12 @@ public class SwitchStatusVO extends DeviceStatusVO { public SwitchStatusVO(Switch aSwitch) { super(aSwitch.getCode(), aSwitch.getDeviceType()); } + + public void setAtsNoStatus(boolean atsNoStatus) { + this.atsNoStatus = atsNoStatus; + } + + public boolean getAtsNoStatus() { + return atsNoStatus; + } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityTrain.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityTrain.java index 7400d3941..ef65019cf 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityTrain.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityTrain.java @@ -1445,10 +1445,11 @@ public class VirtualRealityTrain extends VirtualRealityDevice { * 是否比该模式级别更高 */ public boolean isHigherThan(PreselectionMode mode) { - if (this.runLevel.isHigherThan(mode.runLevel)) { - return true; + if (this.runLevel.equals(mode.runLevel)) { + return this.driveMode.isHigherThan(mode.driveMode); + } else { + return this.runLevel.isHigherThan(mode.runLevel); } - return this.driveMode.isHigherThan(mode.driveMode); } }