联锁侧防数据生成、保存、仿真构建流程调试修改

联锁进路控制添加侧防逻辑(延续保护侧防逻辑还没有加),触发区段使用逻辑区段
联锁进路信号机添加 "级别" 概念和逻辑
This commit is contained in:
walker-sheng 2021-01-14 19:07:32 +08:00
parent 8eb906de23
commit eeeec1db01
14 changed files with 401 additions and 134 deletions

View File

@ -222,6 +222,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
List<RouteFls> flsList = new ArrayList<>();
if (config.isGenerateFls()) {
Map<String, RouteFls> flsMap = this.generateFls(switchList);
flsList = new ArrayList<>(flsMap.values());
for (Route route : generatedRouteList) {
// 进路道岔侧防
List<RouteFls> routeFlsList = new ArrayList<>();
@ -1903,6 +1904,27 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
overlapList.add(routeOverlap);
}
}
// 处理延续保护只有区段且区段有逻辑区段的情况延续保护区段更换为逻辑区段
for (RouteOverlap overlap : overlapList) {
List<SectionPath> pathList = overlap.getPathList();
for (SectionPath sectionPath : pathList) {
if (CollectionUtils.isEmpty(sectionPath.getSwitchList())) {
// 非道岔延续保护
List<Section> logicOverlapList = new ArrayList<>();
List<Section> sectionList = sectionPath.getSectionList();
Section section = sectionList.get(0);
List<Section> logicList = section.getLogicList();
if (!CollectionUtils.isEmpty(logicList)) {
Section logic = logicList.get(0);
if (!end.isRight()) {
logic = logicList.get(logicList.size() - 1);
}
logicOverlapList.add(logic);
}
sectionPath.setLogicList(logicOverlapList);
}
}
}
return overlapList;
}
@ -2176,11 +2198,40 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
boolean right = !signal.isRight(); // 信号机反方向
Section section = signal.getSection();
if (config.isSignalApproachOnlyOne()) {
approachPathList.add(new SectionPath(right, null, Arrays.asList(section)));
approachPathList.add(new SectionPath(right, null, Arrays.asList(section), new ArrayList<>()));
} else {
float l = 600; // 接近距离默认600m
getApproachPathOf(section, right, l, new SectionPath(right), config, approachPathList);
}
for (SectionPath sectionPath : approachPathList) {
float len = 0;
List<Section> logicApproachList = new ArrayList<>();
List<Section> sectionList = sectionPath.getSectionList();
for (Section phySection : sectionList) {
if(len >= 600) break;
if (phySection.isSwitchTrack()) {
len += phySection.getLen();
logicApproachList.add(phySection);
continue;
}
List<Section> logicList = phySection.getLogicList();
if (CollectionUtils.isEmpty(logicList)) {
len += phySection.getLen();
logicApproachList.add(phySection);
continue;
}
List<Section> sortedList = new ArrayList<>(logicList);
if (signal.isRight()) {
Collections.reverse(sortedList);
}
for (Section logic : sortedList) {
logicApproachList.add(logic);
len += logic.getLen();
if(len >= 600) break;
}
}
sectionPath.setLogicList(logicApproachList);
}
signal.setApproachPathList(approachPathList);
signal.setRouteReleaseTime(config.getRouteReleaseTime());
}

View File

