每次开始触发办理进路时设置开放信号显示

This commit is contained in:
xiazengbin 2022-08-11 17:56:34 +08:00
parent 4073382b85
commit 112ab6cbab
7 changed files with 3254 additions and 3221 deletions

View File

@ -146,6 +146,7 @@ public class AtsRouteService {
collect = fltRoutes;
}
Route route = collect.get(0);
route.setSettedAspect(route.getAspect());
Route.CheckFailMessage message = routeService.setRoute(simulation, route);
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNull(message, route.debugStr() + "无法办理");
route.setFleetMode(true);

View File

@ -6,6 +6,7 @@ import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.constant.SignalAspect;
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
import club.joylink.rtss.simulation.cbtc.data.map.*;
import club.joylink.rtss.simulation.cbtc.data.map.Route.MultiRouteAspect;
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySectionAxleCounter;
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySignal;
import club.joylink.rtss.simulation.cbtc.device.virtual.VirtualRealityDeviceService;
@ -183,6 +184,9 @@ public class CiApiServiceImpl2 implements CiApiService {
@Override
public Route.CheckFailMessage settingRoute(Simulation simulation, String routeCode) {
Route route = simulation.getRepository().getByCode(routeCode, Route.class);
if(!route.isMultiRoute()) {//一般进路
route.setSettedAspect(route.getAspect());
}
return this.routeService.setRoute(simulation, route);
}

View File

@ -33,7 +33,6 @@ public class CiLogic {
private StationDirectionService stationDirectionService;
public void run(Simulation simulation) {
// 采集真实设备状态
deviceStatusCollector.collect(simulation);
// 信号机监控控制
@ -119,6 +118,7 @@ public class CiLogic {
MapConfig config = simulation.getRepository().getConfig();
if (route.isCiControl()) { // 进路联锁自动触发
if (!route.isLock() && !route.isSetting() && ciService.isCiRouteTrigger(simulation, route)) {
route.setSettedAspect(route.getAspect());
routeService.setRoute(simulation, route);
}
} else if (route.isFleetMode()) { // 联锁自动进路

View File

@ -176,6 +176,7 @@ public class CiRouteService {
* 排列引导进路
*/
public void setGuide(Simulation simulation, Route route) {
route.setSettedAspect(route.getStart().getGuideAspect());
// 进路检查
Route.CheckFailMessage failMessage = routeSetCheck(simulation, route, true);
if (failMessage == null) {
@ -286,12 +287,13 @@ public class CiRouteService {
Route.MultiRouteAspect routeAspect = multiRouteAspects.get(i);
Route subRoute = routeAspect.getRoute();
if (!subRoute.isLock()) {
subRoute.setSettedAspect(routeAspect.getAspect());
setRoute(simulation, subRoute);
break;
}
}
//最近的一条进路已经锁闭
if (multiRouteAspects.get(0).getRoute().isLock()) { //
if (multiRouteAspects.get(0).getRoute().isLock()) {
route.settingOver();
}
}

View File

@ -179,7 +179,12 @@ public class Route extends MapNamedElement {
* 进路是否排列中
*/
private boolean setting;
/**
* 该进路办理成功后要开放的信号
* <p>
* 注意每次开始触发办理进路时设置
*/
private SignalAspect settedAspect;
/**
* 进路开始排列时间
*/
@ -251,8 +256,14 @@ public class Route extends MapNamedElement {
this.unlockedSection = null;
this.train = null;
this.checkConflict = false;
this.settedAspect=null;
}
/**
* 是否是组合进路
*/
public boolean isMultiRoute() {
return null!=this.multiRouteAspects&&!this.multiRouteAspects.isEmpty();
}
public boolean isAllSwitchIsOnPos() {
if (!CollectionUtils.isEmpty(switchList)) {
return switchList.stream().allMatch(SwitchElement::isOnPosition);

View File

@ -1,6 +1,7 @@
package club.joylink.rtss.simulation.cbtc.data.storage.device;
import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.constant.SignalAspect;
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
import club.joylink.rtss.simulation.cbtc.data.map.DelayUnlockDevice;
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
@ -85,6 +86,13 @@ public class StorageRoute extends StorageDevice {
private String unlockedSection;
/**
* 该进路办理成功后要开放的信号
* <p>
* 注意每次开始触发办理进路时设置
*/
private SignalAspect settedAspect;
// public StorageRoute(Route route) {
// super(route.getCode());
// cbtcMode = route.isCbtcMode();
@ -152,6 +160,11 @@ public class StorageRoute extends StorageDevice {
change = true;
this.setUnlockedSection(route.getUnlockedSection().getCode());
}
if (Objects.nonNull(route.getSettedAspect())) {
change = true;
this.setSettedAspect(route.getSettedAspect());
}
return change;
}
@ -172,6 +185,7 @@ public class StorageRoute extends StorageDevice {
if (Objects.nonNull(this.unlockedSection)) {
route.setUnlockedSection(repository.getByCode(this.unlockedSection, Section.class));
}
route.setSettedAspect(settedAspect);
}
}

View File

@ -169,6 +169,7 @@ public class DepotService {
depotRunningInfo.getRouteList().remove(0);
}
if (!route.isSetting()) {
route.setSettedAspect(route.getAspect());
ciRouteService.setRoute(simulation, route);
}
}