修改进路触发逻辑;列车在转换轨停车时,增加检查回库的逻辑

This commit is contained in:
joylink_zhangsai 2021-08-09 16:46:05 +08:00
parent 05d585e37e
commit 44d3166858
2 changed files with 22 additions and 14 deletions

View File

@ -152,7 +152,6 @@ public abstract class AtsRouteSelectService {
public RouteSelectResult queryTriggerRoutesOfRoutePath(SimulationDataRepository repository, public RouteSelectResult queryTriggerRoutesOfRoutePath(SimulationDataRepository repository,
TrainInfo trainInfo, List<RoutePath> routePathList, Section nextPlanSection) { TrainInfo trainInfo, List<RoutePath> routePathList, Section nextPlanSection) {
Section section = repository.getByCode(trainInfo.getPhysicalSection(), Section.class); // 列车所在区段 Section section = repository.getByCode(trainInfo.getPhysicalSection(), Section.class); // 列车所在区段
Section planSection = repository.getByCode(trainInfo.getPlanStandTrack(), Section.class); //列车计划区段
List<Route> triggerList = new ArrayList<>(); List<Route> triggerList = new ArrayList<>();
if (!routePathList.isEmpty()) { if (!routePathList.isEmpty()) {
RoutePath routePath = this.selectRoutePath(routePathList); RoutePath routePath = this.selectRoutePath(routePathList);
@ -194,11 +193,11 @@ public abstract class AtsRouteSelectService {
other.getGroupNumber(), route.getStart().getName()))); other.getGroupNumber(), route.getStart().getName())));
continue; continue;
} }
if (route.getStart().equals(signal) && !route.isTurnBack() && !triggerList.contains(route)) { if (route.getStart().equals(signal) && !route.isTurnBack() && !triggerList.contains(route) && route.isAtsControl()) {
if (repository.getConfig().isRouteLikeHa1()) { if (repository.getConfig().isRouteLikeHa1()) {
if (trainInfo.isCommunicable() && route.isAtp()) { if (ctcLevel && route.isAtp()) {
triggerList.add(route); triggerList.add(route);
} else if (!trainInfo.isCommunicable() && route.isGround()) { } else if (!ctcLevel && route.isGround()) {
triggerList.add(route); triggerList.add(route);
} }
} else { } else {
@ -210,16 +209,17 @@ public abstract class AtsRouteSelectService {
if (triggerList.size() == 1) { if (triggerList.size() == 1) {
return new RouteSelectResult(triggerList.get(0), false); return new RouteSelectResult(triggerList.get(0), false);
} else if (triggerList.size() > 1) { } else if (triggerList.size() > 1) {
if (planSection.equals(triggerList.get(0).getLastRouteSection()) && nextPlanSection != null) { // if (planSection.equals(triggerList.get(0).getLastRouteSection()) && nextPlanSection != null) {
// 进路是计划站台轨根据后续计划筛选 // // 进路是计划站台轨根据后续计划筛选
List<RoutePath> routePaths = repository.getRoutePaths(planSection, nextPlanSection); // List<RoutePath> routePaths = repository.getRoutePaths(planSection, nextPlanSection);
for (Route temp : triggerList) { // for (Route temp : triggerList) {
if (routePaths.get(0).containsAllSections(temp.getOverlap().getFirstPath().getSectionList())) { // if (routePaths.get(0).containsAllSections(temp.getOverlap().getFirstPath().getSectionList())) {
return new RouteSelectResult(temp, false); // return new RouteSelectResult(temp, false);
} // }
} // }
} else { // } else {
// 取第一个延续保护道岔定位的 // 取第一个延续保护道岔定位的
Route route = null;
for (Route temp : triggerList) { for (Route temp : triggerList) {
List<SwitchElement> switchList = temp.getOverlap().getFirstPath().getSwitchList(); List<SwitchElement> switchList = temp.getOverlap().getFirstPath().getSwitchList();
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertCollectionNotEmpty(switchList, BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertCollectionNotEmpty(switchList,
@ -228,9 +228,12 @@ public abstract class AtsRouteSelectService {
triggerList.stream().map(Route::getName).collect(Collectors.joining(",")))); triggerList.stream().map(Route::getName).collect(Collectors.joining(","))));
if (switchList.get(0).isNormal()) { if (switchList.get(0).isNormal()) {
return new RouteSelectResult(temp, false); return new RouteSelectResult(temp, false);
} else {
route = temp;
} }
} }
} return new RouteSelectResult(route, false);
// }
} }
} }
} }

View File

@ -6,6 +6,7 @@ import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.constant.SimulationModule; import club.joylink.rtss.simulation.cbtc.constant.SimulationModule;
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository; import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
import club.joylink.rtss.simulation.cbtc.data.map.*; import club.joylink.rtss.simulation.cbtc.data.map.*;
import club.joylink.rtss.simulation.cbtc.data.support.RoutePath;
import club.joylink.rtss.simulation.cbtc.data.vo.TrainInfo; import club.joylink.rtss.simulation.cbtc.data.vo.TrainInfo;
import club.joylink.rtss.simulation.cbtc.onboard.ATP.OnboardAtpApiService; import club.joylink.rtss.simulation.cbtc.onboard.ATP.OnboardAtpApiService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -59,6 +60,10 @@ public class AtsTrainStageHandler {
AtsStageService stageService = this.getStageService(trainInfo); AtsStageService stageService = this.getStageService(trainInfo);
if (parkSection.isTransferTrack()) { // 转换轨 if (parkSection.isTransferTrack()) { // 转换轨
stageService.handleTransferTrackParking(simulation, trainInfo, parkSection); stageService.handleTransferTrackParking(simulation, trainInfo, parkSection);
List<RoutePath> routePathList = repository.queryRoutePathsByEnd(parkSection);
if (routePathList.get(0).isRight() == trainInfo.getRight()) { //准备回库
trainInfo.finishPlanPrepareInbound();
}
} else if (parkSection.isNormalStandTrack()) { // 正常站台轨 } else if (parkSection.isNormalStandTrack()) { // 正常站台轨
stageService.handleNormalStandParking(simulation, trainInfo, parkSection); stageService.handleNormalStandParking(simulation, trainInfo, parkSection);
List<Stand> standList = parkSection.getStandList(); List<Stand> standList = parkSection.getStandList();