【编辑车站条件属性注解】

This commit is contained in:
weizhihong 2022-08-26 10:12:39 +08:00
parent 622ac0338e
commit e8df5e8ee6
7 changed files with 35 additions and 15 deletions

View File

@ -74,4 +74,12 @@ public class SimulationTrainingV2Controller {
public Integer completionClientStep(@PathVariable String group, @PathVariable Integer stepId, @RequestAttribute AccountVO user) { public Integer completionClientStep(@PathVariable String group, @PathVariable Integer stepId, @RequestAttribute AccountVO user) {
return training2Service.completionClientStep(group, stepId, user); return training2Service.completionClientStep(group, stepId, user);
} }
/**
* 绘制剧本
*/
@PostMapping("/{group}/draw/{trainingId}")
public void drawTraining(@PathVariable String group, @PathVariable Long trainingId) {
training2Service.drawTraining(group, trainingId);
}
} }

View File

@ -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());
}
/** /**
* 实训时创建仿真对象 * 实训时创建仿真对象
*/ */

View File

@ -192,7 +192,7 @@ public class Signal extends DelayUnlockDevice {
/** /**
* 重复封锁*后期去掉* * 重复封锁*后期去掉*
*/ */
@ExpConditionMaterialAnno(name = "reblockade", type = "boolean", desc = "重复封锁*后期去掉*") @ExpConditionMaterialAnno(name = "reblockade", type = "boolean", desc = "重复封锁")
private boolean reblockade; 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; private SignalAspect aspect;
/** /**
* 是否禁止联锁自动开信号 * 是否禁止联锁自动开信号

View File

@ -75,7 +75,6 @@ public class Stand extends MayOutOfOrderDevice {
/** /**
* 列车在站台停靠 * 列车在站台停靠
*/ */
@ExpConditionMaterialAnno(name = "trainParking", type = "boolean", desc = "列车在站台停靠")
private boolean trainParking; private boolean trainParking;
/** /**
@ -94,25 +93,21 @@ public class Stand extends MayOutOfOrderDevice {
/** /**
* 中心是否扣车 * 中心是否扣车
*/ */
@ExpConditionMaterialAnno(name = "centerHoldTrain", type = "boolean", desc = "中心是否扣车")
private volatile boolean centerHoldTrain; private volatile boolean centerHoldTrain;
/** /**
* 系统扣车 * 系统扣车
*/ */
@ExpConditionMaterialAnno(name = "sysHoldTrain", type = "boolean", desc = "系统扣车")
private volatile boolean sysHoldTrain; private volatile boolean sysHoldTrain;
/** /**
* IBP盘扣车 * IBP盘扣车
*/ */
@ExpConditionMaterialAnno(name = "ibpHoldTrain", type = "boolean", desc = "IBP盘扣车")
private boolean ibpHoldTrain; private boolean ibpHoldTrain;
/** /**
* 区间自动扣车 * 区间自动扣车
*/ */
@ExpConditionMaterialAnno(name = "autoHoldTrain", type = "boolean", desc = "区间自动扣车")
private boolean autoHoldTrain; private boolean autoHoldTrain;
/*跳停相关*/ /*跳停相关*/
@ -147,13 +142,11 @@ public class Stand extends MayOutOfOrderDevice {
/** /**
* 区间运行时间是否一直有效 * 区间运行时间是否一直有效
*/ */
@ExpConditionMaterialAnno(name = "runLevelTimeForever", type = "boolean", desc = "区间运行时间是否一直有效")
private boolean runLevelTimeForever; private boolean runLevelTimeForever;
/** /**
* 区间列车数量限制自动扣车不限制-1 * 区间列车数量限制自动扣车不限制-1
*/ */
@ExpConditionMaterialAnno(name = "trainLimit", type = "int", desc = "区间列车数量限制(自动扣车)(不限制-1")
private int trainLimit; private int trainLimit;
/*停站时间相关*/ /*停站时间相关*/
@ -170,7 +163,6 @@ public class Stand extends MayOutOfOrderDevice {
/** /**
* 停车设置状态一直有效/一次有效 * 停车设置状态一直有效/一次有效
*/ */
@ExpConditionMaterialAnno(name = "parkingAlwaysValid", type = "boolean", desc = "停车设置状态(一直有效/一次有效)")
private boolean parkingAlwaysValid; private boolean parkingAlwaysValid;
// private TurnBackType defaultTypeStrategy; // private TurnBackType defaultTypeStrategy;
@ -178,7 +170,6 @@ public class Stand extends MayOutOfOrderDevice {
/** /**
* 折返类型策略(无折返/自动换端/无人折返) * 折返类型策略(无折返/自动换端/无人折返)
*/ */
@ExpConditionMaterialAnno(name = "typeStrategy", type = "TurnBackType", desc = "折返类型策略(无折返/自动换端/无人折返)")
private TurnBackType typeStrategy; private TurnBackType typeStrategy;
private boolean closed; private boolean closed;

View File

@ -141,7 +141,6 @@ public class Station extends MayOutOfOrderDevice {
/** /**
* 当前折返策略id * 当前折返策略id
*/ */
@ExpConditionMaterialAnno(name = "tbStrategyId", type = "Integer", desc = "当前折返策略id")
private Integer tbStrategyId; private Integer tbStrategyId;
/** /**
@ -204,7 +203,6 @@ public class Station extends MayOutOfOrderDevice {
/** /**
* 允许自律 * 允许自律
*/ */
@ExpConditionMaterialAnno(name = "allowAutonomy", type = "boolean", desc = "允许自律")
private boolean allowAutonomy; private boolean allowAutonomy;
@Override @Override

View File

@ -430,7 +430,6 @@ public class VirtualRealityTrain extends VirtualRealityDevice {
/** /**
* 下令停车 * 下令停车
*/ */
@ExpConditionMaterialAnno(name = "orderStop", type = "boolean", desc = "下令停车")
private boolean orderStop; private boolean orderStop;
/** /**
@ -441,7 +440,6 @@ public class VirtualRealityTrain extends VirtualRealityDevice {
/** /**
* 有定位 * 有定位
*/ */
@ExpConditionMaterialAnno(name = "positioned", type = "boolean", desc = "有定位")
private boolean positioned = true; private boolean positioned = true;
/** /**

View File

@ -68,6 +68,15 @@ public class Expression implements Valuable {
return cls.cast(b); 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 { EQ {
@Override @Override
public <T> T handle(Class<T> cls, Valuable... valuables) { public <T> T handle(Class<T> cls, Valuable... valuables) {