@ -211,6 +211,20 @@ public class AtsPlanService {
Station station = lastStationPlan.getStation();
// 列车是否到达终点站的折返轨且列车应该已经到达过最后一个车站
if (axleSection.isTurnBackTrack() && Objects.equals(station, axleSection.getStation())) {
// 判断是否整个车停在折返轨
Section pre = axleSection.getSectionOf(!right);
if (axleSection.isSwitchTrack()) {
if (pre == null) {
pre = axleSection.getRelSwitch().getA().getSectionOf(!right);
}
if (pre != null && pre.isOccupied()) {
return false;
}
} else {
if (pre.isOccupied()) {
return false;
}
}
if (tripPlan.isTurnBackSection(axleSection)) { // 列车在计划折返轨
return true;
} else { // 若列车不在计划的折返轨判断车次最后到达车站计划到列车位置进路是否到列车当前位置

View File

@ -671,8 +671,10 @@ public class AtsRouteSettingService {
* @return
*/
private Signal queryApproachCloseSignal(Simulation simulation, TrainInfo train, Section section, Boolean right) {
SimulationDataRepository repository = simulation.getRepository();
Section base = section;
Signal target = null;
Section logic = repository.getByCode(train.getSection(), Section.class);
int count = 0;
while (Objects.nonNull(base) && count < 10) {
++count;
@ -684,7 +686,7 @@ public class AtsRouteSettingService {
continue;
}
// 信号机存在,判定信号关闭接近区段
if (signal.isApproachSection(section.getCode())) {
if (signal.isApproachSection(train.getSection())) {
target = signal;
}
break;

View File

@ -329,50 +329,53 @@ public class RouteService {
*/
public void settingProgress(Simulation simulation, Route route) {
if (route.isSetting()) { // 进路排列中
if (Objects.isNull(route.getSettingStartTime())) {//旧数据兼容逻辑
route.setSettingStartTime(simulation.getSystemTime());
}
if (simulation.getSystemTime().isAfter(route.getSettingStartTime().plusSeconds(10))) {
route.settingFailed();
simulation.getRepository().removeSettingRoute(route);
log.info(String.format("进路[%s]办理失败取消办理2", route.debugStr()));
return;
MapConfig config = simulation.getRepository().getConfig();
if (!config.isRouteSettingNoFail()) {
if (Objects.isNull(route.getSettingStartTime())) {//旧数据兼容逻辑
route.setSettingStartTime(simulation.getSystemTime());
}
if (simulation.getSystemTime().isAfter(route.getSettingStartTime().plusSeconds(10))) {
route.settingFailed();
simulation.getRepository().removeSettingRoute(route);
log.info(String.format("进路[%s]办理失败取消办理2", route.debugStr()));
return;
}
}
route.setLock(true);
route.getStart().setLockedRoute(route);
MapConfig config = simulation.getRepository().getConfig();
if (!route.isRequisition()) {
// 征用设备
// 预先锁闭
boolean right = route.getStart().isRight();
if (config.isLockFirst()) {
// 进路排列区段预先锁闭
List<Section> sectionList = route.getSectionList();
for (Section section : sectionList) {
if (section.isSwitchTrack()) {
Switch relSwitch = section.getRelSwitch();
relSwitch.getA().routeLocking(right);
if (relSwitch.isNormalPosition()) { // 定位
relSwitch.getB().routeLocking(right);
relSwitch.getC().routeUnlocking(right);
} else if (relSwitch.isReversePosition()) { // 反位
relSwitch.getC().routeLocking(right);
relSwitch.getB().routeUnlocking(right);
} else { // 失表
relSwitch.getB().routeLocking(right);
relSwitch.getC().routeLocking(right);
}
} else {
section.routeLocking(right);
boolean right = route.getStart().isRight();
// 预先锁闭
if (config.isLockFirst()) {
// 进路排列区段预先锁闭
List<Section> sectionList = route.getSectionList();
for (Section section : sectionList) {
if (section.isSwitchTrack()) {
Switch relSwitch = section.getRelSwitch();
relSwitch.getA().routeLocking(right);
if (relSwitch.isNormalPosition()) { // 定位
relSwitch.getB().routeLocking(right);
relSwitch.getC().routeUnlocking(right);
} else if (relSwitch.isReversePosition()) { // 反位
relSwitch.getC().routeLocking(right);
relSwitch.getB().routeUnlocking(right);
} else { // 失表
relSwitch.getB().routeLocking(right);
relSwitch.getC().routeLocking(right);
}
} else {
section.routeLocking(right);
}
}
}
if (!route.isRequisition()) {
// 征用设备
// 道岔位置转换
List<SwitchElement> switchList = route.getSwitchList();
this.routeSwitchTurn(simulation, switchList);
route.updateRequisition(true);
return;
}
this.routeFlsControl(simulation, route);
// 设备已征用检查进路条件
boolean onPosition = this.checkSwitchPosition(simulation, route);
if (!onPosition) { // 还未转换到位置
@ -390,6 +393,26 @@ public class RouteService {
}
}
private void routeFlsControl(Simulation simulation, Route route) {
// 侧防道岔转换
List<RouteFls> flsList = route.getFlsList();
if (!CollectionUtils.isEmpty(flsList)) {
List<SwitchElement> switchElementList = new ArrayList<>();
for (RouteFls routeFls : flsList) {
List<RouteFls.FlsElement> level1List = routeFls.getLevel1List();
for (RouteFls.FlsElement flsElement : level1List) {
SwitchElement pSwitch = flsElement.getPSwitch();
if (pSwitch != null) {
switchElementList.add(pSwitch);
} else if (flsElement.getFpae() != null) {
switchElementList.add(flsElement.getFpae());
}
}
}
this.routeSwitchTurn(simulation, switchElementList);
}
}
private boolean checkSwitchPosition(Simulation simulation, Route route) {
Set<Switch> sectionRelSwitches = route.getSectionList().stream().map(Section::getRelSwitch).collect(Collectors.toSet());
List<SwitchElement> switchList;
@ -427,11 +450,15 @@ public class RouteService {
MapConfig config = simulation.getRepository().getConfig();
boolean right = overlap.isRight();
SectionPath sectionPath = overlap.selectPath();
if (!overlap.isRequisition()) { // 设备征用
// 延续保护位置转动
// 延续保护区段预先锁闭
List<Section> sectionList = sectionPath.getSectionList();
if (config.isLockFirst()) {
// 延续保护区段预先锁闭
List<Section> logicList = sectionPath.getLogicList();
if (config.isLockFirst()) {
if (!CollectionUtils.isEmpty(logicList)) {
for (Section section : logicList) {
section.overlapLocking(right);
}
} else {
List<Section> sectionList = sectionPath.getSectionList();
for (Section section : sectionList) {
if (section.isSwitchTrack()) {
Switch relSwitch = section.getRelSwitch();
@ -451,6 +478,9 @@ public class RouteService {
}
}
}
}
if (!overlap.isRequisition()) { // 设备征用
// 延续保护位置转动
// 道岔位置转换
List<SwitchElement> pathSwitchList = sectionPath.getPathSwitchElementList();
this.routeSwitchTurn(simulation, pathSwitchList);
@ -529,7 +559,6 @@ public class RouteService {
if (section.isSwitchTrack()) {
// 道岔锁闭
Switch relSwitch = section.getRelSwitch();
relSwitch.routeLock();
if (relSwitch.isNormalPosition()) {
relSwitch.getC().routeUnlocking(right);
} else if (relSwitch.isReversePosition()) {
@ -537,18 +566,31 @@ public class RouteService {
}
}
}
// // 道岔锁闭
// for (SwitchElement element : route.getSwitchList()) {
// Switch aSwitch = element.getASwitch();
// aSwitch.routeLock();
// if (simulation.getRepository().getConfig().isLockFirst()) {
// if (element.isNormal()) {
// aSwitch.getC().routeUnlocking(right);
// } else {
// aSwitch.getB().routeUnlocking(right);
// }
// }
// }
// 道岔锁闭
for (SwitchElement element : route.getSwitchList()) {
Switch aSwitch = element.getASwitch();
aSwitch.routeLock();
}
// 侧防锁闭
List<RouteFls> flsList = route.getFlsList();
if (!CollectionUtils.isEmpty(flsList)) {
for (RouteFls routeFls : flsList) {
for (RouteFls.FlsElement flsElement : routeFls.getLevel1List()) {
SwitchElement pSwitch = flsElement.getPSwitch();
if (pSwitch != null) {
Switch aSwitch = pSwitch.getASwitch();
if (aSwitch.isOnPosition(pSwitch.isNormal())) {
aSwitch.fpLock();
}
} else {
SwitchElement fpae = flsElement.getFpae();
if (fpae != null && fpae.getASwitch().isOnPosition(fpae.isNormal())) {
fpae.getASwitch().fpLock();
}
}
}
}
}
// 延续保护
if (!route.isCbtcMode()) {
RouteOverlap overlap = route.getOverlap();
@ -648,6 +690,13 @@ public class RouteService {
aSwitch.routeUnlock();
});
}
// 进路侧防取消锁闭
List<RouteFls> flsList = route.getFlsList();
if (!CollectionUtils.isEmpty(flsList)) {
for (RouteFls routeFls : flsList) {
routeFls.unlock();
}
}
// 进路延续保护解锁
RouteOverlap overlap = route.getOverlap();
if (Objects.nonNull(overlap)) {
@ -709,32 +758,35 @@ public class RouteService {
* @return
*/
public boolean isInterlocked(Route route) {
Route.CheckFailMessage failMessage;
if (route.isOpenGuide()) {
failMessage = this.guideRouteCheck(route);
} else {
failMessage = this.baseCheck(route);
}
if (Objects.nonNull(failMessage)) {
log.debug(String.format("联锁网络检查失败:[%s]", failMessage.toJson()));
// Route.CheckFailMessage failMessage;
// if (route.isOpenGuide()) {
// failMessage = this.guideRouteCheck(route);
// } else {
// failMessage = this.baseCheck(route);
// }
// if (Objects.nonNull(failMessage)) {
// log.debug(String.format("联锁网络检查失败:[%s]", failMessage.toJson()));
// return false;
// }
int level = checkRouteLevel(route);
route.getStart().setLevel(level);
if (level != 3) {
return false;
}
return true;
}
private int checkRouteLevel(Route route) {
int level = 1;
// 进路区段检查
boolean right = route.getStart().isRight();
List<Section> sectionList = route.getSectionList();
for (Section section : sectionList) {
if (!section.isRouteLockOn(right)) {
return false;
return level;
}
if (section.isNoStatus()) {
return false;
}
}
// 站台紧急停车
if (!CollectionUtils.isEmpty(route.getEspList())) {
for (ESP esp : route.getEspList()) {
if (esp.isEffective()) {
return false;
}
return level;
}
}
// 道岔位置一致检查
@ -754,7 +806,41 @@ public class RouteService {
}
log.debug(String.format("联锁网络检查失败:道岔[%s(%s)]位置[%s]",
element.getASwitch().getName(), element.getASwitch().getCode(), p));
return false;
return level;
}
}
level = 2; // 引导级
// 进路侧防检查
List<RouteFls> flsList = route.getFlsList();
if (!route.isOpenGuide() && !CollectionUtils.isEmpty(flsList)) {
boolean level1Result = true;
for (RouteFls routeFls : flsList) {
List<RouteFls.FlsElement> level1List = routeFls.getLevel1List();
for (RouteFls.FlsElement flsElement : level1List) {
SwitchElement pSwitch = flsElement.getPSwitch();
if (pSwitch != null && !pSwitch.getASwitch().isOnPosition(pSwitch.isNormal())) {
level1Result = false;
break;
} else {
SwitchElement fpae = flsElement.getFpae();
Signal pSignal = flsElement.getPSignal();
if ((pSignal != null && !pSignal.isClose()) ||
(fpae != null && !fpae.getASwitch().isOnPosition(fpae.isNormal()))) {
level1Result = false;
}
}
}
}
if (!level1Result) {
return level;
}
}
// 站台紧急停车
if (!CollectionUtils.isEmpty(route.getEspList())) {
for (ESP esp : route.getEspList()) {
if (esp.isEffective()) {
return level;
}
}
}
// 首区段检查
@ -767,53 +853,53 @@ public class RouteService {
Collections.reverse(logicList);
}
if (logicList.get(0).isOccupied()) {
return false;
return level;
}
} else {
if (firstRouteSection.isOccupied()) {
return false;
}
}
// 如果进路区段中有站台轨站台屏蔽门开着需要关灯
List<Section> standTracks = sectionList.stream().filter(Section::isStandTrack).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(standTracks)) {
for (Section standTrack : standTracks) {
List<Stand> standList = standTrack.getStandList();
if (standList.stream().anyMatch(stand -> stand.getPsd() != null && !stand.getPsd().isCloseAndLock()))
return false;
return level;
}
}
// // 如果进路区段中有站台轨站台屏蔽门开着需要关灯
// List<Section> standTracks = sectionList.stream().filter(Section::isStandTrack).collect(Collectors.toList());
// if (!CollectionUtils.isEmpty(standTracks)) {
// for (Section standTrack : standTracks) {
// List<Stand> standList = standTrack.getStandList();
// if (standList.stream().anyMatch(stand -> stand.getPsd() != null && !stand.getPsd().isCloseAndLock()))
// return false;
// }
// }
} else { // 后备模式检查
// 区段占用检查
Route.CheckFailMessage checkFailMessage = this.ciLevelCheck(route);
if (Objects.nonNull(checkFailMessage)) {
log.debug(String.format("联锁网络检查失败:[%s]", checkFailMessage.toJson()));
return false;
return level;
}
// 屏蔽门
// if (!CollectionUtils.isEmpty(route.getPsdList())) {
// for (PSD psd : route.getPsdList()) {
// if (!psd.isCloseAndLock()) {
// log.debug(String.format("联锁网络检查失败:站台[%s(%s)]屏蔽门[%s(%s)]未关闭",
// psd.getStand().getName(), psd.getStand().getCode(),
// psd.getName(), psd.getCode()));
// return false;
// }
// }
// }
if (!CollectionUtils.isEmpty(route.getPsdList())) {
for (PSD psd : route.getPsdList()) {
if (!psd.isCloseAndLock()) {
log.debug(String.format("联锁网络检查失败:站台[%s(%s)]屏蔽门[%s(%s)]未关闭",
psd.getStand().getName(), psd.getStand().getCode(),
psd.getName(), psd.getCode()));
return level;
}
}
}
// 站台扣车
if (!CollectionUtils.isEmpty(route.getStandHoldList())) {
for (Stand stand : route.getStandHoldList()) {
if (stand.isHoldTrain()) {
log.debug(String.format("联锁网络检查失败:站台[%s(%s)]扣车",
stand.getName(), stand.getCode()));
return false;
return level;
}
}
}
}
return true;
level = 3; // 主信号级
return level;
}
/**
@ -958,6 +1044,10 @@ public class RouteService {
SwitchElement switchElement = route.getRouteSwitchElement(relSwitch);
section.routeUnlocking(right);
relSwitch.routeUnlock();
RouteFls routeFls = route.getRouteFlsOfSwitch(relSwitch);
if (routeFls != null) {
routeFls.unlock();
}
} else {
section.routeUnlocking(right);
}
@ -982,7 +1072,11 @@ public class RouteService {
}
private void overlapLock(SectionPath sectionPath, boolean right) {
for (Section section : sectionPath.getSectionList()) {
List<Section> sectionList = sectionPath.getSectionList();
if (!CollectionUtils.isEmpty(sectionPath.getLogicList())) {
sectionList = sectionPath.getLogicList();
}
for (Section section : sectionList) {
if (section.isSwitchTrack()) {
Switch relSwitch = section.getRelSwitch();
relSwitch.overlapLock();
@ -1086,10 +1180,20 @@ public class RouteService {
overlap.releaseImmediately();
} else {
boolean allUnlock = true;
for (Section section : sectionPath.getSectionList()) {
if (section.isOverlapLock()) {
allUnlock = false;
break;
List<Section> logicList = sectionPath.getLogicList();
if (!CollectionUtils.isEmpty(logicList)) {
for (Section section : logicList) {
if (section.isOverlapLock()) {
allUnlock = false;
break;
}
}
} else {
for (Section section : sectionPath.getSectionList()) {
if (section.isOverlapLock()) {
allUnlock = false;
break;
}
}
}
if (allUnlock) {
@ -1118,12 +1222,23 @@ public class RouteService {
break;
}
}
List<Section> sectionList = path.getSectionList();
for (Section section : sectionList) {
if (section.isLockedOn(!right)) {
// 区段锁闭在相反方向
setting = false;
break;
List<Section> logicList = path.getLogicList();
if (!CollectionUtils.isEmpty(logicList)) {
for (Section section : logicList) {
if (section.isLockedOn(!right)) {
// 区段锁闭在相反方向
setting = false;
break;
}
}
} else {
List<Section> sectionList = path.getSectionList();
for (Section section : sectionList) {
if (section.isLockedOn(!right)) {
// 区段锁闭在相反方向
setting = false;
break;
}
}
}
if (setting) {
@ -1135,8 +1250,15 @@ public class RouteService {
for (SwitchElement element : settingPath.getSwitchList()) {
element.getASwitch().overlapLock();
}
for (Section section : settingPath.getSectionList()) {
section.overlapLocking(right);
List<Section> logicList = settingPath.getLogicList();
if (!CollectionUtils.isEmpty(logicList)) {
for (Section section : logicList) {
section.overlapLocking(right);
}
} else {
for (Section section : settingPath.getSectionList()) {
section.overlapLocking(right);
}
}
overlap.setLock(true);
}

View File

@ -1073,6 +1073,16 @@ public class InterlockBuilder2 {
sectionList.add(section);
}
}
// 逻辑区段
List<Section> logicList = new ArrayList<>();
List<String> logicCodeList = sectionPathVO.getLogicList();
if (!CollectionUtils.isEmpty(logicCodeList)) {
for (String code : logicCodeList) {
Section logic = ((Section) elementMap.get(code));
Objects.requireNonNull(logic, String.format("编码为[%s]的区段不存在", code));
logicList.add(logic);
}
}
// 路径中道岔
List<MapCISwitchVO> switchPositionList = sectionPathVO.getSwitchPositionList();
List<SwitchElement> switchElementList = new ArrayList<>();
@ -1164,7 +1174,7 @@ public class InterlockBuilder2 {
++i;
}
}
return new SectionPath(sectionPathVO.isRight(), switchElementList, sectionList);
return new SectionPath(sectionPathVO.isRight(), switchElementList, sectionList, logicList);
}
private static void checkBetweenRouteSameDirectionSignal(Map<String, MapElement> elementMap, List<String> errMsgList) {

View File

@ -31,6 +31,11 @@ public class MapConfig {
*/
private boolean lockFirst;
/**
* 进路办理不失败一直尝试办理
*/
private boolean routeSettingNoFail;
/**
* 列车停站开门后才办理出站进路开放出站信号机
*/
@ -148,6 +153,7 @@ public class MapConfig {
if (Objects.nonNull(configVO)) {
setUpRight(configVO.getUpRight());
setLockFirst(configVO.getLockFirst());
setRouteSettingNoFail(configVO.isRouteSettingNoFail());
setSignalOpenAfterParking(configVO.isSignalOpenAfterParking());
this.setStandHoldCloseLogicLight(configVO.isStandHoldCloseLogicLight());
setCtcOverlapOnlyTurnBackStationLock(configVO.isCtcOverlapOnlyTurnBackStationLock());

View File

@ -466,6 +466,17 @@ public class Route extends MapNamedElement {
return Objects.equals(this.getLastRouteSection(), section);
}
public RouteFls getRouteFlsOfSwitch(Switch aSwitch) {
if (!CollectionUtils.isEmpty(this.flsList)) {
for (RouteFls routeFls : flsList) {
if (Objects.equals(routeFls.getBase().getASwitch(), aSwitch)) {
return routeFls;
}
}
}
return null;
}
/**
* 进路检查失败原因
*/

View File

@ -47,6 +47,20 @@ public class RouteFls {
return this.level1List != null && !this.level1List.isEmpty();
}
public void unlock() {
for (RouteFls.FlsElement flsElement : this.getLevel1List()) {
SwitchElement pSwitch = flsElement.getPSwitch();
if (pSwitch != null) {
pSwitch.getASwitch().fpUnlock();
} else {
SwitchElement fpae = flsElement.getFpae();
if (fpae != null) {
fpae.getASwitch().fpUnlock();
}
}
}
}
/**
* 侧防元件
*/

View File

@ -26,32 +26,29 @@ public class SectionPath {
/** 道岔位置(如果有道岔的话) */
private List<SwitchElement> switchList;
/** 侧防 */
/** 延续保护侧防 */
private List<RouteFls> flsList;
private List<Section> sectionList;
private List<Section> logicList;
public SectionPath(boolean right) {
this.right = right;
this.switchList = new ArrayList<>();
this.sectionList = new ArrayList<>();
this.logicList = new ArrayList<>();
}
public SectionPath(boolean right, List<SwitchElement> switchList, List<Section> sectionList) {
public SectionPath(boolean right, List<SwitchElement> switchList, List<Section> sectionList, List<Section> logicList) {
this.right = right;
this.switchList = switchList;
this.sectionList = sectionList;
}
public SectionPath(boolean right, List<SwitchElement> switchList, List<Section> sectionList, List<RouteFls> flsList) {
this.right = right;
this.switchList = switchList;
this.sectionList = sectionList;
this.flsList = flsList;
this.logicList = logicList;
}
public SectionPath cloneNew() {
return new SectionPath(this.right, new ArrayList<>(this.switchList), new ArrayList<>(this.sectionList));
return new SectionPath(this.right, new ArrayList<>(this.switchList), new ArrayList<>(this.sectionList), new ArrayList<>(this.logicList));
}
public void addSection(Section section) {

View File

@ -127,6 +127,11 @@ public class Signal extends MayOutOfOrderDevice {
*/
private Route lockedRoute;
/**
* 信号级别0-不可用1-关闭2-引导级3-主信号级
*/
private int level;
/**
* 是否封锁
*/
@ -232,16 +237,25 @@ public class Signal extends MayOutOfOrderDevice {
.collect(Collectors.toMap
((switchElement -> switchElement.getASwitch().getCode()),
Function.identity()));
for (Section approach : path.getSectionList()) {
if (approach.isSamePhysical(sectionCode)) {
return true;
} else if (approach.isSwitchTrack()) {
Switch relSwitch = approach.getRelSwitch();
SwitchElement element = elementMap.get(relSwitch.getCode());
if (relSwitch.isOnPosition(element.isNormal())) {
continue;
} else {
break;
List<Section> logicList = path.getLogicList();
if (!CollectionUtils.isEmpty(logicList)) {
for (Section logic : logicList) {
if (logic.isSamePhysical(sectionCode)) {
return true;
}
}
} else {
for (Section approach : path.getSectionList()) {
if (approach.isSamePhysical(sectionCode)) {
return true;
} else if (approach.isSwitchTrack()) {
Switch relSwitch = approach.getRelSwitch();
SwitchElement element = elementMap.get(relSwitch.getCode());
if (relSwitch.isOnPosition(element.isNormal())) {
continue;
} else {
break;
}
}
}
}

View File

@ -64,6 +64,11 @@ public class Switch extends MayOutOfOrderDevice {
*/
private boolean routeLock;
/**
* 是否进路侧防锁闭
*/
private boolean fpLock;
/**
* 是否进路延续保护锁闭
*/
@ -120,7 +125,7 @@ public class Switch extends MayOutOfOrderDevice {
* @return
*/
public boolean isLocked() {
return this.singleLock || this.routeLock || this.overlapLock;
return this.singleLock || this.routeLock || this.overlapLock || this.isFpLock();
}
/**
@ -229,6 +234,14 @@ public class Switch extends MayOutOfOrderDevice {
this.overlapLock = false;
}
public void fpLock() {
this.fpLock = true;
}
public void fpUnlock() {
this.fpLock = false;
}
public void overlapLock() {
this.overlapLock = true;
}

View File

@ -21,6 +21,11 @@ public class RealLineConfigVO {
@ApiModelProperty(value = "进路办理是否先锁闭——开始办理直接先锁闭区段(如福州一号线)")
private Boolean lockFirst = false;
/**
* 进路办理不失败
*/
private boolean routeSettingNoFail = false;
@ApiModelProperty(value = "是否列车停站开门后,才办理出站进路开放出站信号机")
private boolean signalOpenAfterParking = false;

View File

@ -118,10 +118,12 @@ public class MapRouteFlankProtectionNewVO {
@ApiModelProperty(value = "侧防区域元件")
private MapCISwitchVO areaSwitch;
public static List<Level> convertBO2VOList(List<RouteFls.FlsElement> level1List) {
public static List<Level> convertBO2VOList(List<RouteFls.FlsElement> flsElementList) {
List<Level> list = new ArrayList<>();
for (RouteFls.FlsElement flsElement : level1List) {
list.add(fromBO(flsElement));
if (!CollectionUtils.isEmpty(flsElementList)) {
for (RouteFls.FlsElement flsElement : flsElementList) {
list.add(fromBO(flsElement));
}
}
return list;
}

View File

@ -25,6 +25,8 @@ public class MapSectionPathVO {
private List<String> flsList;
private List<String> logicList;
public MapSectionPathVO(boolean right, List<String> sectionList, List<MapCISwitchVO> switchPositionList) {
this.right = right;
this.sectionList = sectionList;
@ -52,6 +54,10 @@ public class MapSectionPathVO {
if (!CollectionUtils.isEmpty(sectionPath.getFlsList())) {
vo.setFlsList(sectionPath.getFlsList().stream().map(RouteFls::getCode).collect(Collectors.toList()));
}
List<Section> logicList = sectionPath.getLogicList();
if (!CollectionUtils.isEmpty(logicList)) {
vo.setLogicList(logicList.stream().map(Section::getCode).collect(Collectors.toList()));
}
return vo;
}
}