From 1f6b77b26a326b137c7bf36f40063a9cd1f96319 Mon Sep 17 00:00:00 2001 From: walker-sheng Date: Tue, 3 Aug 2021 18:34:13 +0800 Subject: [PATCH] =?UTF-8?q?MA=E8=AE=A1=E7=AE=97ato=E8=B7=9D=E7=A6=BB?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../simulation/cbtc/ATP/ground/MaService.java | 25 ++++++++++++++++--- .../cbtc/ATS/service/AtsTrainLoadService.java | 2 +- 2 files changed, 22 insertions(+), 5 deletions(-) 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 6626abd56..88886484d 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 @@ -117,16 +117,24 @@ public class MaService { } public float calculateDistanceOfAtoEnd() { + boolean right = this.train.isRight(); + float standard = this.calculateDistanceOfEbTriggerEnd() - Safety_Distance; if (this.type.equals(MaType.Limit_Signal_With_Overlap) || this.type.equals(MaType.Limit_Signal_Without_Overlap)) { Signal signal = (Signal) this.device; SectionPosition sectionPosition = new SectionPosition(signal.getSection(), signal.getOffset()); - boolean right = this.train.isRight(); SectionPosition end = CalculateService.calculateNextPositionByStartAndLen(sectionPosition, !right, 2); - return CalculateService.calculateDistance(this.train.getHeadPosition(), end, right); - } else { - return this.calculateDistanceOfEbTriggerEnd() - Safety_Distance; + Float distance = CalculateService.calculateDistance(this.train.getHeadPosition(), end, right); + if (distance < standard) { + return distance; + } + } else if(this.type.equals(MaType.Front_Train)) { + VirtualRealityTrain frontTrain = (VirtualRealityTrain) this.device; + if (frontTrain.isParkingAt()) { + return CalculateService.calculateDistance(this.train.getHeadPosition(), this.eoaPosition, right) - EB_Trigger; + } } + return standard; } public SectionPosition getEoaPosition() { @@ -250,6 +258,8 @@ public class MaService { Fault_Route, /** 站台问题(屏蔽门或紧急停车) */ Stand, + /** ITC终端信号 */ + ITC_Signal, } public void calculateMaOfCtcTrains(Simulation simulation) { @@ -266,10 +276,17 @@ public class MaService { System.out.println(ma.debugStr()); } this.onboardAtpApiService.updateCtcMa(simulation, ma); + } else { + } } } + public Ma calculateAndUpdateItcMa(Simulation simulation, VirtualRealityTrain train) { + + return null; + } + public Ma calculateCtcMa(Simulation simulation, VirtualRealityTrain train, Map trainMap) { SectionPosition headPosition = train.getHeadPosition(); SectionPosition tailPosition = train.getTailPosition(); 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 f718bc480..e745951ce 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 @@ -409,7 +409,7 @@ public class AtsTrainLoadService { this.trainOnlineAndBuildSupervise(simulation, loadedList); // 计算移动授权 // this.maService.calculateMaOfCtcTrains(simulation); - this.zcLogicLoop.run(simulation); +// this.zcLogicLoop.run(simulation); // // 更新列车速度 // this.updateTrainSpeed(simulation); // 更新列车占用计轴区段