diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/AtpSectionService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/AtpSectionService.java index 53a3e4877..089aec5b5 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/AtpSectionService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/AtpSectionService.java @@ -119,8 +119,11 @@ public class AtpSectionService { //重新给atpSectionList塞值 atpSectionList.clear(); for (Section section : collect) { - atpSectionList.add(section); - atpSectionList.addAll(section.getLogicList()); + if (CollectionUtils.isEmpty(section.getLogicList())) { + atpSectionList.add(section); + } else { + atpSectionList.addAll(section.getLogicList()); + } } //将列车占压的物理区段及其关联的逻辑区段全部设为非通信车占用 atpSectionList.forEach(atpSection -> atpSection.nonCommunicateTrainOccupy(right)); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/GroundAtpApiServiceImpl.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/GroundAtpApiServiceImpl.java index 8c5c6ee5e..df64c5d0e 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/GroundAtpApiServiceImpl.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/GroundAtpApiServiceImpl.java @@ -29,6 +29,9 @@ public class GroundAtpApiServiceImpl implements GroundAtpApiService { @Autowired private AtsApiService atsApiService; + @Autowired + private MaService maService; + @Autowired private TempSpeedLimitService tempSpeedLimitService; @@ -90,6 +93,8 @@ public class GroundAtpApiServiceImpl implements GroundAtpApiService { // 发送区段状态 this.atsApiService.handleDeviceStatus(simulation, repository.getSectionList()); + // 为ctc列车计算移动授权 + this.maService.calculateMaOfCtcTrains(simulation); } @Override diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/MaService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/MaService.java index f0e277772..8ceba5647 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/MaService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/MaService.java @@ -27,7 +27,7 @@ public class MaService { @Getter public static class Ma { - public static final int Safety_Margin = 1; // 安全余量,单位m + public static final int Safety_Margin = 1; // 安全余量,单位m,暂时没有计算紧急制动曲线,暂时不用 public static final int EB_Trigger = 20; // 紧急制动触发点偏移量,单位m public static final int Safety_Distance = 30; // 安全距离, 单位m @@ -45,10 +45,6 @@ public class MaService { * ATO停车曲线 */ private SpeedCurve atoStopCurve; - /** - * 移动的累计距离 - */ - private float moveLen; public Ma(VirtualRealityTrain train, MapNamedElement device, MaType type) { this.train = train; @@ -58,10 +54,6 @@ public class MaService { this.calculateDistanceToEoa(); } - public void addMoveLen(float len) { - this.moveLen += len; - } - public void setEbTriggerCurve(SpeedCurve ebTriggerCurve) { this.ebTriggerCurve = ebTriggerCurve; } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/ZCLogicLoop.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/ZCLogicLoop.java index 06f6bca74..852b2aac4 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/ZCLogicLoop.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/ZCLogicLoop.java @@ -680,8 +680,8 @@ public class ZCLogicLoop { return null; } - public void addJobs(Simulation simulation) { -// simulation.addJob(SimulationModule.ZC.name(), () -> this.run(simulation), SimulationConstants.ZC_LOOP_RATE); - simulation.addJob("MaCal", () -> this.maService.calculateMaOfCtcTrains(simulation), 1000); - } +// public void addJobs(Simulation simulation) { +//// simulation.addJob(SimulationModule.ZC.name(), () -> this.run(simulation), SimulationConstants.ZC_LOOP_RATE); +// simulation.addJob("MaCal", () -> this.maService.calculateMaOfCtcTrains(simulation), 1000); +// } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/SimulationLifeCycleServiceImpl.java b/src/main/java/club/joylink/rtss/simulation/cbtc/SimulationLifeCycleServiceImpl.java index 312983e17..e4b8fc66f 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/SimulationLifeCycleServiceImpl.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/SimulationLifeCycleServiceImpl.java @@ -4,7 +4,6 @@ import club.joylink.rtss.services.IVirtualRealityIbpService; import club.joylink.rtss.services.IVoiceCommandService; import club.joylink.rtss.services.psl.IVirtualRealityPslService; import club.joylink.rtss.simulation.SimulationManager; -import club.joylink.rtss.simulation.cbtc.ATP.ground.ZCLogicLoop; import club.joylink.rtss.simulation.cbtc.ATS.ATSLogicLoop; import club.joylink.rtss.simulation.cbtc.ATS.ATSMessageCollectAndDispatcher; import club.joylink.rtss.simulation.cbtc.CI.CILogicLoop; @@ -67,9 +66,9 @@ public class SimulationLifeCycleServiceImpl implements SimulationLifeCycleServic @Autowired private VRDeviceLogicLoop vrDeviceLogicLoop; - - @Autowired - private ZCLogicLoop zcLogicLoop; +// +// @Autowired +// private ZCLogicLoop zcLogicLoop; @Autowired private ATSMessageCollectAndDispatcher atsMessageCollectAndDispatcher; @@ -126,7 +125,7 @@ public class SimulationLifeCycleServiceImpl implements SimulationLifeCycleServic vrTrainRunningService.addJobs(simulation); ciLogicLoop.addJobs(simulation); vrDeviceLogicLoop.addJobs(simulation); - zcLogicLoop.addJobs(simulation); +// zcLogicLoop.addJobs(simulation); atsMessageCollectAndDispatcher.addJobs(simulation); joylink3DMessageService.addJobs(simulation); faultGenerator.addJobs(simulation);