修改默认运行级别为ITC的线路加载出库列车的逻辑,使列车状态正确
This commit is contained in:
parent
c5e40e047c
commit
0e1a8da2d5
@ -1,5 +1,6 @@
|
||||
package club.joylink.rtss.simulation.cbtc.ATS.tools;
|
||||
|
||||
import club.joylink.rtss.simulation.cbtc.ATP.ground.MaService;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.constant.RunLevel;
|
||||
import club.joylink.rtss.simulation.cbtc.constant.TrainType;
|
||||
@ -12,6 +13,7 @@ import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vo.TrainInfo;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@ -23,6 +25,9 @@ import java.util.Objects;
|
||||
@Component
|
||||
public class TrainOutboundLoadTool {
|
||||
|
||||
@Autowired
|
||||
private MaService maService;
|
||||
|
||||
public void loadOutboundTrain(Simulation simulation) {
|
||||
if (!simulation.isPlanRunning()) { // 未开始计划运行
|
||||
return;
|
||||
@ -76,7 +81,10 @@ public class TrainOutboundLoadTool {
|
||||
SectionPosition headPosition = new SectionPosition(startSection, offset);
|
||||
train.initManualTrain(headPosition, right);
|
||||
if (Objects.equals(RunLevel.ITC, repository.getConfig().getRunMode())) {
|
||||
train.setCommunication(false);
|
||||
train.setNoCommunicateDevice(true);
|
||||
train.setITCMode();
|
||||
this.maService.calculateAndUpdateItcMa(simulation, train);
|
||||
}
|
||||
repository.addOnlineTrain(train);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user