Merge remote-tracking branch 'origin/test' into third-part-control

This commit is contained in:
walker-sheng 2021-06-09 18:30:19 +08:00
commit 09de047a74
3 changed files with 22 additions and 24 deletions

View File

@ -177,6 +177,7 @@ public class CILogicLoop {
for (RouteOverlap overlap : overlapList) {
if (overlap.isLock()) {// 延续保护已锁闭
this.routeService.overlapUnlock(simulation, overlap);
this.routeService.overlapCancelLock(overlap);
} else {
// 延续保护锁闭禁止条件释放
this.routeService.checkAndAllowOverlap(simulation, overlap);

View File

@ -1313,15 +1313,18 @@ public class RouteService {
this.checkAndSetLockedRouteOverlap(simulation, route);
}
}
//延续保护锁闭后持续监视
if (overlap != null && overlap.isLock()) {
SectionPath sectionPath = overlap.selectPath();
List<SwitchElement> switchList = sectionPath.getSwitchList();
List<RouteFls> flsList = sectionPath.getFlsList();
boolean onPosition = this.checkRouteSwitchPosition(switchList) && this.isFlsCheckPass(flsList);
if (!onPosition) {
overlap.setLock(false);
}
}
/**
* 延续保护取消锁闭
*/
public void overlapCancelLock(RouteOverlap overlap) {
SectionPath sectionPath = overlap.selectPath();
List<SwitchElement> switchList = sectionPath.getSwitchList();
List<RouteFls> flsList = sectionPath.getFlsList();
boolean onPosition = this.checkRouteSwitchPosition(switchList) && this.isFlsCheckPass(flsList);
if (!onPosition) {
overlap.setLock(false);
}
}
@ -1454,11 +1457,13 @@ public class RouteService {
public void handleTrainStopMessage(Simulation simulation, TrainStopMessage stopMessage) {
// 进路最后一个区段通信车停车进路延续保护立即解锁
Section section = stopMessage.getSection();
if (!section.isRouteLock())
return;
List<RouteOverlap> overlapList = simulation.getRepository()
.getListByType(MapElement.DeviceType.OVERLAP, RouteOverlap.class);
for (RouteOverlap routeOverlap : overlapList) {
Section section = stopMessage.getSection();
if (/*routeOverlap.isLock() && */ routeOverlap.anyElementLocked() && routeOverlap.isRouteLastSection(section)) {
if (routeOverlap.allSectionsOl() && section.isRouteLockOn(routeOverlap.isRight()) && routeOverlap.isRouteLastSection(section)) {
// 是此延续保护的解锁区段立即解锁
routeOverlap.releaseImmediately();
log.debug(String.format("收到列车停稳消息,[%s]延续保护[%s],触发区段[%s(%s)]立即解锁",

View File

@ -237,24 +237,16 @@ public class RouteOverlap extends MapNamedElement {
/**
* 有延续保护的元素处于锁闭状态
*/
public boolean anyElementLocked() {
public boolean allSectionsOl() {
if (!CollectionUtils.isEmpty(this.pathList)) {
for (SectionPath path : this.pathList) {
if (path.getSwitchList().stream().anyMatch(element -> element.getASwitch().isOverlapLock())) {
return true;
}
if (path.getSectionList().stream().anyMatch(Section::isOverlapLock)) {
return true;
}
List<RouteFls> flsList = path.getFlsList();
if (!CollectionUtils.isEmpty(flsList)) {
for (RouteFls routeFls : flsList) {
if (routeFls.anyLocked())
return true;
for (Section s : path.getSectionList()) {
if (!s.isOverlapLock()) {
return false;
}
}
}
}
return false;
return true;
}
}