Merge branch 'test-training2' of https://git.code.tencent.com/lian-cbtc/rtss-server into test-training2-xzb1

This commit is contained in:
xzb 2022-09-14 15:44:39 +08:00
commit 10f9ebc161
16 changed files with 304 additions and 126 deletions

View File

@ -4,6 +4,9 @@ package club.joylink.rtss.simulation.cbtc.CI.data;
import club.joylink.rtss.constants.DirectionLabelEnum; import club.joylink.rtss.constants.DirectionLabelEnum;
import club.joylink.rtss.entity.DraftMapStationDirection; import club.joylink.rtss.entity.DraftMapStationDirection;
import club.joylink.rtss.simulation.cbtc.data.map.*; import club.joylink.rtss.simulation.cbtc.data.map.*;
import club.joylink.rtss.simulation.cbtc.training2.ecm.anno.ExpConditionMaterialAnno;
import club.joylink.rtss.simulation.cbtc.training2.ecm.anno.ExpConditionMaterialSrcAnno;
import club.joylink.rtss.simulation.cbtc.training2.ecm.vo.ExpTypeCategory;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -19,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger;
@Setter @Setter
@Getter @Getter
@Slf4j @Slf4j
@ExpConditionMaterialSrcAnno(name = "StationDirection", deviceType = MapElement.DeviceType.STATION_DIRECTION)
public class StationDirection extends MayOutOfOrderDevice implements Cloneable { public class StationDirection extends MayOutOfOrderDevice implements Cloneable {
/** /**
* 发辅助默认倒计时 25s * 发辅助默认倒计时 25s
@ -78,6 +82,7 @@ public class StationDirection extends MayOutOfOrderDevice implements Cloneable {
/** /**
* 处于接发状态 * 处于接发状态
*/ */
@ExpConditionMaterialAnno(name = "runStatus", type = ReceiveAndDeliverModel.class, desc = "接、发状态", category = ExpTypeCategory.ENUM)
private ReceiveAndDeliverModel runStatus; private ReceiveAndDeliverModel runStatus;
/** /**
@ -116,6 +121,7 @@ public class StationDirection extends MayOutOfOrderDevice implements Cloneable {
/** /**
* 改方按钮状态 * 改方按钮状态
*/ */
@ExpConditionMaterialAnno(name = "changeDirectionStatus", type = boolean.class, desc = "改方状态")
private boolean changeDirectionStatus; private boolean changeDirectionStatus;
/** /**
@ -131,16 +137,19 @@ public class StationDirection extends MayOutOfOrderDevice implements Cloneable {
/** /**
* 接辅助 * 接辅助
*/ */
@ExpConditionMaterialAnno(name = "receiveAssistStatus", type = boolean.class, desc = "接辅助状态")
private boolean receiveAssistStatus; private boolean receiveAssistStatus;
/** /**
* 发辅助 * 发辅助
*/ */
@ExpConditionMaterialAnno(name = "deliverAssistStatus", type = boolean.class, desc = "发辅助状态")
private boolean deliverAssistStatus; private boolean deliverAssistStatus;
/** /**
* 辅助准备完毕状态 * 辅助准备完毕状态
*/ */
@ExpConditionMaterialAnno(name = "assistReadyStatus", type = boolean.class, desc = "辅助办理完成")
private boolean assistReadyStatus; private boolean assistReadyStatus;
/** /**
@ -153,6 +162,7 @@ public class StationDirection extends MayOutOfOrderDevice implements Cloneable {
/** /**
* 闭塞 * 闭塞
*/ */
@ExpConditionMaterialAnno(name = "blockStatus", type = boolean.class, desc = "闭塞状态")
private boolean blockStatus; private boolean blockStatus;
/** /**
@ -193,8 +203,6 @@ public class StationDirection extends MayOutOfOrderDevice implements Cloneable {
*/ */
private Map<String, Boolean> routeSettingStatusMap; private Map<String, Boolean> routeSettingStatusMap;
/***************************************** 关联进路信息 **********************************************/ /***************************************** 关联进路信息 **********************************************/
/** /**
* 是否是数据配置生成 * 是否是数据配置生成
*/ */
@ -205,7 +213,7 @@ public class StationDirection extends MayOutOfOrderDevice implements Cloneable {
*/ */
private Boolean right; private Boolean right;
/***************************************** 车务终端管理出入口方向相关属性begin **********************************************/ /***************************************** 车务终端管理出入口方向相关属性begin **********************************************/
private IODirection ioDirection; private IODirection ioDirection;
/** /**
* 允许超限列车 * 允许超限列车
* 选择/ * 选择/
@ -229,6 +237,7 @@ public class StationDirection extends MayOutOfOrderDevice implements Cloneable {
* 车运行分工选择 * 车运行分工选择
*/ */
private boolean goodsTrain; private boolean goodsTrain;
/***************************************** 车务终端管理出入口方向相关属性begin **********************************************/ /***************************************** 车务终端管理出入口方向相关属性begin **********************************************/
// TODO: 待数据统一之后这个构造函数代码可删除 20220714 // TODO: 待数据统一之后这个构造函数代码可删除 20220714
public StationDirection(String code, String name, DirectionLabelEnum labelEnum) { public StationDirection(String code, String name, DirectionLabelEnum labelEnum) {
@ -239,7 +248,8 @@ public class StationDirection extends MayOutOfOrderDevice implements Cloneable {
this.defaultRunStatus = this.getDefaultReceiveAndDeliver(); this.defaultRunStatus = this.getDefaultReceiveAndDeliver();
this.currentRouteList = getNowRouteList(); this.currentRouteList = getNowRouteList();
} }
public StationDirection(String code, String name, DirectionLabelEnum labelEnum,IODirection ioDirection) {
public StationDirection(String code, String name, DirectionLabelEnum labelEnum, IODirection ioDirection) {
this(code, name); this(code, name);
this.labelEnum = labelEnum; this.labelEnum = labelEnum;
this.runModel = getDefaultDirectionRunModel(); this.runModel = getDefaultDirectionRunModel();
@ -250,6 +260,7 @@ public class StationDirection extends MayOutOfOrderDevice implements Cloneable {
} }
public StationDirection(DraftMapStationDirection draftMapStationDirection) { public StationDirection(DraftMapStationDirection draftMapStationDirection) {
this(draftMapStationDirection.getCode(), draftMapStationDirection.getName()); this(draftMapStationDirection.getCode(), draftMapStationDirection.getName());
this.labelEnum = draftMapStationDirection.getLabelEnum(); this.labelEnum = draftMapStationDirection.getLabelEnum();
@ -259,7 +270,7 @@ public class StationDirection extends MayOutOfOrderDevice implements Cloneable {
this.currentRouteList = getNowRouteList(); this.currentRouteList = getNowRouteList();
this.isDataConfig = true; this.isDataConfig = true;
this.ioDirection = draftMapStationDirection.getIoDirection(); this.ioDirection = draftMapStationDirection.getIoDirection();
} }
public StationDirection(String code, String name) { public StationDirection(String code, String name) {
@ -270,14 +281,16 @@ public class StationDirection extends MayOutOfOrderDevice implements Cloneable {
this.deliverRouteList = new ArrayList<>(); this.deliverRouteList = new ArrayList<>();
this.routeSettingStatusMap = new HashMap<>(); this.routeSettingStatusMap = new HashMap<>();
} }
public StationDirection clone(){
public StationDirection clone() {
try { try {
return (StationDirection)super.clone(); return (StationDirection) super.clone();
} catch (CloneNotSupportedException e) { } catch (CloneNotSupportedException e) {
e.printStackTrace(); e.printStackTrace();
} }
return null; return null;
} }
@Override @Override
public void reset() { public void reset() {
this.routeSettingStatusMap.clear(); this.routeSettingStatusMap.clear();
@ -663,24 +676,37 @@ public class StationDirection extends MayOutOfOrderDevice implements Cloneable {
} }
} }
@Getter
public enum ReceiveAndDeliverModel { public enum ReceiveAndDeliverModel {
// //
R, R(""),
// //
D, D(""),
// //
A, A("双向占用"),
// //
NO NO("无状态");
private final String label;
ReceiveAndDeliverModel(String label) {
this.label = label;
}
} }
@Getter
public enum IndicatorStatusEnum { public enum IndicatorStatusEnum {
// 占用 // 占用
O, O("占用"),
// 空闲 // 空闲
F, F("空闲"),
// 预备 // 预备
R R("准备状态");
private final String label;
IndicatorStatusEnum(String label) {
this.label = label;
}
} }
public enum ButtonTypeEnum { public enum ButtonTypeEnum {
@ -702,24 +728,27 @@ public class StationDirection extends MayOutOfOrderDevice implements Cloneable {
NO NO
} }
@Getter
public enum DirectionRunModel { public enum DirectionRunModel {
// 自动 // 自动
A, A("自动闭塞"),
// 半自动 // 半自动
S, S("半自动闭塞");
// 非自动 private final String label;
N
DirectionRunModel(String label) {
this.label = label;
}
} }
/** /**
* 出入口方向 * 出入口方向
*/ */
public enum IODirection{ public enum IODirection {
DOWN_IN_STATION, DOWN_IN_STATION,
UP_IN_STATION, UP_IN_STATION,
DOWN_OUT_STATION, DOWN_OUT_STATION,
UP_OUT_STATION, UP_OUT_STATION,
BOTH_WAY_STATION; BOTH_WAY_STATION;
} }
} }

View File

@ -4,14 +4,28 @@ package club.joylink.rtss.simulation.cbtc.constant;
* 驾驶模式 * 驾驶模式
*/ */
public enum DriveMode { public enum DriveMode {
/** 列车自动驾驶模式:司机监控下的列车自动驾驶 */ /**
AM, * 列车自动驾驶模式司机监控下的列车自动驾驶
/** ATP防护下的人工驾驶模式司机在列车自动防护设备监控下驾驶列车 */ */
CM, AM("列车自动驾驶模式"),
/** 限制人工驾驶模式:地面设备故障或未设置地面信息设备的线路,列车按规定限速运行,超速时实时制动,直至停车 */ /**
RM, * ATP防护下的人工驾驶模式司机在列车自动防护设备监控下驾驶列车
/** 无限制人工驾驶模式列车在运行中没有车载ATP的保护司机根据行车调度员的指示按地面信号机的显示或手信号口令指示行车 */ */
NRM; CM("ATP防护下的人工驾驶模式"),
/**
* 限制人工驾驶模式地面设备故障或未设置地面信息设备的线路列车按规定限速运行超速时实时制动直至停车
*/
RM("限制人工驾驶模式"),
/**
* 无限制人工驾驶模式列车在运行中没有车载ATP的保护司机根据行车调度员的指示按地面信号机的显示或手信号口令指示行车
*/
NRM("无限制人工驾驶模式");
private final String label;
DriveMode(String label) {
this.label = label;
}
public boolean isNotLowerThan(DriveMode driveMode) { public boolean isNotLowerThan(DriveMode driveMode) {
return this.ordinal() <= driveMode.ordinal(); return this.ordinal() <= driveMode.ordinal();

View File

@ -7,15 +7,22 @@ public enum RunLevel {
/** /**
* cbtc级别 * cbtc级别
*/ */
CBTC, CBTC("cbtc级别"),
/** /**
* 点式通信 * 点式通信
*/ */
ITC, ITC("点式通信"),
/** /**
* 联锁级 * 联锁级
*/ */
IL; IL("联锁级");
private final String label;
RunLevel(String label) {
this.label = label;
}
public boolean isNotLowerThan(RunLevel runLevel) { public boolean isNotLowerThan(RunLevel runLevel) {
return this.ordinal() <= runLevel.ordinal(); return this.ordinal() <= runLevel.ordinal();

View File

@ -4,34 +4,69 @@ package club.joylink.rtss.simulation.cbtc.constant;
* 信号显示 * 信号显示
*/ */
public enum SignalAspect { public enum SignalAspect {
/** 无显示,灭灯 */ /**
No, * 无显示灭灯
/** 红 */ */
R, No("灭灯"),
/** 绿 */ /**
G, *
/** 黄 */ */
Y, R(""),
/** 月白 */ /**
W, * 绿
/** 蓝 */ */
B, G("绿"),
/** 红黄 */ /**
RY, *
/** 红白 */ */
RW, Y(""),
/** 绿绿 */ /**
GG, * 月白
/** 绿黄 */ */
GY, W("月白"),
/** 黄黄 */ /**
YY, *
/** 红闪flashing */ */
RF, B(""),
/** 黄闪flashing */ /**
YF, * 红黄
/** 绿闪flashing */ */
GF, RY("红黄"),
/** 白闪flashing */ /**
WF, * 红白
*/
RW("红白"),
/**
* 绿绿
*/
GG("绿绿"),
/**
* 绿黄
*/
GY("绿黄"),
/**
* 黄黄
*/
YY("黄黄"),
/**
* 红闪flashing
*/
RF("红闪"),
/**
* 黄闪flashing
*/
YF("黄闪"),
/**
* 绿闪flashing
*/
GF("绿闪"),
/**
* 白闪flashing
*/
WF("白闪");
private final String label;
SignalAspect(String label) {
this.label = label;
}
} }

View File

@ -4,16 +4,30 @@ package club.joylink.rtss.simulation.cbtc.constant;
* 道岔位置表示 * 道岔位置表示
*/ */
public enum SwitchIndication { public enum SwitchIndication {
/** 定位 */ /**
N, * 定位
/** 反位 */ */
R, N("定位"),
/** 无(失表) */ /**
NO, * 反位
/** 挤叉 */ */
EX, R("反位"),
/**
* (失表)
*/
NO("反位"),
/**
* 挤叉
*/
EX("挤叉"),
; ;
private final String label;
SwitchIndication(String label) {
this.label = label;
}
public static SwitchIndication of(boolean normal) { public static SwitchIndication of(boolean normal) {
if (normal) { if (normal) {
return N; return N;

View File

@ -161,31 +161,31 @@ public class Route extends MapNamedElement {
/** /**
* ats自动控制 * ats自动控制
*/ */
@ExpConditionMaterialAnno(name = "atsControl", type = "boolean", desc = "ats自动控制") @ExpConditionMaterialAnno(name = "atsControl", type = boolean.class, desc = "ats自动控制")
private boolean atsControl; private boolean atsControl;
/** /**
* 连续通过进路模式(联锁自动进路)开启 * 连续通过进路模式(联锁自动进路)开启
*/ */
@ExpConditionMaterialAnno(name = "fleetMode", type = "boolean", desc = "连续通过进路模式(联锁自动进路)开启") @ExpConditionMaterialAnno(name = "fleetMode", type = boolean.class, desc = "连续通过进路模式(联锁自动进路)开启")
private boolean fleetMode; private boolean fleetMode;
/** /**
* 自动追踪/联锁自动触发模式开启 * 自动追踪/联锁自动触发模式开启
*/ */
@ExpConditionMaterialAnno(name = "ciControl", type = "boolean", desc = "自动追踪/联锁自动触发模式开启") @ExpConditionMaterialAnno(name = "ciControl", type = boolean.class, desc = "自动追踪/联锁自动触发模式开启")
private boolean ciControl; private boolean ciControl;
/** /**
* 进路是否可以排列 * 进路是否可以排列
*/ */
@ExpConditionMaterialAnno(name = "settable", type = "boolean", desc = "进路是否可以排列") @ExpConditionMaterialAnno(name = "settable", type = boolean.class, desc = "进路是否可以排列")
private boolean settable; private boolean settable;
/** /**
* 进路是否排列中 * 进路是否排列中
*/ */
@ExpConditionMaterialAnno(name = "setting", type = "boolean", desc = "进路是否排列中") @ExpConditionMaterialAnno(name = "setting", type = boolean.class, desc = "进路是否排列中")
private boolean setting; private boolean setting;
/** /**
* 该进路办理成功后要开放的信号 * 该进路办理成功后要开放的信号
@ -201,13 +201,13 @@ public class Route extends MapNamedElement {
/** /**
* 是否引导进路排列中 * 是否引导进路排列中
*/ */
@ExpConditionMaterialAnno(name = "guideSetting", type = "boolean", desc = "是否引导进路排列中") @ExpConditionMaterialAnno(name = "guideSetting", type = boolean.class, desc = "是否引导进路排列中")
private boolean guideSetting; private boolean guideSetting;
/** /**
* 进路是否锁闭 * 进路是否锁闭
*/ */
@ExpConditionMaterialAnno(name = "lock", type = "boolean", desc = "进路是否锁闭") @ExpConditionMaterialAnno(name = "lock", type = boolean.class, desc = "进路是否锁闭")
private boolean lock; private boolean lock;
/** /**
@ -218,7 +218,7 @@ public class Route extends MapNamedElement {
/** /**
* 是否正常解锁中 * 是否正常解锁中
*/ */
@ExpConditionMaterialAnno(name = "normalUnlock", type = "boolean", desc = "是否正常解锁中") @ExpConditionMaterialAnno(name = "normalUnlock", type = boolean.class, desc = "是否正常解锁中")
private boolean normalUnlock; private boolean normalUnlock;
/** /**

View File

@ -186,13 +186,13 @@ public class Section extends DelayUnlockDevice {
/** /**
* 是否封锁封锁后包含区段的进路不能排列 * 是否封锁封锁后包含区段的进路不能排列
*/ */
@ExpConditionMaterialAnno(name = "blockade", type = "boolean", desc = "是否封锁") @ExpConditionMaterialAnno(name = "blockade", type = boolean.class, desc = "是否封锁")
private boolean blockade; private boolean blockade;
/** /**
* 是否进路锁闭 * 是否进路锁闭
*/ */
@ExpConditionMaterialAnno(name = "routeLock", type = "boolean", desc = "是否进路锁闭") @ExpConditionMaterialAnno(name = "routeLock", type = boolean.class, desc = "是否进路锁闭")
private boolean routeLock; private boolean routeLock;
/** /**
@ -208,19 +208,19 @@ public class Section extends DelayUnlockDevice {
/** /**
* 进路延续保护锁闭 * 进路延续保护锁闭
*/ */
@ExpConditionMaterialAnno(name = "overlapLock", type = "boolean", desc = "是否进路延续保护锁闭") @ExpConditionMaterialAnno(name = "overlapLock", type = boolean.class, desc = "是否进路延续保护锁闭")
private boolean overlapLock; private boolean overlapLock;
/** /**
* 通信车占用 * 通信车占用
*/ */
@ExpConditionMaterialAnno(name = "ctOccupied", type = "boolean", desc = "是否通信车占用") @ExpConditionMaterialAnno(name = "ctOccupied", type = boolean.class, desc = "是否通信车占用")
private boolean ctOccupied; private boolean ctOccupied;
/** /**
* 计轴占用-非通信车占用 * 计轴占用-非通信车占用
*/ */
@ExpConditionMaterialAnno(name = "nctOccupied", type = "boolean", desc = "是否非通信车占用") @ExpConditionMaterialAnno(name = "nctOccupied", type = boolean.class, desc = "是否非通信车占用")
private boolean nctOccupied; private boolean nctOccupied;
/** /**
@ -231,19 +231,19 @@ public class Section extends DelayUnlockDevice {
/** /**
* 是否切除 * 是否切除
*/ */
@ExpConditionMaterialAnno(name = "cutOff", type = "boolean", desc = "是否切除") @ExpConditionMaterialAnno(name = "cutOff", type = boolean.class, desc = "是否切除")
private boolean cutOff; private boolean cutOff;
/** /**
* 计轴是否被报失效(ARB故障) * 计轴是否被报失效(ARB故障)
*/ */
@ExpConditionMaterialAnno(name = "invalid", type = "boolean", desc = "是否ARB") @ExpConditionMaterialAnno(name = "invalid", type = boolean.class, desc = "是否ARB")
private boolean invalid; private boolean invalid;
/** /**
* 故障锁闭 * 故障锁闭
*/ */
@ExpConditionMaterialAnno(name = "faultLock", type = "boolean", desc = "是否故障锁闭") @ExpConditionMaterialAnno(name = "faultLock", type = boolean.class, desc = "是否故障锁闭")
private boolean faultLock; private boolean faultLock;
/** /**
@ -279,6 +279,7 @@ public class Section extends DelayUnlockDevice {
/** /**
* 分路不良状态 * 分路不良状态
*/ */
@ExpConditionMaterialAnno(name = "badShunt", type = boolean.class, desc = "分路不良状态")
private boolean badShunt; private boolean badShunt;
/** /**

View File

@ -6,6 +6,7 @@ import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition;
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySignal; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySignal;
import club.joylink.rtss.simulation.cbtc.training2.ecm.anno.ExpConditionMaterialAnno; import club.joylink.rtss.simulation.cbtc.training2.ecm.anno.ExpConditionMaterialAnno;
import club.joylink.rtss.simulation.cbtc.training2.ecm.anno.ExpConditionMaterialSrcAnno; import club.joylink.rtss.simulation.cbtc.training2.ecm.anno.ExpConditionMaterialSrcAnno;
import club.joylink.rtss.simulation.cbtc.training2.ecm.vo.ExpTypeCategory;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
@ -181,18 +182,19 @@ public class Signal extends DelayUnlockDevice {
/** /**
* 是否封锁 * 是否封锁
*/ */
@ExpConditionMaterialAnno(name = "blockade", type = "boolean", desc = "是否封锁") @ExpConditionMaterialAnno(name = "blockade", type = boolean.class, desc = "是否封锁")
private boolean blockade; private boolean blockade;
/** /**
* 是否钮封 * 是否钮封
*/ */
@ExpConditionMaterialAnno(name = "buttonBlockade", type = "boolean", desc = "是否钮封") @ExpConditionMaterialAnno(name = "buttonBlockade", type = boolean.class, desc = "是否钮封")
private boolean buttonBlockade; private boolean buttonBlockade;
/** /**
* 重复封锁*后期去掉* * 重复封锁*后期去掉*
*/ */
private boolean reblockade; private boolean reblockade;
/** /**
* 侧防锁闭侧防锁闭后不能排列此信号机为始端的任何进路 * 侧防锁闭侧防锁闭后不能排列此信号机为始端的任何进路
*/ */
@ -206,8 +208,9 @@ public class Signal extends DelayUnlockDevice {
/** /**
* 当前信号显示 * 当前信号显示
*/ */
@ExpConditionMaterialAnno(name = "aspect", type = "SignalAspect", desc = "信号显示") @ExpConditionMaterialAnno(name = "aspect", type = SignalAspect.class, desc = "信号显示状态", category = ExpTypeCategory.ENUM)
private SignalAspect aspect; private SignalAspect aspect;
/** /**
* 是否禁止联锁自动开信号 * 是否禁止联锁自动开信号
*/ */
@ -216,7 +219,7 @@ public class Signal extends DelayUnlockDevice {
/** /**
* 引导信号开放剩余时间单位ms * 引导信号开放剩余时间单位ms
*/ */
@ExpConditionMaterialAnno(name = "guideRemain", type = "int", desc = "引导信号开放剩余时间单位ms") @ExpConditionMaterialAnno(name = "guideRemain", type = int.class, desc = "引导信号开放剩余时间单位ms")
private int guideRemain; private int guideRemain;
/** /**
@ -232,13 +235,13 @@ public class Signal extends DelayUnlockDevice {
/** /**
* 是否接近锁闭 * 是否接近锁闭
*/ */
@ExpConditionMaterialAnno(name = "approachLock", type = "boolean", desc = "是否接近锁闭") @ExpConditionMaterialAnno(name = "approachLock", type = boolean.class, desc = "是否接近锁闭")
private boolean approachLock; private boolean approachLock;
/** /**
* 延续保护锁闭 * 延续保护锁闭
*/ */
@ExpConditionMaterialAnno(name = "overlapLock", type = "boolean", desc = "延续保护锁闭") @ExpConditionMaterialAnno(name = "overlapLock", type = boolean.class, desc = "延续保护锁闭")
private boolean overlapLock; private boolean overlapLock;
/** /**

View File

@ -80,14 +80,14 @@ public class Stand extends MayOutOfOrderDevice {
/** /**
* 列车停站倒计时,单位ms * 列车停站倒计时,单位ms
*/ */
@ExpConditionMaterialAnno(name = "remainTime", type = "int", desc = "列车停站倒计时,单位ms") @ExpConditionMaterialAnno(name = "remainTime", type = int.class, desc = "列车停站倒计时,单位ms")
private int remainTime; private int remainTime;
/*扣车相关*/ /*扣车相关*/
/** /**
* 车站是否扣车 * 车站是否扣车
*/ */
@ExpConditionMaterialAnno(name = "stationHoldTrain", type = "boolean", desc = "车站是否扣车") @ExpConditionMaterialAnno(name = "stationHoldTrain", type = boolean.class, desc = "车站是否扣车")
private volatile boolean stationHoldTrain; private volatile boolean stationHoldTrain;
/** /**
@ -114,7 +114,7 @@ public class Stand extends MayOutOfOrderDevice {
/** /**
* 是否全部跳停 * 是否全部跳停
*/ */
@ExpConditionMaterialAnno(name = "allSkip", type = "boolean", desc = "是否全部跳停") @ExpConditionMaterialAnno(name = "allSkip", type = boolean.class, desc = "是否全部跳停")
private volatile boolean allSkip; private volatile boolean allSkip;
/** /**
@ -125,7 +125,7 @@ public class Stand extends MayOutOfOrderDevice {
/** /**
* 跳停一直有效 * 跳停一直有效
*/ */
@ExpConditionMaterialAnno(name = "skipAlwaysValid", type = "boolean", desc = "跳停持续有效") @ExpConditionMaterialAnno(name = "skipAlwaysValid", type = boolean.class, desc = "跳停持续有效")
private boolean skipAlwaysValid; private boolean skipAlwaysValid;
/*运行等级(时间)相关*/ /*运行等级(时间)相关*/

View File

@ -12,6 +12,7 @@ import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType;
import club.joylink.rtss.simulation.cbtc.member.SimulationMember; import club.joylink.rtss.simulation.cbtc.member.SimulationMember;
import club.joylink.rtss.simulation.cbtc.training2.ecm.anno.ExpConditionMaterialAnno; import club.joylink.rtss.simulation.cbtc.training2.ecm.anno.ExpConditionMaterialAnno;
import club.joylink.rtss.simulation.cbtc.training2.ecm.anno.ExpConditionMaterialSrcAnno; import club.joylink.rtss.simulation.cbtc.training2.ecm.anno.ExpConditionMaterialSrcAnno;
import club.joylink.rtss.simulation.cbtc.training2.ecm.vo.ExpTypeCategory;
import lombok.Getter; import lombok.Getter;
import lombok.NonNull; import lombok.NonNull;
import lombok.Setter; import lombok.Setter;
@ -129,13 +130,13 @@ public class Station extends MayOutOfOrderDevice {
/** /**
* 是否引导总锁 * 是否引导总锁
*/ */
@ExpConditionMaterialAnno(name = "totalGuideLock", type = "boolean", desc = "是否引导总锁") @ExpConditionMaterialAnno(name = "totalGuideLock", type = boolean.class, desc = "是否引导总锁")
private boolean totalGuideLock; private boolean totalGuideLock;
/** /**
* 控制模式 * 控制模式
*/ */
@ExpConditionMaterialAnno(name = "controlMode", type = "ControlMode", desc = "控制模式") @ExpConditionMaterialAnno(name = "controlMode", type = ControlMode.class, desc = "控制模式", category = ExpTypeCategory.ENUM)
private ControlMode controlMode; private ControlMode controlMode;
/** /**
@ -176,7 +177,7 @@ public class Station extends MayOutOfOrderDevice {
/** /**
* 是否紧急控制 * 是否紧急控制
*/ */
@ExpConditionMaterialAnno(name = "emergencyController", type = "boolean", desc = "是否紧急控制") @ExpConditionMaterialAnno(name = "emergencyController", type = boolean.class, desc = "是否紧急控制")
private boolean emergencyController; private boolean emergencyController;
/** /**
@ -194,10 +195,10 @@ public class Station extends MayOutOfOrderDevice {
*/ */
private Map<DirectionLabelEnum, StationDirection> stationDirectionMap; private Map<DirectionLabelEnum, StationDirection> stationDirectionMap;
@ExpConditionMaterialAnno(name = "sGuideMasterLock", type = "boolean", desc = "S引导总锁") @ExpConditionMaterialAnno(name = "sGuideMasterLock", type = boolean.class, desc = "S引导总锁")
private boolean sGuideMasterLock; private boolean sGuideMasterLock;
@ExpConditionMaterialAnno(name = "xGuideMasterLock", type = "boolean", desc = "X引导总锁") @ExpConditionMaterialAnno(name = "xGuideMasterLock", type = boolean.class, desc = "X引导总锁")
private boolean xGuideMasterLock; private boolean xGuideMasterLock;
/** /**
@ -483,24 +484,28 @@ public class Station extends MayOutOfOrderDevice {
/** /**
* 交出未被接收 * 交出未被接收
*/ */
None, None("交出未被接收"),
/** /**
* 中控/遥控 * 中控/遥控
*/ */
Center, Center("中控"),
/** /**
* 站控 * 站控
*/ */
Local, Local("站控"),
/** /**
* 紧急站控 * 紧急站控
*/ */
Emergency, Emergency("紧急站控"),
/** /**
* 联锁控 * 联锁控
*/ */
Interlock Interlock("联锁控");
private final String label;
ControlMode(String label) {
this.label = label;
}
} }

View File

@ -4,6 +4,7 @@ import club.joylink.rtss.simulation.cbtc.constant.SwitchIndication;
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySwitch; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySwitch;
import club.joylink.rtss.simulation.cbtc.training2.ecm.anno.ExpConditionMaterialAnno; import club.joylink.rtss.simulation.cbtc.training2.ecm.anno.ExpConditionMaterialAnno;
import club.joylink.rtss.simulation.cbtc.training2.ecm.anno.ExpConditionMaterialSrcAnno; import club.joylink.rtss.simulation.cbtc.training2.ecm.anno.ExpConditionMaterialSrcAnno;
import club.joylink.rtss.simulation.cbtc.training2.ecm.vo.ExpTypeCategory;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@ -56,13 +57,13 @@ public class Switch extends DelayUnlockDevice {
/** /**
* 是否单锁 * 是否单锁
*/ */
@ExpConditionMaterialAnno(name = "singleLock", type = "boolean", desc = "是否单锁") @ExpConditionMaterialAnno(name = "singleLock", type = boolean.class, desc = "是否单锁")
private boolean singleLock; private boolean singleLock;
/** /**
* 是否封锁 * 是否封锁
*/ */
@ExpConditionMaterialAnno(name = "blockade", type = "boolean", desc = "是否封锁") @ExpConditionMaterialAnno(name = "blockade", type = boolean.class, desc = "是否封锁")
private boolean blockade; private boolean blockade;
/** /**
@ -76,7 +77,7 @@ public class Switch extends DelayUnlockDevice {
/** /**
* 是否进路锁闭 * 是否进路锁闭
*/ */
@ExpConditionMaterialAnno(name = "routeLock", type = "boolean", desc = "是否进路锁闭") @ExpConditionMaterialAnno(name = "routeLock", type = boolean.class, desc = "是否进路锁闭")
private boolean routeLock; private boolean routeLock;
/** /**
@ -87,30 +88,30 @@ public class Switch extends DelayUnlockDevice {
/** /**
* 是否进路侧防锁闭 * 是否进路侧防锁闭
*/ */
@ExpConditionMaterialAnno(name = "fpLock", type = "boolean", desc = "是否进路侧防锁闭") @ExpConditionMaterialAnno(name = "fpLock", type = boolean.class, desc = "是否进路侧防锁闭")
private boolean fpLock; private boolean fpLock;
/** /**
* 是否进路延续保护锁闭 * 是否进路延续保护锁闭
*/ */
@ExpConditionMaterialAnno(name = "overlapLock", type = "boolean", desc = "是否进路延续保护锁闭") @ExpConditionMaterialAnno(name = "overlapLock", type = boolean.class, desc = "是否进路延续保护锁闭")
private boolean overlapLock; private boolean overlapLock;
/** /**
* 是否引导总锁 * 是否引导总锁
*/ */
@ExpConditionMaterialAnno(name = "guideMasterLock", type = "boolean", desc = "是否引导总锁") @ExpConditionMaterialAnno(name = "guideMasterLock", type = boolean.class, desc = "是否引导总锁")
private boolean guideMasterLock; private boolean guideMasterLock;
/** /**
* 道岔位置表示 * 道岔位置表示
*/ */
@ExpConditionMaterialAnno(name = "pos", type = "SwitchIndication", desc = "道岔位置") @ExpConditionMaterialAnno(name = "pos", type = SwitchIndication.class, desc = "道岔位置", category = ExpTypeCategory.ENUM)
private SwitchIndication pos; private SwitchIndication pos;
/** /**
* 预复位 * 预复位
*/ */
@ExpConditionMaterialAnno(name = "preReset", type = "boolean", desc = "预复位") @ExpConditionMaterialAnno(name = "preReset", type = boolean.class, desc = "预复位")
private boolean preReset; private boolean preReset;
/** /**

View File

@ -13,6 +13,7 @@ import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition;
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain;
import club.joylink.rtss.simulation.cbtc.training2.ecm.anno.ExpConditionMaterialAnno; import club.joylink.rtss.simulation.cbtc.training2.ecm.anno.ExpConditionMaterialAnno;
import club.joylink.rtss.simulation.cbtc.training2.ecm.anno.ExpConditionMaterialSrcAnno; import club.joylink.rtss.simulation.cbtc.training2.ecm.anno.ExpConditionMaterialSrcAnno;
import club.joylink.rtss.simulation.cbtc.training2.ecm.vo.ExpTypeCategory;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -83,7 +84,7 @@ public class TrainInfo extends MapElement {
/** /**
* 所处区段 * 所处区段
*/ */
@ExpConditionMaterialAnno(name = "section", type = "SECTION", desc = "所处位置") @ExpConditionMaterialAnno(name = "section", type = Section.class, desc = "所处位置", category = ExpTypeCategory.DEVICE)
private String section; private String section;
/** /**
@ -99,7 +100,7 @@ public class TrainInfo extends MapElement {
@Setter @Setter
private Boolean right; private Boolean right;
@ExpConditionMaterialAnno(name = "speed", type = "float", desc = "车速") @ExpConditionMaterialAnno(name = "speed", type = float.class, desc = "车速")
private float speed; private float speed;
private boolean doorOpen; private boolean doorOpen;
@ -107,13 +108,13 @@ public class TrainInfo extends MapElement {
/** /**
* 跟踪模式 * 跟踪模式
*/ */
@ExpConditionMaterialAnno(name = "runLevel", type = "RunLevel", desc = "列车运行级别") @ExpConditionMaterialAnno(name = "runLevel", type = RunLevel.class, desc = "列车运行级别", category = ExpTypeCategory.ENUM)
private RunLevel runLevel; private RunLevel runLevel;
/** /**
* 驾驶模式 * 驾驶模式
*/ */
@ExpConditionMaterialAnno(name = "driveMode", type = "DriveMode", desc = "驾驶模式") @ExpConditionMaterialAnno(name = "driveMode", type = DriveMode.class, desc = "驾驶模式", category = ExpTypeCategory.ENUM)
private DriveMode driveMode; private DriveMode driveMode;
/** /**
@ -123,7 +124,7 @@ public class TrainInfo extends MapElement {
private boolean jump; private boolean jump;
@ExpConditionMaterialAnno(name = "hold", type = "boolean", desc = "是否扣车") @ExpConditionMaterialAnno(name = "hold", type = boolean.class, desc = "是否扣车")
private boolean hold; private boolean hold;
/** /**

View File

@ -1,5 +1,7 @@
package club.joylink.rtss.simulation.cbtc.training2.ecm.anno; package club.joylink.rtss.simulation.cbtc.training2.ecm.anno;
import club.joylink.rtss.simulation.cbtc.training2.ecm.vo.ExpTypeCategory;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
@ -22,10 +24,15 @@ public @interface ExpConditionMaterialAnno {
/** /**
* 素材类型即即设备类定义中字段值得类型 * 素材类型即即设备类定义中字段值得类型
*/ */
String type(); Class<?> type();
/** /**
* 素材描述即即设备类定义中字段的含义 * 素材描述即即设备类定义中字段的含义
*/ */
String desc(); String desc();
/**
* 素材类型数据类型
*/
ExpTypeCategory category() default ExpTypeCategory.BASE;
} }

View File

@ -44,7 +44,8 @@ public class ExpConditionMaterialCollector extends ClassPathScanningCandidateCom
public List<ExpConditionMaterialSrcVo> doCollect() { public List<ExpConditionMaterialSrcVo> doCollect() {
Set<BeanDefinition> bds = this.doScan("club.joylink.rtss.simulation.cbtc.data.map", Set<BeanDefinition> bds = this.doScan("club.joylink.rtss.simulation.cbtc.data.map",
"club.joylink.rtss.simulation.cbtc.data.vr", "club.joylink.rtss.simulation.cbtc.data.vo"); "club.joylink.rtss.simulation.cbtc.data.vr", "club.joylink.rtss.simulation.cbtc.data.vo",
"club.joylink.rtss.simulation.cbtc.CI.data");
List<ExpConditionMaterialSrcVo> list = new ArrayList<>(bds.size()); List<ExpConditionMaterialSrcVo> list = new ArrayList<>(bds.size());
bds.forEach(n -> { bds.forEach(n -> {
list.add(this.create(n.getBeanClassName())); list.add(this.create(n.getBeanClassName()));
@ -70,11 +71,7 @@ public class ExpConditionMaterialCollector extends ClassPathScanningCandidateCom
for (Field fd : fds) { for (Field fd : fds) {
if (fd.isAnnotationPresent(ExpConditionMaterialAnno.class)) { if (fd.isAnnotationPresent(ExpConditionMaterialAnno.class)) {
ExpConditionMaterialAnno ma = fd.getAnnotation(ExpConditionMaterialAnno.class); ExpConditionMaterialAnno ma = fd.getAnnotation(ExpConditionMaterialAnno.class);
ExpConditionMaterialVo m = new ExpConditionMaterialVo(); ExpConditionMaterialVo m = new ExpConditionMaterialVo(ma);
m.setName(ma.name());
m.setType(ma.type());
m.setDesc(ma.desc());
//
src.getMaterials().add(m); src.getMaterials().add(m);
} }
} }

View File

@ -1,8 +1,14 @@
package club.joylink.rtss.simulation.cbtc.training2.ecm.vo; package club.joylink.rtss.simulation.cbtc.training2.ecm.vo;
import club.joylink.rtss.simulation.cbtc.training2.ecm.anno.ExpConditionMaterialAnno;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import java.lang.reflect.Field;
import java.util.*;
@Data @Data
@NoArgsConstructor
public class ExpConditionMaterialVo { public class ExpConditionMaterialVo {
/** /**
* 素材名称即设备类定义中字段的名称 * 素材名称即设备类定义中字段的名称
@ -16,4 +22,53 @@ public class ExpConditionMaterialVo {
* 素材描述即即设备类定义中字段的含义 * 素材描述即即设备类定义中字段的含义
*/ */
private String desc; private String desc;
/**
* 素材类型数据类型
*/
private String category;
/**
* 值列表
*/
private List<Map<String, Object>> valueList;
public ExpConditionMaterialVo(ExpConditionMaterialAnno ma) {
this.name = ma.name();
this.type = ma.type().getSimpleName();
this.desc = ma.desc();
if (ma.category() != null) {
this.category = ma.category().name();
}
if (ExpTypeCategory.ENUM.equals(ma.category())) {
this.valueList = getEnumValue(ma.type());
}
}
/**
* 获取枚举说明与值
*/
private List<Map<String, Object>> getEnumValue(Class<?> enumClass) {
List<Map<String, Object>> resultList = new ArrayList<>();
try {
Field labelField = enumClass.getDeclaredField("label");
labelField.setAccessible(true);
Enum[] enums = (Enum[]) enumClass.getEnumConstants();
Map<String, Object> valueMap = null;
Object label = null;
// 当没有描述时则不返回枚举
for (Enum anEnum : enums) {
label = labelField.get(anEnum);
if (!Objects.equals("", label) && !Objects.equals(null, label)) {
valueMap = new HashMap<>();
valueMap.put(labelField.getName(), labelField.get(anEnum));
valueMap.put("value", anEnum.name());
resultList.add(valueMap);
}
}
} catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException e) {
throw new RuntimeException(e);
}
return resultList;
}
} }

View File

@ -0,0 +1,9 @@
package club.joylink.rtss.simulation.cbtc.training2.ecm.vo;
public enum ExpTypeCategory {
BASE, // 基本类型
DEVICE, // 设备类型
ENUM // 枚举类型
}