增加“单列车进路”属性生成及使用逻辑

This commit is contained in:
joylink_zhangsai 2023-10-27 16:19:26 +08:00
parent b01ac1dc0f
commit cd92403096
5 changed files with 28 additions and 8 deletions

View File

@ -662,6 +662,8 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
if (!CollectionUtils.isEmpty(routePathList)) {
for (SectionPath sectionPath : routePathList) {
Section lastSection = sectionPath.getLastSection();
//最后一个区段是轨道尽头则认为是单列车进路
boolean singleTrain = lastSection.getNextSection(sectionPath.isRight()) == null;
Signal end = lastSection.getSignalOf(right);
List<RouteOverlap> overlapList = overlapMap.get(end.getCode());
// 根据配置是否有延续保护生成
@ -696,16 +698,16 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
for (RouteOverlap routeOverlap : overlapList) {
String code = routeCodeGenerator.next();
String name = String.format("%s-%s_%s", start.getName(), endName, index);
Route route = this.buildRoute(code, name, start, end, clickEnd, sectionPath,
routeOverlap, config.isRouteSignalAlwaysGreen(), config.isRouteInterlockDoNotIncludeStandHoldTrain());
Route route = this.buildRoute(code, name, start, end, clickEnd, sectionPath, routeOverlap,
config.isRouteSignalAlwaysGreen(), config.isRouteInterlockDoNotIncludeStandHoldTrain(), singleTrain);
routeList.add(route);
++index;
}
} else if (config.isOverlapSettingByTrigger()) { // 触发建立进路不绑定延续保护
String code = routeCodeGenerator.next();
String name = String.format("%s-%s", start.getName(), endName);
Route route = this.buildRoute(code, name, start, end, clickEnd, sectionPath,
null, config.isRouteSignalAlwaysGreen(), config.isRouteInterlockDoNotIncludeStandHoldTrain());
Route route = this.buildRoute(code, name, start, end, clickEnd, sectionPath, null,
config.isRouteSignalAlwaysGreen(), config.isRouteInterlockDoNotIncludeStandHoldTrain(), singleTrain);
routeList.add(route);
} else {
String code = routeCodeGenerator.next();
@ -714,8 +716,8 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
if (!CollectionUtils.isEmpty(overlapList) && overlapList.size() > 0) {
overlap = overlapList.get(0);
}
Route route = this.buildRoute(code, name, start, end, clickEnd, sectionPath,
overlap, config.isRouteSignalAlwaysGreen(), config.isRouteInterlockDoNotIncludeStandHoldTrain());
Route route = this.buildRoute(code, name, start, end, clickEnd, sectionPath, overlap,
config.isRouteSignalAlwaysGreen(), config.isRouteInterlockDoNotIncludeStandHoldTrain(), singleTrain);
routeList.add(route);
}
}
@ -1425,11 +1427,12 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
* @param routeOverlap
* @param alwaysGreen 进路始端信号是否总是开绿灯
* @param noStandHold
* @param singleTrain
* @return
*/
private Route buildRoute(String code, String name,
Signal start, Signal end, Signal endButton,
SectionPath sectionPath, RouteOverlap routeOverlap, boolean alwaysGreen, boolean noStandHold) {
SectionPath sectionPath, RouteOverlap routeOverlap, boolean alwaysGreen, boolean noStandHold, boolean singleTrain) {
Route route = new Route(code, name);
route.setInterlockStation(start.getInterlockStation());
route.setStart(start);
@ -1438,6 +1441,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
route.setSectionList(sectionPath.getSectionList());
route.setSwitchList(sectionPath.getSwitchList());
route.setOverlap(routeOverlap);
route.setSingleTrain(singleTrain);
SignalModel signalModel = start.getSignalModel();
switch (signalModel) {
case RGY:{

View File

@ -61,7 +61,7 @@ public class CiRouteService {
if (failMessage != null) {
return failMessage;
}
// 进路内区段封锁/锁闭方向检查
// 进路内区段封锁/锁闭方向检查||单列车进路区段占用
List<Section> sectionList = route.getSectionList();
for (Section section : sectionList) {
// 封锁状态
@ -83,6 +83,10 @@ public class CiRouteService {
!Objects.equals(section.isLockRight(), start.isRight())) {
return new Route.CheckFailMessage(Route.CheckFailReason.SectionLockOppositeDirection, section);
}
//单列车进路区段占用
if (section.isOccupied() && route.isSingleTrain()) {
return new Route.CheckFailMessage(Route.CheckFailReason.SectionNotFree, section);
}
// 故障占用
for (int i = 0; i < 3; i++) {
if (section.getParent() == null || section.isAxleCounter())

View File

@ -503,6 +503,7 @@ public class InterlockBuilder2 {
route.setFlt(mapRouteVO.isFlt());
route.setArs(mapRouteVO.isArc());
route.setAspect(mapRouteVO.getAspect());
route.setSingleTrain(mapRouteVO.isSingleTrain());
if (route.getAspect() == null) {
errMsgList.add(String.format("进路%s没有配置信号显示", route.debugStr()));
}

View File

@ -157,6 +157,11 @@ public class Route extends MapNamedElement {
*/
private LinkedHashMap<Section, SignalAspect> leaveSectionWithAspectMap;
/**
* 单列车进路指进路中有占用时不能再次排列的进路 -南铁院叶老师
*/
private boolean singleTrain;
// ------------------状态属性---------------------
/**
* ats自动控制

View File

@ -210,6 +210,11 @@ public class MapRouteNewVO {
private LinkedHashMap<String, SignalAspect> leaveSectionWithAspectMap;
/**
* 单列车进路
*/
private boolean singleTrain;
public MapRouteNewVO() {
this.routeSectionList = new ArrayList<>();
this.routeSwitchList = new ArrayList<>();
@ -280,6 +285,7 @@ public class MapRouteNewVO {
.collect(Collectors.toMap(entry -> entry.getKey().getCode(), Map.Entry::getValue, (v1, v2) -> v2, LinkedHashMap::new));
vo.setLeaveSectionWithAspectMap(map);
}
vo.setSingleTrain(route.isSingleTrain());
return vo;
}