信号重复封锁的检查区段改为第一个逻辑区段;<延续保护未锁闭>的移动授权改为<延续保护前100m|延续保护前一个区段距离更远的那个端点>

This commit is contained in:
joylink_zhangsai 2021-01-25 16:13:57 +08:00
parent 5e2c83d565
commit f05398e33c
7 changed files with 36 additions and 45 deletions

View File

@ -3,7 +3,6 @@ package club.joylink.rtss.simulation.cbtc.ATP.ground;
import club.joylink.rtss.simulation.cbtc.ATS.AtsApiService;
import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.constant.RunLevel;
import club.joylink.rtss.simulation.cbtc.constant.SimulationModule;
import club.joylink.rtss.simulation.cbtc.data.CalculateService;
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
import club.joylink.rtss.simulation.cbtc.data.map.*;
@ -40,9 +39,6 @@ public class ZCLogicLoop {
@Autowired
private AtsApiService atsApiService;
@Autowired
private GroundAtpApiService groundAtpApiService;
public void run(Simulation simulation) {
List<VirtualRealityTrain> trainList = simulation.getRepository().getOnlineTrainList();
trainList.forEach(train -> {
@ -85,41 +81,6 @@ public class ZCLogicLoop {
}
}
private void parkingTimeCountDown(Simulation simulation, VirtualRealityTrain train) {
int parkTime = train.getParkTime();
if (parkTime > 0 && !train.isDeparture()) {
int parkRemainTime = train.getParkRemainTime();
if (parkRemainTime >= 0) {
parkRemainTime -= SimulationModule.ATP.getRateMs();
train.setParkRemainTime(parkRemainTime);
} else {
train.depart();
}
}
}
/**
* 发送列车停稳消息给地面ATP
*
* @param simulation
* @param train
*/
private void sendStopMessage2GroundAtp(Simulation simulation, VirtualRealityTrain train) {
TrainStopMessage trainStopMessage = new TrainStopMessage(train);
this.groundAtpApiService.handleTrainStopMessage(simulation, trainStopMessage);
}
private void calculateMaOfCtc(Simulation simulation, VirtualRealityTrain train,
List<VirtualRealityTrain> trainList) {
// 查找移动授权终端列表
List<MovementAuthority.End> endList = this.findCtcMaEnd(simulation, train, trainList);
}
private List<MovementAuthority.End> findCtcMaEnd(Simulation simulation, VirtualRealityTrain train,
List<VirtualRealityTrain> trainList) {
return null;
}
private void calculateMAOfCBTC(Simulation simulation, VirtualRealityTrain train,
List<VirtualRealityTrain> trainList) {
// 查找移动授权终端列表
@ -252,7 +213,7 @@ public class ZCLogicLoop {
if (Objects.nonNull(route) && repository.isOverlapNeedSetting(route)) { // 进路需要办理延续保护
RouteOverlap overlap = route.getOverlap();
if (!overlap.isLock()) { // 延续保护未锁闭
return new MovementAuthority.End(section,
return new MovementAuthority.End(overlap.getSection(),
MovementAuthority.EndType.UNLOCKED_OVERLAP);
}
}

View File

@ -155,11 +155,13 @@ public class CILogicLoop {
}
if (route.isLock() || route.isNormalUnlock()) {
// 进路第一个区段是否占用
Section firstRouteSection = route.getFirstRouteSection();
Section firstLogicSection = route.getFirstLogicSection();
if (route.getStart().getLevel() == Signal.LEVEL_3 &&
firstRouteSection.isRouteLock() &&
firstRouteSection.isOccupied()) {
firstLogicSection.isRouteLock() &&
firstLogicSection.isOccupied()) {
route.getStart().setReblockade(true);
log.debug(String.format("[%s]因[%s]第一个子区段[%s]进路锁闭且占用而重复封锁",
route.getStart().debugStr(), route.debugStr(), firstLogicSection.debugStr()));
}
}
// else if (route.isLock() && !route.isNormalUnlock() && !route.isOpen()) {

View File

@ -31,6 +31,7 @@ public class SignalService {
signal.setBlockade(true);
if (signal.getLockedRoute() != null) {
signal.setReblockade(true);
log.debug(signal.debugStr() + "因信号机封锁且有锁闭的进路而重复封锁");
}
}
}

View File

@ -99,6 +99,10 @@ public class CommandBO {
this.finish = true;
}
public String debugStr() {
return String.format("步骤[类型:%s|操作类型:%s]", type, operationType);
}
public enum StepType {
/**
* 仿真操作

View File

@ -1,10 +1,10 @@
package club.joylink.rtss.simulation.cbtc.command;
import club.joylink.rtss.simulation.cbtc.onboard.ATP.OnboardAtpApiService;
import club.joylink.rtss.simulation.cbtc.ATS.operation.AtsOperationDispatcher;
import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain;
import club.joylink.rtss.simulation.cbtc.member.SimulationMember;
import club.joylink.rtss.simulation.cbtc.onboard.ATP.OnboardAtpApiService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -33,6 +33,7 @@ public class CommandExecuteService {
log.info(String.format("机器人代为执行指令[%s]", command.getCommandType()));
CommandBO.Step step = command.getCommandType().executeOrReturnStep(simulation, command);
if (step != null) {
log.debug(String.format("指令[%s]执行到%s", command.getCommandType(), step.debugStr()));
execute(step, simulation, command.getTargetMember());
}
}

View File

@ -177,6 +177,24 @@ public class Route extends MapNamedElement {
return this.sectionList.get(0);
}
/**
* 获取第一个逻辑区段
*/
public Section getFirstLogicSection() {
Section firstSection = getFirstRouteSection();
List<Section> logicList = firstSection.getLogicList();
if (CollectionUtils.isEmpty(logicList)) {
return firstSection;
} else {
boolean right = start.isRight();
if (right) {
return logicList.get(0);
} else {
return logicList.get(logicList.size() - 1);
}
}
}
/**
* 获取进路内最后一个子进路区段
* @return

View File

@ -121,9 +121,13 @@ public class MovementAuthority {
float offset = right ? section.getLen() : 0;
return new SectionPosition(section, offset);
}
case UNLOCKED_OVERLAP: { //这种情况下section是进路的最后一个区段
Section section = (Section) this.device;
float offset = right ? Math.max(0, section.getLen() - 100) : Math.min(100, section.getLen());
return new SectionPosition(section, offset);
}
case FAULT_SWITCH:
case UNLOCK_SECTION:
case UNLOCKED_OVERLAP:
case NCT_OCCUPIED_IN_FRONT_OF_SECTION:
case FAULT_SECTION: {
Section section = (Section) this.device;