【编辑车站条件属性注解】
This commit is contained in:
parent
622ac0338e
commit
e8df5e8ee6
@ -74,4 +74,12 @@ public class SimulationTrainingV2Controller {
|
||||
public Integer completionClientStep(@PathVariable String group, @PathVariable Integer stepId, @RequestAttribute AccountVO user) {
|
||||
return training2Service.completionClientStep(group, stepId, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制剧本
|
||||
*/
|
||||
@PostMapping("/{group}/draw/{trainingId}")
|
||||
public void drawTraining(@PathVariable String group, @PathVariable Long trainingId) {
|
||||
training2Service.drawTraining(group, trainingId);
|
||||
}
|
||||
}
|
||||
|
@ -358,6 +358,22 @@ public class Training2Service {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制草稿时加载实训背景
|
||||
* TODO 后续看根据需求是否加载到最后一步
|
||||
*/
|
||||
public void drawTraining(String group, Long trainingId) {
|
||||
DraftTraining2WithBLOBs draftTraining2 = draftTrainingDao.selectByPrimaryKey(trainingId);
|
||||
if (draftTraining2 == null) {
|
||||
throw new SimulationException(SimulationExceptionType.Data_Not_Exist, "实训不存在");
|
||||
}
|
||||
Simulation simulation = groupSimulationCache.getSimulationByGroup(group);
|
||||
simulationLifeCycleService.pause(simulation);
|
||||
// 重置仿真状态
|
||||
groupSimulationService.planOver(group);
|
||||
groupSimulationService.loadScenes(simulation.getId(), draftTraining2.getBgSceneJson());
|
||||
}
|
||||
|
||||
/**
|
||||
* 实训时创建仿真对象
|
||||
*/
|
||||
|
@ -192,7 +192,7 @@ public class Signal extends DelayUnlockDevice {
|
||||
/**
|
||||
* 重复封锁(*后期去掉*)
|
||||
*/
|
||||
@ExpConditionMaterialAnno(name = "reblockade", type = "boolean", desc = "重复封锁(*后期去掉*)")
|
||||
@ExpConditionMaterialAnno(name = "reblockade", type = "boolean", desc = "重复封锁")
|
||||
private boolean reblockade;
|
||||
/**
|
||||
* 侧防锁闭(侧防锁闭后,不能排列此信号机为始端的任何进路)
|
||||
@ -207,7 +207,7 @@ public class Signal extends DelayUnlockDevice {
|
||||
/**
|
||||
* 当前信号显示
|
||||
*/
|
||||
@ExpConditionMaterialAnno(name = "aspect", type = "SignalAspect", desc = "当前信号显示")
|
||||
@ExpConditionMaterialAnno(name = "aspect", type = "SignalAspect", desc = "信号显示")
|
||||
private SignalAspect aspect;
|
||||
/**
|
||||
* 是否禁止联锁自动开信号
|
||||
|
@ -75,7 +75,6 @@ public class Stand extends MayOutOfOrderDevice {
|
||||
/**
|
||||
* 列车在站台停靠
|
||||
*/
|
||||
@ExpConditionMaterialAnno(name = "trainParking", type = "boolean", desc = "列车在站台停靠")
|
||||
private boolean trainParking;
|
||||
|
||||
/**
|
||||
@ -94,25 +93,21 @@ public class Stand extends MayOutOfOrderDevice {
|
||||
/**
|
||||
* 中心是否扣车
|
||||
*/
|
||||
@ExpConditionMaterialAnno(name = "centerHoldTrain", type = "boolean", desc = "中心是否扣车")
|
||||
private volatile boolean centerHoldTrain;
|
||||
|
||||
/**
|
||||
* 系统扣车
|
||||
*/
|
||||
@ExpConditionMaterialAnno(name = "sysHoldTrain", type = "boolean", desc = "系统扣车")
|
||||
private volatile boolean sysHoldTrain;
|
||||
|
||||
/**
|
||||
* IBP盘扣车
|
||||
*/
|
||||
@ExpConditionMaterialAnno(name = "ibpHoldTrain", type = "boolean", desc = "IBP盘扣车")
|
||||
private boolean ibpHoldTrain;
|
||||
|
||||
/**
|
||||
* 区间自动扣车
|
||||
*/
|
||||
@ExpConditionMaterialAnno(name = "autoHoldTrain", type = "boolean", desc = "区间自动扣车")
|
||||
private boolean autoHoldTrain;
|
||||
|
||||
/*跳停相关*/
|
||||
@ -147,13 +142,11 @@ public class Stand extends MayOutOfOrderDevice {
|
||||
/**
|
||||
* 区间运行时间是否一直有效
|
||||
*/
|
||||
@ExpConditionMaterialAnno(name = "runLevelTimeForever", type = "boolean", desc = "区间运行时间是否一直有效")
|
||||
private boolean runLevelTimeForever;
|
||||
|
||||
/**
|
||||
* 区间列车数量限制(自动扣车)(不限制-1)
|
||||
*/
|
||||
@ExpConditionMaterialAnno(name = "trainLimit", type = "int", desc = "区间列车数量限制(自动扣车)(不限制-1)")
|
||||
private int trainLimit;
|
||||
|
||||
/*停站时间相关*/
|
||||
@ -170,7 +163,6 @@ public class Stand extends MayOutOfOrderDevice {
|
||||
/**
|
||||
* 停车设置状态(一直有效/一次有效)
|
||||
*/
|
||||
@ExpConditionMaterialAnno(name = "parkingAlwaysValid", type = "boolean", desc = "停车设置状态(一直有效/一次有效)")
|
||||
private boolean parkingAlwaysValid;
|
||||
|
||||
// private TurnBackType defaultTypeStrategy;
|
||||
@ -178,7 +170,6 @@ public class Stand extends MayOutOfOrderDevice {
|
||||
/**
|
||||
* 折返类型策略(无折返/自动换端/无人折返)
|
||||
*/
|
||||
@ExpConditionMaterialAnno(name = "typeStrategy", type = "TurnBackType", desc = "折返类型策略(无折返/自动换端/无人折返)")
|
||||
private TurnBackType typeStrategy;
|
||||
|
||||
private boolean closed;
|
||||
|
@ -141,7 +141,6 @@ public class Station extends MayOutOfOrderDevice {
|
||||
/**
|
||||
* 当前折返策略id
|
||||
*/
|
||||
@ExpConditionMaterialAnno(name = "tbStrategyId", type = "Integer", desc = "当前折返策略id")
|
||||
private Integer tbStrategyId;
|
||||
|
||||
/**
|
||||
@ -204,7 +203,6 @@ public class Station extends MayOutOfOrderDevice {
|
||||
/**
|
||||
* 允许自律
|
||||
*/
|
||||
@ExpConditionMaterialAnno(name = "allowAutonomy", type = "boolean", desc = "允许自律")
|
||||
private boolean allowAutonomy;
|
||||
|
||||
@Override
|
||||
|
@ -430,7 +430,6 @@ public class VirtualRealityTrain extends VirtualRealityDevice {
|
||||
/**
|
||||
* 下令停车
|
||||
*/
|
||||
@ExpConditionMaterialAnno(name = "orderStop", type = "boolean", desc = "下令停车")
|
||||
private boolean orderStop;
|
||||
|
||||
/**
|
||||
@ -441,7 +440,6 @@ public class VirtualRealityTrain extends VirtualRealityDevice {
|
||||
/**
|
||||
* 有定位
|
||||
*/
|
||||
@ExpConditionMaterialAnno(name = "positioned", type = "boolean", desc = "有定位")
|
||||
private boolean positioned = true;
|
||||
|
||||
/**
|
||||
|
@ -68,6 +68,15 @@ public class Expression implements Valuable {
|
||||
return cls.cast(b);
|
||||
}
|
||||
},
|
||||
IS {
|
||||
@Override
|
||||
public <T> T handle(Class<T> cls, Valuable... valuables) {
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(valuables.length == 1,
|
||||
String.format("操作符[%s]的参数数量不合格[%s]", this.name(), valuables.length));
|
||||
boolean b = valuables[0].getValue(Boolean.class);
|
||||
return cls.cast(b);
|
||||
}
|
||||
},
|
||||
EQ {
|
||||
@Override
|
||||
public <T> T handle(Class<T> cls, Valuable... valuables) {
|
||||
|
Loading…
Reference in New Issue
Block a user