进路逻辑bug修改

This commit is contained in:
walker-sheng 2021-02-01 13:53:35 +08:00
parent dd434fe399
commit 202e0bb01f

View File

@ -390,27 +390,24 @@ public class RouteService {
log.debug(section.debugStr() + "因<预先锁闭>锁闭"); log.debug(section.debugStr() + "因<预先锁闭>锁闭");
} }
} }
if (!route.isRequisition()) { // 征用设备
// 征用设备 // 道岔位置转换
// 道岔位置转换 List<SwitchElement> switchList = route.getSwitchList();
List<SwitchElement> switchList = route.getSwitchList(); this.routeSwitchTurn(simulation, switchList);
this.routeSwitchTurn(simulation, switchList); this.routeFlsControl(simulation, route.getFlsList());
this.routeFlsControl(simulation, route.getFlsList()); if (config.isLockFirst()) {
if (config.isLockFirst()) { for (SwitchElement switchElement : switchList) {
for (SwitchElement switchElement : switchList) { switchElement.getASwitch().routeLock();
switchElement.getASwitch().routeLock(); }
} if (!CollectionUtils.isEmpty(route.getFlsList())) {
if (!CollectionUtils.isEmpty(route.getFlsList())) { for (RouteFls routeFls : route.getFlsList()) {
for (RouteFls routeFls : route.getFlsList()) { routeFls.lock();
routeFls.lock();
}
} }
} }
route.updateRequisition(true);
return;
} }
// 设备已征用检查进路条件 // 设备已征用检查进路条件
boolean onPosition = this.checkSwitchPosition(simulation, route); boolean onPosition = this.checkSwitchPosition(simulation, route) &&
this.isFlsSwitchOnPosition(route.getFlsList());
if (!onPosition) { // 还未转换到位置 if (!onPosition) { // 还未转换到位置
return; return;
} }
@ -1234,9 +1231,16 @@ public class RouteService {
boolean interlocked = this.isInterlocked(route); boolean interlocked = this.isInterlocked(route);
if (!interlocked) { if (!interlocked) {
// 进路信号开放联锁逻辑不满足需关闭信号 // 进路信号开放联锁逻辑不满足需关闭信号
this.routeClose(simulation, route); if (route.isOpen()) {
log.info(String.format("进路[%s]始端信号联锁条件不满足,信号机[%s(%s)]关灯", this.routeClose(simulation, route);
route.debugStr(), route.getStart().getName(), route.getStart().getCode())); log.info(String.format("进路[%s]始端信号联锁条件不满足,信号机[%s(%s)]关灯",
route.debugStr(), route.getStart().getName(), route.getStart().getCode()));
}
}
if (route.isOpen()) {
if (this.checkCanOverlapSet(simulation, route) && !route.getOverlap().isLock()) {
this.checkAndSetLockedRouteOverlap(simulation, route);
}
} }
} }