This commit is contained in:
weizhihong 2023-11-30 14:08:38 +08:00
commit 659b537f75

View File

@ -70,7 +70,7 @@ public class CiRouteService {
return failMessage;
}
// 进路中道岔是否存在和监控中进路延续保护冲突
failMessage = monitorRouteOverlapConflictCheck(simulation, route);
failMessage = monitorRouteOverlapConflictCheck(simulation, route, manual);
if (failMessage != null) {
return failMessage;
}
@ -154,12 +154,12 @@ public class CiRouteService {
}
private static Route.CheckFailMessage monitorRouteOverlapConflictCheck(Simulation simulation,
Route route) {
Route route, boolean manual) {
SimulationDataRepository repository = simulation.getRepository();
List<Route> settingRoutes = repository.getSettingRoutes();
for (Route sr : settingRoutes) {
if (sr.isSettingOverlap() && (sr.getOverlap().isSetting() || sr.getOverlap()
.isLock())/*&& !repository.isTrainParking(sr.getOverlap().getSection())*/) {
if (sr.isSettingOverlap()) {
if (sr.getOverlap().isLock() || (!manual && sr.getOverlap().isSetting())) {
SectionPath sectionPath = sr.getOverlap().selectPath();
for (SwitchElement switchElement : sectionPath.getSwitchList()) {
if (route.isConflictSwitch(switchElement)) {
@ -167,8 +167,24 @@ public class CiRouteService {
switchElement.getASwitch());
}
}
} else if (sr.getOverlap().isSetting() && manual) {
SectionPath sectionPath = sr.getOverlap().selectPath();
for (SwitchElement switchElement : sectionPath.getSwitchList()) {
switchElement.getASwitch().checkAndResetUsePosition();
}
}
}
// if (sr.isSettingOverlap() && (sr.getOverlap().isSetting() || sr.getOverlap()
// .isLock())/*&& !repository.isTrainParking(sr.getOverlap().getSection())*/) {
// SectionPath sectionPath = sr.getOverlap().selectPath();
// for (SwitchElement switchElement : sectionPath.getSwitchList()) {
// if (route.isConflictSwitch(switchElement)) {
// return new Route.CheckFailMessage(Route.CheckFailReason.SwitchCiUseOnOppositePosition,
// switchElement.getASwitch());
// }
// }
// }
}
return null;
}
@ -190,7 +206,6 @@ public class CiRouteService {
if (aSwitch.isCiUseOnOppositePosition(switchElement.isNormal())) { // 道岔征用在相反位置
if (manual && !aSwitch.isLocked()) { // 人工办理优先
aSwitch.checkAndResetUsePosition();
aSwitch.ciUse(switchElement.isNormal());
} else {
return new Route.CheckFailMessage(Route.CheckFailReason.SwitchCiUseOnOppositePosition,
aSwitch);