大铁引导总锁失表道岔,可办理引导进路

This commit is contained in:
joylink_zhangsai 2022-08-02 13:05:16 +08:00
parent 889e415ddd
commit 4dcf64d9ff
3 changed files with 22 additions and 18 deletions

View File

@ -451,10 +451,15 @@ public class CiApiServiceImpl2 implements CiApiService {
} else if (!CollectionUtils.isEmpty(signal.getRouteList())) {
List<Route> collect;
if (config.isRailway()) { // 大铁配置引导进路
collect = getCtcGuideRouteList(repository, signal);
if (collect == null) {
return;
}
// collect = getCtcGuideRouteList(repository, signal);
// if (collect == null) {
// return;
// }
collect = signal.getRouteList().stream()
.filter(Route::isTrainRoute)
.collect(Collectors.toList());
BusinessExceptionAssertEnum.OPERATION_FAIL.assertCollectionNotEmpty(collect,
signal.debugStr() + "无列车进路");
} else { //如果signal锁闭进路为null筛选最合适的进路直线进路>分叉进路>折返进路
collect = signal.getRouteList().stream()
.filter(r -> !r.isTurnBack() && CollectionUtils.isEmpty(r.getSwitchList()))
@ -743,7 +748,7 @@ public class CiApiServiceImpl2 implements CiApiService {
* @param signal 信号机
*/
private List<Route> getCtcGuideRouteList(SimulationDataRepository repository, Signal signal) {
// 获取信号机开头的进路集合
// 获取信号机开头的进路集合
List<Route> routeList = repository.getRouteList().stream()
.filter(routePojo -> routePojo.isTrainRoute() && routePojo.getStart().getCode().equals(signal.getCode()))
.collect(Collectors.toList());

View File

@ -246,11 +246,11 @@ public class CiRouteService {
List<Route.MultiRouteAspect> multiRouteAspects = route.getMultiRouteAspects();
if (CollectionUtils.isEmpty(multiRouteAspects)) {
// 道岔位置转换
boolean mainRouteSwitchOnPos = this.switchControlService.batchTurnRouteSwitch(simulation, route.getSwitchList());
boolean mainRouteSwitchOnPos = this.switchControlService.ensureSwitchPosCurrent(simulation, route.getSwitchList(), route.isGuideSetting());
// 预先锁闭
if (mainRouteSwitchOnPos || config.isLockFirst()) {
// 进路排列区段预先锁闭
this.checkAndLockRouteMain(route);
this.checkAndLockRouteMain(route, config.isRailway());
}
// 侧防办理
this.flsSetting(simulation, route.getFlsList());
@ -307,18 +307,20 @@ public class CiRouteService {
* 检查并锁闭主进路不包含侧防和延续保护
*
* @param route
* @param railway
*/
private void checkAndLockRouteMain(Route route) {
private void checkAndLockRouteMain(Route route, boolean railway) {
boolean right = route.isRight();
List<Section> sectionList = route.getSectionList();
List<SwitchElement> switchList = route.getSwitchList();
for (SwitchElement switchElement : switchList) {
if (switchElement.isOnPosition()) {
if (switchElement.isOnPosition() || (route.isGuideSetting() && switchElement.getASwitch().isGuideMasterLock())) {
switchElement.getASwitch().routeLock(route);
}
}
for (Section section : sectionList) {
if (section.isSwitchTrack()) {
//大铁引导进路只锁闭指定区段为了解决引导总锁方式办理道岔失表的引导进路时失表道岔的所有区段都锁闭的问题
if (section.isSwitchTrack() && !(railway && route.isGuideSetting())) {
Switch relSwitch = section.getRelSwitch();
relSwitch.sectionRouteLocking(route, right);
} else {
@ -631,7 +633,7 @@ public class CiRouteService {
}
}
// 延续保护位置转动
boolean onPos = this.switchControlService.batchTurnRouteSwitch(simulation, sectionPath.getSwitchList());
boolean onPos = this.switchControlService.ensureSwitchPosCurrent(simulation, sectionPath.getSwitchList(), false);
// 延续保护区段预先锁闭
if (onPos || config.isLockFirst()) {
this.checkAndLockOverlap(simulation, overlap);

View File

@ -158,18 +158,15 @@ public class CiSwitchControlService {
/**
* 批量转动道岔到指定位置
*
* @param simulation
* @param list
*/
public boolean batchTurnRouteSwitch(Simulation simulation, List<SwitchElement> list) {
public boolean ensureSwitchPosCurrent(Simulation simulation, List<SwitchElement> switchElements, boolean guideSetting) {
boolean allOn = true;
if (list == null) {
if (switchElements == null) {
return true;
}
for (SwitchElement switchElement : list) {
for (SwitchElement switchElement : switchElements) {
boolean onPos = this.turnRouteSwitch(simulation, switchElement);
if (!onPos) {
if (!onPos && !(guideSetting && switchElement.getASwitch().isLoss() && switchElement.getASwitch().isGuideMasterLock())) { //不在正确位置并且不是办理引导进路中的引导总锁的失表道岔
allOn = false;
}
}