场景3 道岔失表排列进路逻辑

This commit is contained in:
Jade 2021-11-12 14:29:11 +08:00
parent 582005279f
commit dccba0e918
2 changed files with 24 additions and 5 deletions

View File

@ -44,7 +44,7 @@ public class CiRouteService {
}
}
// 进路中道岔没有被征用或锁定在相反位置
Route.CheckFailMessage failMessage = setSwitchCheck(route.getSwitchList());
Route.CheckFailMessage failMessage = setSwitchCheck(simulation, route.getSwitchList());
if (failMessage != null) {
return failMessage;
}
@ -110,7 +110,7 @@ public class CiRouteService {
RouteOverlap overlap = route.getOverlap();
if (Objects.nonNull(overlap)) {
SectionPath sectionPath = overlap.selectPath();
failMessage = setSwitchCheck(sectionPath.getSwitchList());
failMessage = setSwitchCheck(simulation, sectionPath.getSwitchList());
}
}
return failMessage;
@ -133,7 +133,7 @@ public class CiRouteService {
return null;
}
private static Route.CheckFailMessage setSwitchCheck(List<SwitchElement> switchList) {
private static Route.CheckFailMessage setSwitchCheck(Simulation simulation, List<SwitchElement> switchList) {
if (switchList != null) {
for (SwitchElement switchElement : switchList) {
Switch aSwitch = switchElement.getASwitch();
@ -147,6 +147,13 @@ public class CiRouteService {
if (aSwitch.isCiUseOnOppositePosition(switchElement.isNormal())) { // 道岔征用在相反位置
return new Route.CheckFailMessage(Route.CheckFailReason.SwitchCiUseOnOppositePosition, aSwitch);
}
// 非预先锁闭道岔相应位置失表则不排进路
if (!simulation.getRepository().getConfig().isLockFirst() && aSwitch.isLoss()) {
if ((Switch.SwitchFault.NORMAL_SPLIT.equals(aSwitch.getFault()) && switchElement.isNormal())
|| (Switch.SwitchFault.REVERSE_SPLIT.equals(aSwitch.getFault()) && !switchElement.isNormal())) {
return new Route.CheckFailMessage(Route.CheckFailReason.SwitchFault, aSwitch);
}
}
}
}
return null;

View File

@ -27,11 +27,23 @@ public class CiService {
if (overlap.getSection().isRouteLock()) {
SectionPath sectionPath = overlap.selectPath();
for (SwitchElement switchElement : sectionPath.getSwitchList()) {
if (switchElement.getASwitch().isLocked() && !switchElement.isOnPosition()) {
Switch aSwitch = switchElement.getASwitch();
if (aSwitch.isLocked() && !switchElement.isOnPosition()) {
log.debug("延续保护进路[{}]道岔[{}]锁闭在相反位置,不触发办理", overlap.debugStr(),
switchElement.getASwitch().debugStr());
aSwitch.debugStr());
return;
}
// 非预先锁闭道岔相应位置失表则不排延续保护
if (!simulation.getRepository().getConfig().isLockFirst() && aSwitch.isLoss()) {
if ((Switch.SwitchFault.NORMAL_SPLIT.equals(aSwitch.getFault())
&& switchElement.isNormal())
|| (Switch.SwitchFault.REVERSE_SPLIT.equals(aSwitch.getFault())
&& !switchElement.isNormal())) {
log.debug("延续保护进路[{}]道岔[{}]位置失表,不触发办理", overlap.debugStr(),
aSwitch.debugStr());
return;
}
}
}
overlap.startSetting(simulation.getSystemTime());
}