信号重复封锁逻辑修改

This commit is contained in:
walker-sheng 2021-01-25 18:31:28 +08:00
parent 15462ece3a
commit 5a53001eaf
3 changed files with 30 additions and 21 deletions

View File

@ -150,18 +150,20 @@ public class CILogicLoop {
if (route.isDelayUnlocking()) { // 进路延时解锁过程 if (route.isDelayUnlocking()) { // 进路延时解锁过程
this.routeService.humanCancelProgress(simulation, route); this.routeService.humanCancelProgress(simulation, route);
} }
if (route.isOpen()) { // 进路信号开放始终检查联锁条件是否满足 if (route.isLock()) { // 进路信号开放始终检查联锁条件是否满足
this.routeService.openedRouteCheck(simulation, route); this.routeService.lockedRouteCheck(simulation, route);
} }
if (route.isLock() || route.isNormalUnlock()) { if (route.isLock() || route.isNormalUnlock()) {
// 进路第一个区段是否占用 // 进路第一个区段是否占用
Section firstLogicSection = route.getFirstLogicSection(); Section firstRouteSection = route.getFirstRouteLogicSection();
if (route.getStart().getLevel() == Signal.LEVEL_3 && if (firstRouteSection.isRouteLock() &&
firstLogicSection.isRouteLock() && firstRouteSection.isOccupied()) {
firstLogicSection.isOccupied()) {
route.getStart().setReblockade(true); route.getStart().setReblockade(true);
log.debug(String.format("[%s]因[%s]第一个子区段[%s]进路锁闭且占用而重复封锁", log.debug(String.format("[%s]因[%s]第一个子区段[%s]进路锁闭且占用而重复封锁",
route.getStart().debugStr(), route.debugStr(), firstLogicSection.debugStr())); route.getStart().debugStr(), route.debugStr(), firstRouteSection.debugStr()));
}
if (route.isOpen() && !firstRouteSection.isOccupied()) {
route.getStart().setReblockade(false);
} }
} }
// else if (route.isLock() && !route.isNormalUnlock() && !route.isOpen()) { // else if (route.isLock() && !route.isNormalUnlock() && !route.isOpen()) {

View File

@ -1131,7 +1131,7 @@ public class RouteService {
allUnlock = true; allUnlock = true;
} }
} }
Section firstRouteSection = route.getFirstRouteSection(); Section firstRouteSection = route.getFirstRouteLogicSection();
if (firstRouteSection.isFree()) { if (firstRouteSection.isFree()) {
route.getStart().setReblockade(false); route.getStart().setReblockade(false);
} }
@ -1200,9 +1200,7 @@ public class RouteService {
* @param simulation * @param simulation
* @param route * @param route
*/ */
public void openedRouteCheck(Simulation simulation, Route route) { public void lockedRouteCheck(Simulation simulation, Route route) {
// if (route.isOpen()) {
// this.checkAndSetLockedRouteOverlap(simulation, route);
// 区段锁闭在进路方向上 // 区段锁闭在进路方向上
boolean right = route.getStart().isRight(); boolean right = route.getStart().isRight();
for (Section section : route.getSectionList()) { for (Section section : route.getSectionList()) {
@ -1210,17 +1208,13 @@ public class RouteService {
section.routeLocking(right); section.routeLocking(right);
} }
} }
if (route.isOpen()) { boolean interlocked = this.isInterlocked(route);
boolean interlocked = this.isInterlocked(route); if (!interlocked) {
if (!interlocked) { // 进路信号开放联锁逻辑不满足需关闭信号
// 进路信号开放联锁逻辑不满足需关闭信号 this.routeClose(simulation, route);
this.routeClose(simulation, route); log.info(String.format("进路[%s]始端信号联锁条件不满足,信号机[%s(%s)]关灯",
log.info(String.format("进路[%s]始端信号联锁条件不满足,信号机[%s(%s)]关灯", route.debugStr(), route.getStart().getName(), route.getStart().getCode()));
route.debugStr(), route.getStart().getName(), route.getStart().getCode()));
}
} }
// this.reLockOverlap(simulation, route);
// }
} }
public void checkAndSetLockedRouteOverlap(Simulation simulation, Route route) { public void checkAndSetLockedRouteOverlap(Simulation simulation, Route route) {

View File

@ -177,6 +177,19 @@ public class Route extends MapNamedElement {
return this.sectionList.get(0); return this.sectionList.get(0);
} }
public Section getFirstRouteLogicSection() {
Section section = this.sectionList.get(0);
List<Section> logicList = section.getLogicList();
boolean right = this.getStart().isRight();
if (!CollectionUtils.isEmpty(logicList)) {
if (!right) {
return logicList.get(logicList.size() - 1);
}
return logicList.get(0);
}
return section;
}
/** /**
* 获取第一个逻辑区段 * 获取第一个逻辑区段
*/ */