diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsTrainLoadService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsTrainLoadService.java index b3639e10c..a503f16aa 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsTrainLoadService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsTrainLoadService.java @@ -1,9 +1,7 @@ package club.joylink.rtss.simulation.cbtc.ATS.service; import club.joylink.rtss.exception.BusinessExceptionAssertEnum; -import club.joylink.rtss.simulation.cbtc.ATP.ground.GroundAtpApiService; import club.joylink.rtss.simulation.cbtc.ATP.ground.MaService; -import club.joylink.rtss.simulation.cbtc.ATP.ground.ZCLogicLoop; import club.joylink.rtss.simulation.cbtc.CI.CILogicLoop; import club.joylink.rtss.simulation.cbtc.CI.service.RouteService; import club.joylink.rtss.simulation.cbtc.Simulation; @@ -61,12 +59,8 @@ public class AtsTrainLoadService { @Autowired private CILogicLoop ciLogicLoop; - @Autowired - private GroundAtpApiService groundAtpApiService; - - @Autowired - private ZCLogicLoop zcLogicLoop; + private AtsTrainMonitorService atsTrainMonitorService; @Autowired private MaService maService; @@ -417,8 +411,8 @@ public class AtsTrainLoadService { this.vrDeviceLogicLoop.updateTrainOccupySection(simulation); // 计轴占用处理 this.ciLogicLoop.getStatusFromVRDevice(simulation); - // 计轴区段状态发送地面ATP - this.groundAtpApiService.receiveAndHandleAxleSectionStatus(simulation); + // ATS监控逻辑 + this.atsTrainMonitorService.monitor(simulation); // 进路解锁逻辑 this.ciLogicLoop.routeLogic(simulation); MapConfig config = simulation.getRepository().getConfig(); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CILogicLoop.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CILogicLoop.java index de0a6ea10..d5fb5b734 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CILogicLoop.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CILogicLoop.java @@ -51,9 +51,6 @@ public class CILogicLoop { // long start = System.currentTimeMillis(); // 设备状态采集(从虚拟真实设备采集) this.getStatusFromVRDevice(simulation); - // 计轴区段状态发送地面ATP - this.groundAtpApiService.receiveAndHandleAxleSectionStatus(simulation); - // 进路逻辑 this.routeLogic(simulation); @@ -101,6 +98,9 @@ public class CILogicLoop { // 道岔状态发送ATS this.atsApiService.handleDeviceStatus(simulation, signalList); this.atsApiService.handleDeviceStatus(simulation, switchList); + + // 计轴区段状态发送地面ATP + this.groundAtpApiService.receiveAndHandleAxleSectionStatus(simulation); } @@ -276,7 +276,7 @@ public class CILogicLoop { if (virtualAxleCounter.isOccupy()) { section.axleCounterOccupy(virtualAxleCounter.isRight()); } else { - section.axleCounterClear(); + section.clearOccupy(); section.judgeAsValid(); } //预复位 diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/tool/DeviceStatusModifyTool.java b/src/main/java/club/joylink/rtss/simulation/cbtc/tool/DeviceStatusModifyTool.java index 68d99d7d2..0d1c1bf78 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/tool/DeviceStatusModifyTool.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/tool/DeviceStatusModifyTool.java @@ -72,6 +72,7 @@ public class DeviceStatusModifyTool { } } for (SwitchElement switchElement : switchElementList) { + switchElement.getASwitch().ciUse(switchElement.isNormal()); this.setSingleSwitchPositionDirectly(switchElement.getASwitch(), switchElement.isNormal()); switchElement.getASwitch().fpLock(); } @@ -158,6 +159,7 @@ public class DeviceStatusModifyTool { switchElement.getASwitch().isOnPosition(!switchElement.isNormal())) { continue; } + switchElement.getASwitch().ciUse(switchElement.isNormal()); this.setSingleSwitchPositionDirectly(switchElement.getASwitch(), switchElement.isNormal()); if (routeLock) { switchElement.getASwitch().routeLock(route);