接近锁闭进路配置逻辑调整
This commit is contained in:
parent
81e1aa081a
commit
267003cd1a
@ -17,6 +17,14 @@ public interface ExceptionAssert {
|
|||||||
|
|
||||||
BaseException exception(String message, Throwable t);
|
BaseException exception(String message, Throwable t);
|
||||||
|
|
||||||
|
default void fail() {
|
||||||
|
throw exception();
|
||||||
|
}
|
||||||
|
|
||||||
|
default void fail(String message) {
|
||||||
|
throw exception(message);
|
||||||
|
}
|
||||||
|
|
||||||
default void assertNotNull(Object object) {
|
default void assertNotNull(Object object) {
|
||||||
if (object == null) {
|
if (object == null) {
|
||||||
throw exception();
|
throw exception();
|
||||||
|
@ -51,12 +51,25 @@ public class SignalOperateHandler {
|
|||||||
public void cancelRoute(Simulation simulation, String signalCode) {
|
public void cancelRoute(Simulation simulation, String signalCode) {
|
||||||
//是否接近区段占用仍执行取消进路
|
//是否接近区段占用仍执行取消进路
|
||||||
Route route = this.ciApiService.findLockedRouteByStartSignal(simulation, signalCode);
|
Route route = this.ciApiService.findLockedRouteByStartSignal(simulation, signalCode);
|
||||||
if (route != null && route.isApproachLock() &&
|
if (route == null) {
|
||||||
simulation.getRepository().getConfig().isSignalForceCancelRoute()) {
|
|
||||||
this.ciApiService.humanCancel(simulation, route.getCode());
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.atsRouteService.cancelRoute(simulation, signalCode);
|
if (route.isApproachLock()) {
|
||||||
|
switch (simulation.getRepository().getConfig().getSingleApproachLockCancelRoute()) {
|
||||||
|
case DELAY:
|
||||||
|
this.ciApiService.humanCancel(simulation, route.getCode());
|
||||||
|
break;
|
||||||
|
case DIRECT:
|
||||||
|
this.ciApiService.forceUnlockRoute(simulation, route.getCode());
|
||||||
|
break;
|
||||||
|
case NOT:
|
||||||
|
default:
|
||||||
|
BusinessExceptionAssertEnum.OPERATION_FAIL.fail("无法取消接近锁闭进路");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.atsRouteService.cancelRoute(simulation, signalCode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OperateHandlerMapping(type = Operation.Type.Signal_Set_Overlap)
|
@OperateHandlerMapping(type = Operation.Type.Signal_Set_Overlap)
|
||||||
|
@ -140,7 +140,7 @@ public interface CiApiService {
|
|||||||
void unlockRoute(Simulation simulation, String routeCode);
|
void unlockRoute(Simulation simulation, String routeCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 解锁进路/取消进路(强制取消进路,无论接近区段是否占用,如果占用延时取消)
|
* 解锁进路/取消进路(强制取消进路,无论接近区段是否占用)
|
||||||
* @param simulation
|
* @param simulation
|
||||||
* @param routeCode
|
* @param routeCode
|
||||||
*/
|
*/
|
||||||
|
@ -199,11 +199,7 @@ public class CiApiServiceImpl2 implements CiApiService {
|
|||||||
Route route = simulation.getRepository().getByCode(routeCode, Route.class);
|
Route route = simulation.getRepository().getByCode(routeCode, Route.class);
|
||||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNotTrue(route.isFleetMode(),
|
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNotTrue(route.isFleetMode(),
|
||||||
String.format("进路[%s]已开启自动通过进路,无法取消", route.debugStr()));
|
String.format("进路[%s]已开启自动通过进路,无法取消", route.debugStr()));
|
||||||
if (route.isApproachLock()) {
|
this.routeService.unlockRoute(simulation, route);
|
||||||
this.routeService.delayUnlockStart(simulation, route, route.getStart());
|
|
||||||
} else {
|
|
||||||
this.routeService.unlockRoute(simulation, route);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -100,7 +100,7 @@ public class MapConfig {
|
|||||||
/**
|
/**
|
||||||
* 取消进路命令能否取消引导或接近锁闭的进路
|
* 取消进路命令能否取消引导或接近锁闭的进路
|
||||||
*/
|
*/
|
||||||
private boolean signalForceCancelRoute;
|
private ApproachLockCancel singleApproachLockCancelRoute;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -239,7 +239,7 @@ public class MapConfig {
|
|||||||
setSwitchNRTurnChain(configVO.getSwitchNRTurnChain());
|
setSwitchNRTurnChain(configVO.getSwitchNRTurnChain());
|
||||||
setSwitchSingleLockChain(configVO.getSwitchSingleLockChain());
|
setSwitchSingleLockChain(configVO.getSwitchSingleLockChain());
|
||||||
setSwitchLossChain(configVO.getSwitchLossChain());
|
setSwitchLossChain(configVO.getSwitchLossChain());
|
||||||
setSignalForceCancelRoute(configVO.getSignalForceCancelRoute());
|
setSingleApproachLockCancelRoute(configVO.getSingleApproachLockCancelRoute());
|
||||||
setRunMode(RunLevel.valueOf(configVO.getRunMode()));
|
setRunMode(RunLevel.valueOf(configVO.getRunMode()));
|
||||||
setInitSingleLockSwitch(configVO.isInitSingleLockSwitch());
|
setInitSingleLockSwitch(configVO.isInitSingleLockSwitch());
|
||||||
setNoParkingSM(configVO.getNoParkingSM());
|
setNoParkingSM(configVO.getNoParkingSM());
|
||||||
@ -324,4 +324,19 @@ public class MapConfig {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum ApproachLockCancel {
|
||||||
|
/**
|
||||||
|
* 不能取消
|
||||||
|
*/
|
||||||
|
NOT,
|
||||||
|
/**
|
||||||
|
* 延时取消
|
||||||
|
*/
|
||||||
|
DELAY,
|
||||||
|
/**
|
||||||
|
* 直接取消
|
||||||
|
*/
|
||||||
|
DIRECT,;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package club.joylink.rtss.vo.map;
|
package club.joylink.rtss.vo.map;
|
||||||
|
|
||||||
import club.joylink.rtss.simulation.cbtc.constant.RunLevel;
|
import club.joylink.rtss.simulation.cbtc.constant.RunLevel;
|
||||||
|
import club.joylink.rtss.simulation.cbtc.data.map.MapConfig;
|
||||||
import club.joylink.rtss.util.JsonUtils;
|
import club.joylink.rtss.util.JsonUtils;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
@ -83,7 +84,7 @@ public class RealLineConfigVO {
|
|||||||
/**
|
/**
|
||||||
*是否强制取消进路/在接近区段占用时是否依旧强制执行取消进路
|
*是否强制取消进路/在接近区段占用时是否依旧强制执行取消进路
|
||||||
*/
|
*/
|
||||||
private Boolean signalForceCancelRoute = false;
|
private MapConfig.ApproachLockCancel singleApproachLockCancelRoute = MapConfig.ApproachLockCancel.NOT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*列车控制模式/级别
|
*列车控制模式/级别
|
||||||
|
Loading…
Reference in New Issue
Block a user