信号重复封锁逻辑修改
This commit is contained in:
parent
15462ece3a
commit
5a53001eaf
@ -150,18 +150,20 @@ public class CILogicLoop {
|
||||
if (route.isDelayUnlocking()) { // 进路延时解锁过程
|
||||
this.routeService.humanCancelProgress(simulation, route);
|
||||
}
|
||||
if (route.isOpen()) { // 进路信号开放,始终检查联锁条件是否满足
|
||||
this.routeService.openedRouteCheck(simulation, route);
|
||||
if (route.isLock()) { // 进路信号开放,始终检查联锁条件是否满足
|
||||
this.routeService.lockedRouteCheck(simulation, route);
|
||||
}
|
||||
if (route.isLock() || route.isNormalUnlock()) {
|
||||
// 进路第一个区段是否占用
|
||||
Section firstLogicSection = route.getFirstLogicSection();
|
||||
if (route.getStart().getLevel() == Signal.LEVEL_3 &&
|
||||
firstLogicSection.isRouteLock() &&
|
||||
firstLogicSection.isOccupied()) {
|
||||
Section firstRouteSection = route.getFirstRouteLogicSection();
|
||||
if (firstRouteSection.isRouteLock() &&
|
||||
firstRouteSection.isOccupied()) {
|
||||
route.getStart().setReblockade(true);
|
||||
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()) {
|
||||
|
@ -1131,7 +1131,7 @@ public class RouteService {
|
||||
allUnlock = true;
|
||||
}
|
||||
}
|
||||
Section firstRouteSection = route.getFirstRouteSection();
|
||||
Section firstRouteSection = route.getFirstRouteLogicSection();
|
||||
if (firstRouteSection.isFree()) {
|
||||
route.getStart().setReblockade(false);
|
||||
}
|
||||
@ -1200,9 +1200,7 @@ public class RouteService {
|
||||
* @param simulation
|
||||
* @param route
|
||||
*/
|
||||
public void openedRouteCheck(Simulation simulation, Route route) {
|
||||
// if (route.isOpen()) {
|
||||
// this.checkAndSetLockedRouteOverlap(simulation, route);
|
||||
public void lockedRouteCheck(Simulation simulation, Route route) {
|
||||
// 区段锁闭在进路方向上
|
||||
boolean right = route.getStart().isRight();
|
||||
for (Section section : route.getSectionList()) {
|
||||
@ -1210,7 +1208,6 @@ public class RouteService {
|
||||
section.routeLocking(right);
|
||||
}
|
||||
}
|
||||
if (route.isOpen()) {
|
||||
boolean interlocked = this.isInterlocked(route);
|
||||
if (!interlocked) {
|
||||
// 进路信号开放,联锁逻辑不满足,需关闭信号
|
||||
@ -1219,9 +1216,6 @@ public class RouteService {
|
||||
route.debugStr(), route.getStart().getName(), route.getStart().getCode()));
|
||||
}
|
||||
}
|
||||
// this.reLockOverlap(simulation, route);
|
||||
// }
|
||||
}
|
||||
|
||||
public void checkAndSetLockedRouteOverlap(Simulation simulation, Route route) {
|
||||
RouteOverlap overlap = route.getOverlap();
|
||||
|
@ -177,6 +177,19 @@ public class Route extends MapNamedElement {
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取第一个逻辑区段
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user