添加进路办理检查道岔征用相反位置人工办理优先处理逻辑

This commit is contained in:
walker 2023-11-29 16:52:18 +08:00
parent bdfa4d2992
commit 44e9bd5ec2
1 changed files with 11 additions and 5 deletions

View File

@ -64,7 +64,8 @@ public class CiRouteService {
}
}
// 进路中道岔没有被征用或锁定在相反位置
Route.CheckFailMessage failMessage = setSwitchCheck(simulation, route.getSwitchList(), guide);
Route.CheckFailMessage failMessage = setSwitchCheck(simulation, route.getSwitchList(), guide,
manual);
if (failMessage != null) {
return failMessage;
}
@ -124,7 +125,7 @@ public class CiRouteService {
RouteOverlap overlap = route.getOverlap();
if (Objects.nonNull(overlap)) {
SectionPath sectionPath = overlap.selectPath();
failMessage = setSwitchCheck(simulation, sectionPath.getSwitchList(), guide);
failMessage = setSwitchCheck(simulation, sectionPath.getSwitchList(), guide, manual);
}
}
//敌对进路
@ -172,7 +173,7 @@ public class CiRouteService {
}
private static Route.CheckFailMessage setSwitchCheck(Simulation simulation,
List<SwitchElement> switchList, boolean guide) {
List<SwitchElement> switchList, boolean guide, boolean manual) {
if (switchList != null) {
for (SwitchElement switchElement : switchList) {
Switch aSwitch = switchElement.getASwitch();
@ -187,8 +188,13 @@ public class CiRouteService {
return new Route.CheckFailMessage(Route.CheckFailReason.SwitchLockPositionError, aSwitch);
}
if (aSwitch.isCiUseOnOppositePosition(switchElement.isNormal())) { // 道岔征用在相反位置
return new Route.CheckFailMessage(Route.CheckFailReason.SwitchCiUseOnOppositePosition,
aSwitch);
if (manual && !aSwitch.isLocked()) { // 人工办理优先
aSwitch.checkAndResetUsePosition();
aSwitch.ciUse(switchElement.isNormal());
} else {
return new Route.CheckFailMessage(Route.CheckFailReason.SwitchCiUseOnOppositePosition,
aSwitch);
}
}
//道岔失表时进路中的区段和道岔由远及近锁闭直到失表的道岔处 -南铁院叶老师
if (simulation.getRepository().getConfig().isRouteCanSetWhenSwitchFault()) {