修改进路触发逻辑;列车在转换轨停车时,增加检查回库的逻辑
This commit is contained in:
parent
05d585e37e
commit
44d3166858
@ -152,7 +152,6 @@ public abstract class AtsRouteSelectService {
|
||||
public RouteSelectResult queryTriggerRoutesOfRoutePath(SimulationDataRepository repository,
|
||||
TrainInfo trainInfo, List<RoutePath> routePathList, Section nextPlanSection) {
|
||||
Section section = repository.getByCode(trainInfo.getPhysicalSection(), Section.class); // 列车所在区段
|
||||
Section planSection = repository.getByCode(trainInfo.getPlanStandTrack(), Section.class); //列车计划区段
|
||||
List<Route> triggerList = new ArrayList<>();
|
||||
if (!routePathList.isEmpty()) {
|
||||
RoutePath routePath = this.selectRoutePath(routePathList);
|
||||
@ -194,11 +193,11 @@ public abstract class AtsRouteSelectService {
|
||||
other.getGroupNumber(), route.getStart().getName())));
|
||||
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 (trainInfo.isCommunicable() && route.isAtp()) {
|
||||
if (ctcLevel && route.isAtp()) {
|
||||
triggerList.add(route);
|
||||
} else if (!trainInfo.isCommunicable() && route.isGround()) {
|
||||
} else if (!ctcLevel && route.isGround()) {
|
||||
triggerList.add(route);
|
||||
}
|
||||
} else {
|
||||
@ -210,16 +209,17 @@ public abstract class AtsRouteSelectService {
|
||||
if (triggerList.size() == 1) {
|
||||
return new RouteSelectResult(triggerList.get(0), false);
|
||||
} else if (triggerList.size() > 1) {
|
||||
if (planSection.equals(triggerList.get(0).getLastRouteSection()) && nextPlanSection != null) {
|
||||
// 进路是计划站台轨,根据后续计划筛选
|
||||
List<RoutePath> routePaths = repository.getRoutePaths(planSection, nextPlanSection);
|
||||
for (Route temp : triggerList) {
|
||||
if (routePaths.get(0).containsAllSections(temp.getOverlap().getFirstPath().getSectionList())) {
|
||||
return new RouteSelectResult(temp, false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// if (planSection.equals(triggerList.get(0).getLastRouteSection()) && nextPlanSection != null) {
|
||||
// // 进路是计划站台轨,根据后续计划筛选
|
||||
// List<RoutePath> routePaths = repository.getRoutePaths(planSection, nextPlanSection);
|
||||
// for (Route temp : triggerList) {
|
||||
// if (routePaths.get(0).containsAllSections(temp.getOverlap().getFirstPath().getSectionList())) {
|
||||
// return new RouteSelectResult(temp, false);
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// 取第一个延续保护道岔定位的
|
||||
Route route = null;
|
||||
for (Route temp : triggerList) {
|
||||
List<SwitchElement> switchList = temp.getOverlap().getFirstPath().getSwitchList();
|
||||
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertCollectionNotEmpty(switchList,
|
||||
@ -228,9 +228,12 @@ public abstract class AtsRouteSelectService {
|
||||
triggerList.stream().map(Route::getName).collect(Collectors.joining(","))));
|
||||
if (switchList.get(0).isNormal()) {
|
||||
return new RouteSelectResult(temp, false);
|
||||
} else {
|
||||
route = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
return new RouteSelectResult(route, false);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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.data.SimulationDataRepository;
|
||||
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.onboard.ATP.OnboardAtpApiService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -59,6 +60,10 @@ public class AtsTrainStageHandler {
|
||||
AtsStageService stageService = this.getStageService(trainInfo);
|
||||
if (parkSection.isTransferTrack()) { // 转换轨
|
||||
stageService.handleTransferTrackParking(simulation, trainInfo, parkSection);
|
||||
List<RoutePath> routePathList = repository.queryRoutePathsByEnd(parkSection);
|
||||
if (routePathList.get(0).isRight() == trainInfo.getRight()) { //准备回库
|
||||
trainInfo.finishPlanPrepareInbound();
|
||||
}
|
||||
} else if (parkSection.isNormalStandTrack()) { // 正常站台轨
|
||||
stageService.handleNormalStandParking(simulation, trainInfo, parkSection);
|
||||
List<Stand> standList = parkSection.getStandList();
|
||||
|
Loading…
Reference in New Issue
Block a user