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 ddc613ba9..c100a1595 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 @@ -4,6 +4,7 @@ import club.joylink.rtss.simulation.cbtc.CI.CiApiService; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.data.CalculateService; import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository; +import club.joylink.rtss.simulation.cbtc.data.map.MapConfig; import club.joylink.rtss.simulation.cbtc.data.map.Section; import club.joylink.rtss.simulation.cbtc.data.map.Signal; import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition; @@ -102,12 +103,14 @@ public class AtpSectionService { boolean right = train.isRight(); SectionPosition trainHeadPosition = train.getHeadPosition(); SimulationDataRepository repository = simulation.getRepository(); + MapConfig config = repository.getConfig(); + boolean switchSingleHandle = config.isSwitchSingleHandle(); if (train.isCommunicable()) { // 通信车占用 // 车尾位置追加不确定性距离:(速度*2)m SectionPosition trainTailPosition = CalculateService - .calculateNextPositionByStartAndLen(trainHeadPosition, !right, train.getLen() + train.getSpeed()*2); + .calculateNextPositionByStartAndLen(trainHeadPosition, !right, train.getLen() + train.getSpeed() * 2); atpSectionList = CalculateService.getAtpSections(trainHeadPosition, trainTailPosition, - right, repository.getConfig().isSwitchSingleHandle()); + right, switchSingleHandle); List
removes = new ArrayList<>(); for (Section atpSection : atpSectionList) { Section axle = atpSection; @@ -128,6 +131,11 @@ public class AtpSectionService { List
sectionList = repository.queryTrainOccupySectionList(train.getGroupNumber()); if (!CollectionUtils.isEmpty(sectionList)) { for (Section section : sectionList) { + if (section.isSwitchAxleCounterSection()) { + Section switchSection = section.getLogicList().get(0); + atpSectionList.addAll(switchSection.getSwitchAxleSectionsBySwitchPosition()); + continue; + } if (CollectionUtils.isEmpty(section.getLogicList())) { atpSectionList.add(section); } else { diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATO/SpeedCurve.java b/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATO/SpeedCurve.java index e52935a6c..9b581fe82 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATO/SpeedCurve.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATO/SpeedCurve.java @@ -346,15 +346,6 @@ public class SpeedCurve { base = base.getNextRunningSectionOf(right); } } -// if (Objects.nonNull(endPosition)) { -// Float distance = CalculateService.calculateDistance(headPosition, endPosition, right); -// if (Objects.isNull(distance) || distance > totalLen) { -// return buildTargetSpeedCurve(totalLen, v0, 0, limitSpeed); -// } else { -// return buildTargetSpeedCurve(distance, v0, vt, limitSpeed); -// } -// } -// return buildTargetSpeedCurve(totalLen, v0, 0, limitSpeed); SpeedCurve normalSpeedCurve = buildTargetSpeedCurve(totalLen, v0, 0, limitSpeed); if (endPosition != null) { Float distance = CalculateService.calculateDistance(headPosition, endPosition, right);