非实时消息
This commit is contained in:
parent
836d4b484b
commit
d3d856d45d
@ -6,6 +6,7 @@ import java.nio.ByteBuffer;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@ -83,52 +84,6 @@ public abstract class MessageData {
|
||||
return this.length + 2;
|
||||
}
|
||||
|
||||
@NoArgsConstructor
|
||||
public static class DateTime {
|
||||
|
||||
private short year;
|
||||
|
||||
private byte month;
|
||||
private byte day;
|
||||
private byte hour;
|
||||
private byte minute;
|
||||
private byte second;
|
||||
|
||||
public DateTime(ByteBuf buf) {
|
||||
this.year = buf.readShort();
|
||||
this.month = buf.readByte();
|
||||
this.day = buf.readByte();
|
||||
this.hour = buf.readByte();
|
||||
this.minute = buf.readByte();
|
||||
this.second = buf.readByte();
|
||||
}
|
||||
|
||||
private DateTime(LocalDateTime localDateTime) {
|
||||
this.year = (short) localDateTime.getYear();
|
||||
this.month = (byte) localDateTime.getMonth().getValue();
|
||||
this.day = (byte) localDateTime.getDayOfMonth();
|
||||
this.hour = (byte) localDateTime.getHour();
|
||||
this.minute = (byte) localDateTime.getMinute();
|
||||
this.second = (byte) localDateTime.getSecond();
|
||||
}
|
||||
|
||||
public byte[] requestData() {
|
||||
ByteBuffer buf = ByteBuffer.allocate(7);
|
||||
buf.putShort(this.year);
|
||||
buf.put(this.month);
|
||||
buf.put(this.day);
|
||||
buf.put(this.hour);
|
||||
buf.put(this.minute);
|
||||
buf.put(this.second);
|
||||
return buf.array();
|
||||
}
|
||||
|
||||
public static DateTime parseNow() {
|
||||
return new DateTime(LocalDateTime.now());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public enum ReportSiteEnum {
|
||||
STATION(0x01), CENTER(0x02), UNKNOW(0x00);
|
||||
@ -181,408 +136,5 @@ public abstract class MessageData {
|
||||
}
|
||||
}
|
||||
|
||||
public enum DeviceTypeEnum {
|
||||
/**
|
||||
* 未知的设备
|
||||
*/
|
||||
DEVICE_TYPE_UNKNOW(0),
|
||||
/**
|
||||
* 集中站
|
||||
*/
|
||||
DEVICE_TYPE_RTU(1),
|
||||
/**
|
||||
* 车站
|
||||
*/
|
||||
DEVICE_TYPE_STATION(2),
|
||||
/**
|
||||
* 信号机
|
||||
*/
|
||||
DEVICE_TYPE_SIGNAL(3),
|
||||
/**
|
||||
* 道岔
|
||||
*/
|
||||
DEVICE_TYPE_SWITCH(4),
|
||||
/**
|
||||
* 轨道
|
||||
*/
|
||||
DEVICE_TYPE_TRACK(5),
|
||||
/**
|
||||
* 方向
|
||||
*/
|
||||
DEVICE_TYPE_ENTRY(6),
|
||||
/**
|
||||
* 站台
|
||||
*/
|
||||
DEVICE_TYPE_PLATFORM(7),
|
||||
/**
|
||||
* 供电区段
|
||||
*/
|
||||
DEVICE_TYPE_SCADA(9),
|
||||
/**
|
||||
* 防淹门
|
||||
*/
|
||||
DEVICE_TYPE_WATERPROOF_DOOR(11),
|
||||
/**
|
||||
* 工作区
|
||||
*/
|
||||
DEVICE_TYPE_WORK_AREA(12),
|
||||
/**
|
||||
* 区域自动驾驶
|
||||
*/
|
||||
DEVICE_TYPE_GAMA(13),
|
||||
;
|
||||
int val;
|
||||
|
||||
DeviceTypeEnum(int d) {
|
||||
this.val = d;
|
||||
}
|
||||
|
||||
public static DeviceTypeEnum of(int d) {
|
||||
return Arrays.stream(DeviceTypeEnum.values()).filter(dd -> dd.val == d).findFirst().orElse(null);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 表6.3-1设备状态定义表 - RTU
|
||||
*/
|
||||
public enum DeviceTypeStatusRTUEnum {
|
||||
IP_RTU_STUS_DOWN(0x00008000),// 通信中断
|
||||
IP_RTU_STUS_IN_LOCAL_CTRL(0x00000001),// 站控
|
||||
IP_RTU_STUS_IN_CENTRAL_CTRL(0x00000002),// 遥控
|
||||
IP_RTU_STUS_IN_EMERGENCY_CTRL(0x00000004);// 紧急站控
|
||||
|
||||
int val;
|
||||
|
||||
DeviceTypeStatusRTUEnum(int val) {
|
||||
this.val = val;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 表6.3-2 设备状态定义表 – STATION
|
||||
* <p>
|
||||
* 注:西安3号线信号系统不提供此类型设备的状态。
|
||||
*/
|
||||
public enum DeviceTypeStatusSTATIONEnum {
|
||||
IP_STA_STUS_TERM_MODE1(0x00000001),//终端模式1(terminaL3)
|
||||
IP_STA_STUS_TERM_MODE2(0x00000002),//终端模式2(terminal2)
|
||||
IP_STA_STUS_TERM_MODE3(0x00000004),//终端模式3(terminal3)
|
||||
IP_STA_STUS_TERM_MODE4(0x00000008),//终端模式4(terminal4)
|
||||
IP_STA_STUS_TERM_MODE5(0x00000010),//终端模式5(terminal5)
|
||||
IP_STA_STUS_TERM_MODE6(0x00000020),//终端模式6(terminal6)
|
||||
IP_STA_STUS_EXPECT_TERM_MODE1(0x00000040),//中间状态,用户请求终端模式1中
|
||||
IP_STA_STUS_EXPECT_TERM_MODE2(0x00000080),//中间状态,用户请求终端模式2中
|
||||
IP_STA_STUS_EXPECT_TERM_MODE3(0x00000100),//中间状态,用户请求终端模式3中
|
||||
IP_STA_STUS_EXPECT_TERM_MODE4(0x00000200),//中间状态,用户请求终端模式4中
|
||||
IP_STA_STUS_EXPECT_TERM_MODE5(0x00000400),//中间状态,用户请求终端模式5中
|
||||
IP_STA_STUS_EXPECT_TERM_MODE6(0x00000800),//中间状态,用户请求终端模式6中
|
||||
IP_STA_STUS_IN_CYCLE1(0x00001000),//自动折返1(CY1-CYC)
|
||||
IP_STA_STUS_IN_CYCLE2(0x00002000),//自动折返2(CY2-CYC)
|
||||
IP_STA_STUS_IN_CYCLE3(0x00004000),//自动折返3(CY3-CYC)
|
||||
IP_STA_STUS_IN_CYCLE4(0x00008000),//自动折返4(CY4-CYC)
|
||||
IP_STA_STUS_IN_CYCLE5(0x00010000),//自动折返5(CY5-CYC)
|
||||
IP_STA_STUS_IN_CYCLE6(0x00020000),//自动折返6(CY6-CYC)
|
||||
IP_STA_STUS_EXPECT_CYCLE1(0x00040000),//中间状态,用户请求自动折返1中
|
||||
IP_STA_STUS_EXPECT_CYCLE2(0x00080000),//中间状态,用户请求自动折返2中
|
||||
IP_STA_STUS_EXPECT_CYCLE3(0x00100000),//中间状态,用户请求自动折返3中
|
||||
IP_STA_STUS_EXPECT_CYCLE4(0x00200000),//中间状态,用户请求自动折返4中
|
||||
IP_STA_STUS_EXPECT_CYCLE5(0x00400000),//中间状态,用户请求自动折返5中
|
||||
IP_STA_STUS_EXPECT_CYCLE6(0x00800000),//中间状态,用户请求自动折返6中
|
||||
;
|
||||
int val;
|
||||
|
||||
DeviceTypeStatusSTATIONEnum(int val) {
|
||||
this.val = val;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 表6.3-3 设备状态定义表 – SIGNAL
|
||||
* <p>
|
||||
* 注:西安3号线信号系统不提供序号为2、4、6、8、10、12、13、14、17、23的信号机状态。
|
||||
*/
|
||||
public enum DeviceTypeStatusSIGNALEnum {
|
||||
// 定义枚举对象RED_OPEN,值为0x00000001,表示红灯亮
|
||||
RED_OPEN(0x00000001),
|
||||
// 定义枚举对象RED_FLASH,值为0x00000002,表示红灯闪
|
||||
RED_FLASH(0x00000002),
|
||||
// 定义枚举对象GREEN_OPEN,值为0x00000004,表示绿灯亮
|
||||
GREEN_OPEN(0x00000004),
|
||||
// 定义枚举对象GREEN_FLASH,值为0x00000008,表示绿灯闪
|
||||
GREEN_FLASH(0x00000008),
|
||||
// 定义枚举对象YELLOW_OPEN,值为0x00000010,表示黄灯亮
|
||||
YELLOW_OPEN(0x00000010),
|
||||
// 定义枚举对象YELLOW_FLASH,值为0x00000020,表示黄灯闪
|
||||
YELLOW_FLASH(0x00000020),
|
||||
// 定义枚举对象WHITE_OPEN,值为0x00000040,表示白灯亮
|
||||
WHITE_OPEN(0x00000040),
|
||||
// 定义枚举对象WHITE_FLASH,值为0x00000080,表示白灯闪
|
||||
WHITE_FLASH(0x00000080),
|
||||
// 定义枚举对象BLUE_OPEN,值为0x00000100,表示蓝灯亮
|
||||
BLUE_OPEN(0x00000100),
|
||||
// 定义枚举对象BLUE_FLASH,值为0x00000200,表示蓝灯闪
|
||||
BLUE_FLASH(0x00000200),
|
||||
// 定义枚举对象FLEET_MODE,值为0x00010000,表示信号机fleet模式
|
||||
FLEET_MODE(0x00010000),
|
||||
// 定义枚举对象CTRL_FLEET_MODE,值为0x00020000,表示设置或取消信号机fleet模式办理中
|
||||
CTRL_FLEET_MODE(0x00020000),
|
||||
// 定义枚举对象AUTO_MODE,值为0x00040000,表示信号机处于auto模式,即CAD允许信号机为始端进路自动触发
|
||||
AUTO_MODE(0x00040000),
|
||||
// 定义枚举对象CTRL_AUTO_MODE,值为0x00080000,表示设置或取消信号机auto模式办理中
|
||||
CTRL_AUTO_MODE(0x00080000),
|
||||
// 定义枚举对象EXTINGUISH,值为0x00100000,表示信号机处于灭灯状态
|
||||
EXTINGUISH(0x00100000),
|
||||
// 定义枚举对象APPROACH_LOCK,值为0x00200000,表示进路处于接近锁闭
|
||||
APPROACH_LOCK(0x00200000),
|
||||
// 定义枚举对象PROTECT_ROUTE,值为0x00400000,表示进路的保护进路已办理
|
||||
PROTECT_ROUTE(0x00400000),
|
||||
// 定义枚举对象AUTO_ROUTE_DISABLE,值为0x00800000,表示信号机后方有进路被关闭自动触发功能(信号机后方有进路处于人工控)
|
||||
AUTO_ROUTE_DISABLE(0x00800000),
|
||||
// 定义枚举对象CALLON,值为0x01000000,表示信号机引导状态
|
||||
CALLON(0x01000000),
|
||||
// 定义枚举对象YELLOW_YELLOW,值为0x02000000,表示信号机双黄灯
|
||||
YELLOW_YELLOW(0x02000000),
|
||||
// 定义枚举对象YELLOW_GREEN,值为0x04000000,表示信号机黄绿灯
|
||||
YELLOW_GREEN(0x04000000),
|
||||
// 定义枚举对象BLOCKED,值为0x08000000,表示信号机封锁
|
||||
BLOCKED(0x08000000),
|
||||
// 定义枚举对象LAMP_FAILURE,值为0x10000000,表示信号机灯丝断丝
|
||||
LAMP_FAILURE(0x10000000);
|
||||
int val;
|
||||
|
||||
DeviceTypeStatusSIGNALEnum(int val) {
|
||||
this.val = val;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 表6.3-4设备状态定义表 – ENTRY 注:西安3号线信号系统不提供此类型设备的状态。
|
||||
*/
|
||||
public enum DeviceTypeStatusENTRYEnum {
|
||||
// 定义枚举对象DIR_LEFT,值为0x00000001
|
||||
DIR_LEFT(0x00000001),
|
||||
// 定义枚举对象DIR_RIGHT,值为0x00000002
|
||||
DIR_RIGHT(0x00000002),
|
||||
// 定义枚举对象DIR_LOCKED,值为0x00000004
|
||||
DIR_LOCKED(0x00000004);
|
||||
int val;
|
||||
|
||||
DeviceTypeStatusENTRYEnum(int val) {
|
||||
this.val = val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 表6.3-5 设备状态定义表 – SWITCH
|
||||
* <p>
|
||||
* 注:西安3号线信号系统不提供序号为9、10、11、12、13、14、15、16的道岔状态
|
||||
*/
|
||||
public enum DeviceTypeStatusSWITCHEnum {
|
||||
IP_SINGLE_SWITCH_STUS_CI_OCCUPIED(0x00000002),//联锁报告道岔占用
|
||||
IP_SINGLE_SWITCH_STUS_CBTC_OCCUPIED(0x00000004),//CBTC报告列车占用该道岔
|
||||
IP_SINGLE_SWITCH_STUS_LOCKED(0x00000008),//道岔锁闭
|
||||
IP_SINGLE_SWITCH_STUS_FAIL_LOCKED(0x00000010),//道岔故障锁闭
|
||||
IP_SINGLE_SWITCH_STUS_NORMAL(0x00000020),//道岔定位
|
||||
IP_SINGLE_SWITCH_STUS_REVERSE(0x00000040),//道岔反位
|
||||
IP_SINGLE_SWITCH_STUS_BLOCKED_1(0x00000080),//道岔单锁
|
||||
IP_SINGLE_SWITCH_STUS_JAMMED(0x00000100),//道岔挤岔
|
||||
IP_SINGLE_SWITCH_STUS_EXPECT_LOCK(0x00000200),//期望锁闭
|
||||
IP_SINGLE_SWITCH_STUS_EXPECT_UNLOCK(0x00000400),//期望解除锁闭
|
||||
IP_SINGLE_SWITCH_STUS_EXPECT_NORMAL(0x00000800),//进路和道岔单操命令中的期望道岔定位
|
||||
IP_SINGLE_SWITCH_STUS_EXPECT_REVERSE(0x00001000),//进路和道岔单操命令中的期望道岔反位
|
||||
IP_SINGLE_SWITCH_STUS_EXPECT_BLOCK(0x00002000),//期望道岔单锁
|
||||
IP_SINGLE_SWITCH_STUS_EXPECT_UNBLOCK(0x00004000),//期望道岔解除单锁
|
||||
IP_SINGLE_SWITCH_STUS_IN_ROUTE(0x00008000),//是否在进路中锁闭,控制是否需要显示锁闭
|
||||
IP_SINGLE_SWITCH_STUS_MANUAL_MODE(0x00010000),//道岔为手动操作模式
|
||||
IP_SINGLE_SWITCH_STUS_CUT(0x00020000),//道岔切除
|
||||
IP_SINGLE_SWITCH_STUS_ATC_INVALID(0x00040000),//道岔区段被ATC报告失效
|
||||
IP_SINGLE_SWITCH_STUS_OVERLAP(0x00080000),//OVERLAP
|
||||
IP_SINGLE_SWITCH_STUS_TSR_CBTC_MAIN(0x00100000),//CBTC岔前限速
|
||||
IP_SINGLE_SWITCH_STUS_TSR_CBTC_NORMAL(0x00200000),//CBTC定位限速
|
||||
IP_SINGLE_SWITCH_STUS_TSR_CBTC_REVERSE(0x00400000),//CBTC反位限速
|
||||
IP_SINGLE_SWITCH_STUS_TSR_BM_MAIN(0x00800000),//BM岔前限速
|
||||
IP_SINGLE_SWITCH_STUS_TSR_BM_NORMAL(0x01000000),//BM定位限速
|
||||
IP_SINGLE_SWITCH_STUS_TSR_BM_REVERSE(0x02000000),//BM反位限速
|
||||
IP_SINGLE_SWITCH_STUS_BLOCKED_2(0x04000000),//道岔封锁
|
||||
IP_SINGLE_SWITCH_STUS_LOST_INDICATION(0x08000000);//道岔失表示
|
||||
int val;
|
||||
|
||||
DeviceTypeStatusSWITCHEnum(int val) {
|
||||
this.val = val;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 表6.3-6 设备状态定义表 – TRACK
|
||||
*/
|
||||
public enum DeviceTypeStatusTRACKEnum {
|
||||
CI_OCCUPIED(0x00000002), // 联锁报告区段占用
|
||||
CBTC_OCCUPIED(0x00000004), // CBTC信息报告轨道占用
|
||||
LOCKED(0x00000008), // 锁闭
|
||||
FAIL_LOCKED(0x00000010), // 故障锁闭
|
||||
EXPECT_LOCK(0x00000020), // 进路办理中,期望锁闭
|
||||
EXPECT_UNLOCK(0x00000040), // 进路取消中,期望解除锁闭
|
||||
IN_ROUTE(0x00000080), // 是否在进路中锁闭,控制是否需要显示锁闭
|
||||
CUT(0x00000100), // 轨道切除
|
||||
ATC_INVALID(0x00000200), // 轨道区段被ATC报告失效
|
||||
OVERLAP(0x00000400), // OVERLAP
|
||||
BLOCKED(0x00000800); // 轨道区段封锁
|
||||
//TODO 0xABC00000 AB这个字节表示限速值KM/H
|
||||
//C:
|
||||
//为1时,CBTC限速;
|
||||
//为2时,联锁限速;
|
||||
//为4时,同时限速。
|
||||
int val;
|
||||
|
||||
DeviceTypeStatusTRACKEnum(int val) {
|
||||
this.val = val;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 表6.3-7 设备状态定义表 – PLATFORM
|
||||
*/
|
||||
public enum DeviceTypeStatusPLATFORMEnum {
|
||||
EMERGSTOP(0x00000001), // 紧急关闭
|
||||
TRAINBERTH(0x00000002), // 列车停站
|
||||
CLOSE(0x00000004), // 站台关闭,清客
|
||||
UP_HOLD(0x00000010), // 上行方向车站扣车
|
||||
DOWN_HOLD(0x00000020), // 下行方向车站扣车
|
||||
UP_OCC_HOLD(0x00000040), // 上行方向中心扣车
|
||||
DOWN_OCC_HOLD(0x00000080), // 下行方向中心扣车
|
||||
PSD_OPEN(0x00000100), // 屏蔽门开
|
||||
PSD_CUT(0x00000200), // 屏蔽门切除
|
||||
UP_SKIPSTOP(0x00000400), // 上行方向跳停
|
||||
DOWN_SKIPSTOP(0x00000800), // 下行方向跳停
|
||||
UP_TRAIN_SKIPSTOP(0x00001000), // 上行方向指定列车跳停
|
||||
DOWN_TRAIN_SKIPSTOP(0x00002000); // 下行方向指定列车跳停
|
||||
//TODO 0xABCD0000 ABCD这两个字节表示停站时间
|
||||
int val;
|
||||
|
||||
DeviceTypeStatusPLATFORMEnum(int val) {
|
||||
this.val = val;
|
||||
}
|
||||
}
|
||||
|
||||
public enum DeviceTypeStatusSCADAEnum {
|
||||
SCADA_ON(0x00000001), // 有电
|
||||
SCADA_SINGLE_POWER(0x00000002), // 单边供电
|
||||
SCADA_UNKOWN(0x00000004); // 未知状态
|
||||
private final int value;
|
||||
|
||||
DeviceTypeStatusSCADAEnum(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备状态定义表 – WATERPROOF_DOOR
|
||||
*/
|
||||
public enum DeviceTypeStatusWATERPROOF_DOOREnum {
|
||||
|
||||
DOOR_CLOSED(0x00000001), // 防淹门关闭
|
||||
DOOR_EXPECT_CLOSE(0x00000002), // 请求防淹门关闭
|
||||
DOOR_AGREE_CLOSED(0x00000004), // 同意防淹门关闭
|
||||
DOOR_CLOSING(0x00000008), // 防淹门处于关门过程中
|
||||
DOOR_OPEN_LOCK(0x00000010); // 防淹门处于开门且锁紧状态
|
||||
// 枚举类型的值
|
||||
private final int value;
|
||||
|
||||
// 获取枚举类型的值
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
DeviceTypeStatusWATERPROOF_DOOREnum(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备状态定义表 – WORK_AREA
|
||||
*/
|
||||
|
||||
public enum DeviceTypeStatusWORK_AREAEnum {
|
||||
/**
|
||||
* 该位为1 工作区使能
|
||||
*/
|
||||
IP_STUS_WORK_AREA_ENABLE(0x00000001);;
|
||||
int val;
|
||||
|
||||
DeviceTypeStatusWORK_AREAEnum(int val) {
|
||||
this.val = val;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备状态定义表 – GAMA
|
||||
*/
|
||||
public enum DeviceTypeStatusGAMAEnum {
|
||||
/**
|
||||
* 该位为1 GAMA不使能
|
||||
*/
|
||||
IP_STUS_GAMA_DISABLE(0x00000001);
|
||||
int val;
|
||||
|
||||
DeviceTypeStatusGAMAEnum(int val) {
|
||||
this.val = val;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TRAIN_MODE
|
||||
*/
|
||||
public enum DeviceTypeStatusTRAIN_MODEEnum {
|
||||
IP_MODE_TRAIN_TYPE_MANUAL(0x00000000), // 人工车
|
||||
IP_MODE_TRAIN_TYPE_HEAD(0x00000001), // 头码车
|
||||
IP_MODE_TRAIN_TYPE_SPECIAL(0x00000002), // 特殊人工车
|
||||
IP_MODE_TRAIN_TYPE_SCHEDULE(0x00000003), // 计划车
|
||||
IP_MODE_TRAIN_TYPE_ROUTE(0x00000004), // 运行线车
|
||||
IP_MODE_TRAIN_TYPE_SHUTTLE(0x00000005), // 单线往返车
|
||||
IP_MODE_TRAIN_TYPE_LINEUP(0x00000006), // 预定义车
|
||||
|
||||
IP_MODE_TRAIN_SCHD_EARLY(0x00000008), // 早点计划车
|
||||
IP_MODE_TRAIN_SCHD_LATE(0x00000010), // 晚点计划车
|
||||
IP_MODE_TRAIN_SKIPSTOP(0x00000100), // 设置跳停
|
||||
IP_MODE_TRAIN_CBTC_MODE(0x00000200), // CBTC跟踪模式
|
||||
IP_MODE_TRAIN_ATP_CUT(0x00000400), // 列车ATP切除
|
||||
IP_MODE_TRAIN_BERTHED(0x00000800), // 在站台或存车线停站
|
||||
IP_MODE_TRAIN_STOPED(0x00001000), // 列车停止运动
|
||||
IP_MODE_TRAIN_HOLDED(0x00002000), // 被扣车
|
||||
IP_MODE_TRAIN_ITAMA(0x00004000), // ITAMA允许
|
||||
IP_MODE_TRAIN_DIR_UP(0x00008000), // 跟踪的列车运动方向为上行
|
||||
IP_MODE_TRAIN_DIR_DOWN(0x00010000), // 跟踪的列车运动方向为下行
|
||||
IP_MODE_TRAIN_DIR_HEAD_UP(0x00020000), // 根据ATC报告列车上行头牵引
|
||||
IP_MODE_TRAIN_DIR_HEAD_DOWN(0x00040000), // 根据ATC报告列车下行头牵引
|
||||
IP_MODE_TRAIN_DOOR_OPEN(0x00080000), // 列车车门状态(关闭、开启)
|
||||
IP_MODE_TRAIN_RS_ALARM(0x00100000), // 列车车辆接口告警状态
|
||||
IP_MODE_TRAIN_DOOR_ALARM(0x00200000), // 列车车门告警状态
|
||||
IP_MODE_TRAIN_EB_ALARM(0x00400000), // 列车紧急制动告警
|
||||
IP_MODE_TRAIN_INTEGRITY_ALARM(0x00800000), // 列车完整性告警
|
||||
|
||||
// 列车驾驶模式掩码
|
||||
IP_MODE_TRAIN_DRIVE_MODE_AM(0x10000000), // CBTC模式下有人自动驾驶模式
|
||||
IP_MODE_TRAIN_DRIVE_MODE_CM(0x20000000), // CBTC模式下人工驾驶模式
|
||||
IP_MODE_TRAIN_DRIVE_MODE_RMF(0x30000000), // RM模式前进
|
||||
IP_MODE_TRAIN_DRIVE_MODE_DTO(0x40000000), // DTO无人驾驶模式
|
||||
IP_MODE_TRAIN_DRIVE_MODE_ATB(0x50000000), // ATB自动折返模式
|
||||
IP_MODE_TRAIN_DRIVE_BLOCK_AM(0x60000000), // 点式有人自动驾驶模式
|
||||
IP_MODE_TRAIN_DRIVE_BLOCK_CM(0x70000000), // 点式人工驾驶模式
|
||||
IP_MODE_TRAIN_DRIVE_MODE_RMR(0x80000000), // RM模式后退
|
||||
IP_MODE_TRAIN_DRIVE_MODE_WASH(0x90000000); // 洗车模式
|
||||
// 枚举类型的值
|
||||
private final int value;
|
||||
|
||||
// 枚举类型的构造函数
|
||||
DeviceTypeStatusTRAIN_MODEEnum(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
// 获取枚举类型的值
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package club.joylink.xiannccda.ats.message.rep;
|
||||
import club.joylink.xiannccda.ats.message.MessageId;
|
||||
import club.joylink.xiannccda.ats.message.MessageResponse;
|
||||
import club.joylink.xiannccda.ats.message.rep.EntityParseUtil.ReadData;
|
||||
import club.joylink.xiannccda.ats.message.rep.device.DeviceType;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import java.util.List;
|
||||
|
||||
@ -70,7 +71,7 @@ public class DeviceStatusBitmapResponse extends MessageResponse {
|
||||
* <p>
|
||||
* 注1: type:设备类型定义。包括信号机,道岔,站台,轨道,报警,集中站设备,车站设备等,但列车的设备状态不在本消息里面发送。
|
||||
*/
|
||||
private DeviceTypeEnum type;
|
||||
private DeviceType type;
|
||||
/**
|
||||
* 该类设备的数目(2)
|
||||
*/
|
||||
@ -92,21 +93,61 @@ public class DeviceStatusBitmapResponse extends MessageResponse {
|
||||
|
||||
private List<DeviceEntity> deviceList;
|
||||
|
||||
public void runTime() {
|
||||
if (type == DeviceType.DEVICE_TYPE_PLATFORM) {
|
||||
// this.spare;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void runLevel() {
|
||||
if (type == DeviceType.DEVICE_TYPE_PLATFORM) {
|
||||
// this.spare;
|
||||
}
|
||||
}
|
||||
|
||||
public void speedLimit() {
|
||||
if (type == DeviceType.DEVICE_TYPE_SWITCH) {
|
||||
// this.spare;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public DeviceTypeEntity read(ByteBuf buf) {
|
||||
DeviceTypeEntity entity = new DeviceTypeEntity();
|
||||
|
||||
entity.type = DeviceTypeEnum.of(buf.readShort());
|
||||
entity.type = DeviceType.of(buf.readShort());
|
||||
entity.objCount = buf.readShort();
|
||||
entity.devName = EntityParseUtil.convertStr(buf, 24);
|
||||
entity.status = buf.readInt();
|
||||
entity.spare = buf.readInt();
|
||||
entity.deviceList = EntityParseUtil.collect(entity.objCount, buf, DeviceEntity.class);
|
||||
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
/* int d = 0x00040000;
|
||||
System.out.println((d & DeviceTypeStatusSIGNALEnum.APPROACH_LOCK.getVal()));
|
||||
boolean dd = (d & DeviceTypeStatusSIGNALEnum.APPROACH_LOCK.getVal()) == DeviceTypeStatusSIGNALEnum.APPROACH_LOCK.getVal();
|
||||
System.out.println(dd);*/
|
||||
|
||||
int i1 = -119;
|
||||
String s1 = Integer.toBinaryString(i1);
|
||||
System.out.println(s1);
|
||||
int i2 = 240;
|
||||
String s2 = Integer.toBinaryString(i2);
|
||||
System.out.println(s2);
|
||||
|
||||
int i3 = i1 & i2;
|
||||
System.out.println(i3);
|
||||
String s3 = Integer.toBinaryString(i3);
|
||||
System.out.println(s3);
|
||||
System.out.println(i1 & i2);
|
||||
System.out.println(4 & 7);
|
||||
}
|
||||
|
||||
public static class DeviceEntity implements ReadData<DeviceEntity> {
|
||||
|
||||
/**
|
||||
|
@ -3,6 +3,7 @@ package club.joylink.xiannccda.ats.message.rep;
|
||||
import club.joylink.xiannccda.ats.message.MessageData;
|
||||
import club.joylink.xiannccda.ats.message.MessageId;
|
||||
import club.joylink.xiannccda.ats.message.MessageResponse;
|
||||
import club.joylink.xiannccda.ats.message.rep.device.DeviceType;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
/**
|
||||
@ -33,7 +34,7 @@ public class DeviceStatusChangeResponse extends MessageResponse {
|
||||
/**
|
||||
* 设备类型(2),见附录2
|
||||
*/
|
||||
private DeviceTypeEnum type;
|
||||
private DeviceType type;
|
||||
/**
|
||||
* 设备名称(24)
|
||||
*/
|
||||
@ -59,7 +60,7 @@ public class DeviceStatusChangeResponse extends MessageResponse {
|
||||
public void decode2(ByteBuf buf) throws Exception {
|
||||
this.lineId = buf.readShort();
|
||||
this.rtuId = buf.readShort();
|
||||
this.type = DeviceTypeEnum.of(buf.readShort());
|
||||
this.type = DeviceType.of(buf.readShort());
|
||||
this.devName = EntityParseUtil.convertStr(buf, 24);
|
||||
this.deviceStatus = buf.readInt();
|
||||
this.spare = buf.readInt();
|
||||
|
@ -0,0 +1,352 @@
|
||||
package club.joylink.xiannccda.ats.message.rep.device;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
public class DeviceStatus {
|
||||
|
||||
/**
|
||||
* 表6.3-1设备状态定义表 - RTU
|
||||
*/
|
||||
public enum RTU {
|
||||
IP_RTU_STUS_DOWN(0x00008000),// 通信中断
|
||||
IP_RTU_STUS_IN_LOCAL_CTRL(0x00000001),// 站控
|
||||
IP_RTU_STUS_IN_CENTRAL_CTRL(0x00000002),// 遥控
|
||||
IP_RTU_STUS_IN_EMERGENCY_CTRL(0x00000004);// 紧急站控
|
||||
|
||||
int val;
|
||||
|
||||
RTU(int val) {
|
||||
this.val = val;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 表6.3-2 设备状态定义表 – STATION
|
||||
* <p>
|
||||
* 注:西安3号线信号系统不提供此类型设备的状态。
|
||||
*/
|
||||
public enum STATION {
|
||||
IP_STA_STUS_TERM_MODE1(0x00000001),//终端模式1(terminaL3)
|
||||
IP_STA_STUS_TERM_MODE2(0x00000002),//终端模式2(terminal2)
|
||||
IP_STA_STUS_TERM_MODE3(0x00000004),//终端模式3(terminal3)
|
||||
IP_STA_STUS_TERM_MODE4(0x00000008),//终端模式4(terminal4)
|
||||
IP_STA_STUS_TERM_MODE5(0x00000010),//终端模式5(terminal5)
|
||||
IP_STA_STUS_TERM_MODE6(0x00000020),//终端模式6(terminal6)
|
||||
IP_STA_STUS_EXPECT_TERM_MODE1(0x00000040),//中间状态,用户请求终端模式1中
|
||||
IP_STA_STUS_EXPECT_TERM_MODE2(0x00000080),//中间状态,用户请求终端模式2中
|
||||
IP_STA_STUS_EXPECT_TERM_MODE3(0x00000100),//中间状态,用户请求终端模式3中
|
||||
IP_STA_STUS_EXPECT_TERM_MODE4(0x00000200),//中间状态,用户请求终端模式4中
|
||||
IP_STA_STUS_EXPECT_TERM_MODE5(0x00000400),//中间状态,用户请求终端模式5中
|
||||
IP_STA_STUS_EXPECT_TERM_MODE6(0x00000800),//中间状态,用户请求终端模式6中
|
||||
IP_STA_STUS_IN_CYCLE1(0x00001000),//自动折返1(CY1-CYC)
|
||||
IP_STA_STUS_IN_CYCLE2(0x00002000),//自动折返2(CY2-CYC)
|
||||
IP_STA_STUS_IN_CYCLE3(0x00004000),//自动折返3(CY3-CYC)
|
||||
IP_STA_STUS_IN_CYCLE4(0x00008000),//自动折返4(CY4-CYC)
|
||||
IP_STA_STUS_IN_CYCLE5(0x00010000),//自动折返5(CY5-CYC)
|
||||
IP_STA_STUS_IN_CYCLE6(0x00020000),//自动折返6(CY6-CYC)
|
||||
IP_STA_STUS_EXPECT_CYCLE1(0x00040000),//中间状态,用户请求自动折返1中
|
||||
IP_STA_STUS_EXPECT_CYCLE2(0x00080000),//中间状态,用户请求自动折返2中
|
||||
IP_STA_STUS_EXPECT_CYCLE3(0x00100000),//中间状态,用户请求自动折返3中
|
||||
IP_STA_STUS_EXPECT_CYCLE4(0x00200000),//中间状态,用户请求自动折返4中
|
||||
IP_STA_STUS_EXPECT_CYCLE5(0x00400000),//中间状态,用户请求自动折返5中
|
||||
IP_STA_STUS_EXPECT_CYCLE6(0x00800000),//中间状态,用户请求自动折返6中
|
||||
;
|
||||
int val;
|
||||
|
||||
STATION(int val) {
|
||||
this.val = val;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 表6.3-3 设备状态定义表 – SIGNAL
|
||||
* <p>
|
||||
* 注:3西安3号线信号系统不提供序号为2、4、6、8、10、12、13、14、17、23的信号机状态。
|
||||
*/
|
||||
public enum SIGNAL {
|
||||
// 定义枚举对象RED_OPEN,值为0x00000001,表示红灯亮
|
||||
RED_OPEN(0x00000001),
|
||||
// 定义枚举对象RED_FLASH,值为0x00000002,表示红灯闪
|
||||
RED_FLASH(0x00000002),
|
||||
// 定义枚举对象GREEN_OPEN,值为0x00000004,表示绿灯亮
|
||||
GREEN_OPEN(0x00000004),
|
||||
// 定义枚举对象GREEN_FLASH,值为0x00000008,表示绿灯闪
|
||||
GREEN_FLASH(0x00000008),
|
||||
// 定义枚举对象YELLOW_OPEN,值为0x00000010,表示黄灯亮
|
||||
YELLOW_OPEN(0x00000010),
|
||||
// 定义枚举对象YELLOW_FLASH,值为0x00000020,表示黄灯闪
|
||||
YELLOW_FLASH(0x00000020),
|
||||
// 定义枚举对象WHITE_OPEN,值为0x00000040,表示白灯亮
|
||||
WHITE_OPEN(0x00000040),
|
||||
// 定义枚举对象WHITE_FLASH,值为0x00000080,表示白灯闪
|
||||
WHITE_FLASH(0x00000080),
|
||||
// 定义枚举对象BLUE_OPEN,值为0x00000100,表示蓝灯亮
|
||||
BLUE_OPEN(0x00000100),
|
||||
// 定义枚举对象BLUE_FLASH,值为0x00000200,表示蓝灯闪
|
||||
BLUE_FLASH(0x00000200),
|
||||
// 定义枚举对象FLEET_MODE,值为0x00010000,表示信号机fleet模式
|
||||
FLEET_MODE(0x00010000),
|
||||
// 定义枚举对象CTRL_FLEET_MODE,值为0x00020000,表示设置或取消信号机fleet模式办理中
|
||||
CTRL_FLEET_MODE(0x00020000),
|
||||
// 定义枚举对象AUTO_MODE,值为0x00040000,表示信号机处于auto模式,即CAD允许信号机为始端进路自动触发
|
||||
AUTO_MODE(0x00040000),
|
||||
// 定义枚举对象CTRL_AUTO_MODE,值为0x00080000,表示设置或取消信号机auto模式办理中
|
||||
CTRL_AUTO_MODE(0x00080000),
|
||||
// 定义枚举对象EXTINGUISH,值为0x00100000,表示信号机处于灭灯状态
|
||||
EXTINGUISH(0x00100000),
|
||||
// 定义枚举对象APPROACH_LOCK,值为0x00200000,表示进路处于接近锁闭
|
||||
APPROACH_LOCK(0x00200000),
|
||||
// 定义枚举对象PROTECT_ROUTE,值为0x00400000,表示进路的保护进路已办理
|
||||
PROTECT_ROUTE(0x00400000),
|
||||
// 定义枚举对象AUTO_ROUTE_DISABLE,值为0x00800000,表示信号机后方有进路被关闭自动触发功能(信号机后方有进路处于人工控)
|
||||
AUTO_ROUTE_DISABLE(0x00800000),
|
||||
// 定义枚举对象CALLON,值为0x01000000,表示信号机引导状态
|
||||
CALLON(0x01000000),
|
||||
// 定义枚举对象YELLOW_YELLOW,值为0x02000000,表示信号机双黄灯
|
||||
YELLOW_YELLOW(0x02000000),
|
||||
// 定义枚举对象YELLOW_GREEN,值为0x04000000,表示信号机黄绿灯
|
||||
YELLOW_GREEN(0x04000000),
|
||||
// 定义枚举对象BLOCKED,值为0x08000000,表示信号机封锁
|
||||
BLOCKED(0x08000000),
|
||||
// 定义枚举对象LAMP_FAILURE,值为0x10000000,表示信号机灯丝断丝
|
||||
LAMP_FAILURE(0x10000000);
|
||||
|
||||
@Getter
|
||||
int val;
|
||||
|
||||
SIGNAL(int val) {
|
||||
this.val = val;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 表6.3-4设备状态定义表 – ENTRY 注:西安3号线信号系统不提供此类型设备的状态。
|
||||
*/
|
||||
public enum ENTRY {
|
||||
// 定义枚举对象DIR_LEFT,值为0x00000001
|
||||
DIR_LEFT(0x00000001),
|
||||
// 定义枚举对象DIR_RIGHT,值为0x00000002
|
||||
DIR_RIGHT(0x00000002),
|
||||
// 定义枚举对象DIR_LOCKED,值为0x00000004
|
||||
DIR_LOCKED(0x00000004);
|
||||
int val;
|
||||
|
||||
ENTRY(int val) {
|
||||
this.val = val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 表6.3-5 设备状态定义表 – SWITCH
|
||||
* <p>
|
||||
* 注:西安3号线信号系统不提供序号为9、10、11、12、13、14、15、16的道岔状态
|
||||
*/
|
||||
public enum SWITCH {
|
||||
IP_SINGLE_SWITCH_STUS_CI_OCCUPIED(0x00000002),//联锁报告道岔占用
|
||||
IP_SINGLE_SWITCH_STUS_CBTC_OCCUPIED(0x00000004),//CBTC报告列车占用该道岔
|
||||
IP_SINGLE_SWITCH_STUS_LOCKED(0x00000008),//道岔锁闭
|
||||
IP_SINGLE_SWITCH_STUS_FAIL_LOCKED(0x00000010),//道岔故障锁闭
|
||||
IP_SINGLE_SWITCH_STUS_NORMAL(0x00000020),//道岔定位
|
||||
IP_SINGLE_SWITCH_STUS_REVERSE(0x00000040),//道岔反位
|
||||
IP_SINGLE_SWITCH_STUS_BLOCKED_1(0x00000080),//道岔单锁
|
||||
IP_SINGLE_SWITCH_STUS_JAMMED(0x00000100),//道岔挤岔
|
||||
IP_SINGLE_SWITCH_STUS_EXPECT_LOCK(0x00000200),//期望锁闭
|
||||
IP_SINGLE_SWITCH_STUS_EXPECT_UNLOCK(0x00000400),//期望解除锁闭
|
||||
IP_SINGLE_SWITCH_STUS_EXPECT_NORMAL(0x00000800),//进路和道岔单操命令中的期望道岔定位
|
||||
IP_SINGLE_SWITCH_STUS_EXPECT_REVERSE(0x00001000),//进路和道岔单操命令中的期望道岔反位
|
||||
IP_SINGLE_SWITCH_STUS_EXPECT_BLOCK(0x00002000),//期望道岔单锁
|
||||
IP_SINGLE_SWITCH_STUS_EXPECT_UNBLOCK(0x00004000),//期望道岔解除单锁
|
||||
IP_SINGLE_SWITCH_STUS_IN_ROUTE(0x00008000),//是否在进路中锁闭,控制是否需要显示锁闭
|
||||
IP_SINGLE_SWITCH_STUS_MANUAL_MODE(0x00010000),//道岔为手动操作模式
|
||||
IP_SINGLE_SWITCH_STUS_CUT(0x00020000),//道岔切除
|
||||
IP_SINGLE_SWITCH_STUS_ATC_INVALID(0x00040000),//道岔区段被ATC报告失效
|
||||
IP_SINGLE_SWITCH_STUS_OVERLAP(0x00080000),//OVERLAP
|
||||
IP_SINGLE_SWITCH_STUS_TSR_CBTC_MAIN(0x00100000),//CBTC岔前限速
|
||||
IP_SINGLE_SWITCH_STUS_TSR_CBTC_NORMAL(0x00200000),//CBTC定位限速
|
||||
IP_SINGLE_SWITCH_STUS_TSR_CBTC_REVERSE(0x00400000),//CBTC反位限速
|
||||
IP_SINGLE_SWITCH_STUS_TSR_BM_MAIN(0x00800000),//BM岔前限速
|
||||
IP_SINGLE_SWITCH_STUS_TSR_BM_NORMAL(0x01000000),//BM定位限速
|
||||
IP_SINGLE_SWITCH_STUS_TSR_BM_REVERSE(0x02000000),//BM反位限速
|
||||
IP_SINGLE_SWITCH_STUS_BLOCKED_2(0x04000000),//道岔封锁
|
||||
IP_SINGLE_SWITCH_STUS_LOST_INDICATION(0x08000000);//道岔失表示
|
||||
int val;
|
||||
|
||||
SWITCH(int val) {
|
||||
this.val = val;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 表6.3-6 设备状态定义表 – TRACK
|
||||
*/
|
||||
public enum TRACK {
|
||||
CI_OCCUPIED(0x00000002), // 联锁报告区段占用
|
||||
CBTC_OCCUPIED(0x00000004), // CBTC信息报告轨道占用
|
||||
LOCKED(0x00000008), // 锁闭
|
||||
FAIL_LOCKED(0x00000010), // 故障锁闭
|
||||
EXPECT_LOCK(0x00000020), // 进路办理中,期望锁闭
|
||||
EXPECT_UNLOCK(0x00000040), // 进路取消中,期望解除锁闭
|
||||
IN_ROUTE(0x00000080), // 是否在进路中锁闭,控制是否需要显示锁闭
|
||||
CUT(0x00000100), // 轨道切除
|
||||
ATC_INVALID(0x00000200), // 轨道区段被ATC报告失效
|
||||
OVERLAP(0x00000400), // OVERLAP
|
||||
BLOCKED(0x00000800); // 轨道区段封锁
|
||||
//TODO 0xABC00000 AB这个字节表示限速值KM/H
|
||||
//C:
|
||||
//为1时,CBTC限速;
|
||||
//为2时,联锁限速;
|
||||
//为4时,同时限速。
|
||||
int val;
|
||||
|
||||
TRACK(int val) {
|
||||
this.val = val;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 表6.3-7 设备状态定义表 – PLATFORM
|
||||
*/
|
||||
public enum PLATFORM {
|
||||
EMERGSTOP(0x00000001), // 紧急关闭
|
||||
TRAINBERTH(0x00000002), // 列车停站
|
||||
CLOSE(0x00000004), // 站台关闭,清客
|
||||
UP_HOLD(0x00000010), // 上行方向车站扣车
|
||||
DOWN_HOLD(0x00000020), // 下行方向车站扣车
|
||||
UP_OCC_HOLD(0x00000040), // 上行方向中心扣车
|
||||
DOWN_OCC_HOLD(0x00000080), // 下行方向中心扣车
|
||||
PSD_OPEN(0x00000100), // 屏蔽门开
|
||||
PSD_CUT(0x00000200), // 屏蔽门切除
|
||||
UP_SKIPSTOP(0x00000400), // 上行方向跳停
|
||||
DOWN_SKIPSTOP(0x00000800), // 下行方向跳停
|
||||
UP_TRAIN_SKIPSTOP(0x00001000), // 上行方向指定列车跳停
|
||||
DOWN_TRAIN_SKIPSTOP(0x00002000); // 下行方向指定列车跳停
|
||||
//TODO 0xABCD0000 ABCD这两个字节表示停站时间
|
||||
int val;
|
||||
|
||||
PLATFORM(int val) {
|
||||
this.val = val;
|
||||
}
|
||||
}
|
||||
|
||||
public enum SCADA {
|
||||
SCADA_ON(0x00000001), // 有电
|
||||
SCADA_SINGLE_POWER(0x00000002), // 单边供电
|
||||
SCADA_UNKOWN(0x00000004); // 未知状态
|
||||
private final int value;
|
||||
|
||||
SCADA(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备状态定义表 – WATERPROOF_DOOR
|
||||
*/
|
||||
public enum WATERPROOF_DOOR {
|
||||
|
||||
DOOR_CLOSED(0x00000001), // 防淹门关闭
|
||||
DOOR_EXPECT_CLOSE(0x00000002), // 请求防淹门关闭
|
||||
DOOR_AGREE_CLOSED(0x00000004), // 同意防淹门关闭
|
||||
DOOR_CLOSING(0x00000008), // 防淹门处于关门过程中
|
||||
DOOR_OPEN_LOCK(0x00000010); // 防淹门处于开门且锁紧状态
|
||||
// 枚举类型的值
|
||||
private final int value;
|
||||
|
||||
// 获取枚举类型的值
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
WATERPROOF_DOOR(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备状态定义表 – WORK_AREA
|
||||
*/
|
||||
|
||||
public enum WORK_AREA {
|
||||
/**
|
||||
* 该位为1 工作区使能
|
||||
*/
|
||||
IP_STUS_WORK_AREA_ENABLE(0x00000001);;
|
||||
int val;
|
||||
|
||||
WORK_AREA(int val) {
|
||||
this.val = val;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备状态定义表 – GAMA
|
||||
*/
|
||||
public enum DeviceTypeStatusGAMAEnum {
|
||||
/**
|
||||
* 该位为1 GAMA不使能
|
||||
*/
|
||||
IP_STUS_GAMA_DISABLE(0x00000001);
|
||||
int val;
|
||||
|
||||
DeviceTypeStatusGAMAEnum(int val) {
|
||||
this.val = val;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TRAIN_MODE
|
||||
*/
|
||||
public enum DeviceTypeStatusTRAIN_MODEEnum {
|
||||
IP_MODE_TRAIN_TYPE_MANUAL(0x00000000), // 人工车
|
||||
IP_MODE_TRAIN_TYPE_HEAD(0x00000001), // 头码车
|
||||
IP_MODE_TRAIN_TYPE_SPECIAL(0x00000002), // 特殊人工车
|
||||
IP_MODE_TRAIN_TYPE_SCHEDULE(0x00000003), // 计划车
|
||||
IP_MODE_TRAIN_TYPE_ROUTE(0x00000004), // 运行线车
|
||||
IP_MODE_TRAIN_TYPE_SHUTTLE(0x00000005), // 单线往返车
|
||||
IP_MODE_TRAIN_TYPE_LINEUP(0x00000006), // 预定义车
|
||||
|
||||
IP_MODE_TRAIN_SCHD_EARLY(0x00000008), // 早点计划车
|
||||
IP_MODE_TRAIN_SCHD_LATE(0x00000010), // 晚点计划车
|
||||
IP_MODE_TRAIN_SKIPSTOP(0x00000100), // 设置跳停
|
||||
IP_MODE_TRAIN_CBTC_MODE(0x00000200), // CBTC跟踪模式
|
||||
IP_MODE_TRAIN_ATP_CUT(0x00000400), // 列车ATP切除
|
||||
IP_MODE_TRAIN_BERTHED(0x00000800), // 在站台或存车线停站
|
||||
IP_MODE_TRAIN_STOPED(0x00001000), // 列车停止运动
|
||||
IP_MODE_TRAIN_HOLDED(0x00002000), // 被扣车
|
||||
IP_MODE_TRAIN_ITAMA(0x00004000), // ITAMA允许
|
||||
IP_MODE_TRAIN_DIR_UP(0x00008000), // 跟踪的列车运动方向为上行
|
||||
IP_MODE_TRAIN_DIR_DOWN(0x00010000), // 跟踪的列车运动方向为下行
|
||||
IP_MODE_TRAIN_DIR_HEAD_UP(0x00020000), // 根据ATC报告列车上行头牵引
|
||||
IP_MODE_TRAIN_DIR_HEAD_DOWN(0x00040000), // 根据ATC报告列车下行头牵引
|
||||
IP_MODE_TRAIN_DOOR_OPEN(0x00080000), // 列车车门状态(关闭、开启)
|
||||
IP_MODE_TRAIN_RS_ALARM(0x00100000), // 列车车辆接口告警状态
|
||||
IP_MODE_TRAIN_DOOR_ALARM(0x00200000), // 列车车门告警状态
|
||||
IP_MODE_TRAIN_EB_ALARM(0x00400000), // 列车紧急制动告警
|
||||
IP_MODE_TRAIN_INTEGRITY_ALARM(0x00800000), // 列车完整性告警
|
||||
|
||||
// 列车驾驶模式掩码
|
||||
IP_MODE_TRAIN_DRIVE_MODE_AM(0x10000000), // CBTC模式下有人自动驾驶模式
|
||||
IP_MODE_TRAIN_DRIVE_MODE_CM(0x20000000), // CBTC模式下人工驾驶模式
|
||||
IP_MODE_TRAIN_DRIVE_MODE_RMF(0x30000000), // RM模式前进
|
||||
IP_MODE_TRAIN_DRIVE_MODE_DTO(0x40000000), // DTO无人驾驶模式
|
||||
IP_MODE_TRAIN_DRIVE_MODE_ATB(0x50000000), // ATB自动折返模式
|
||||
IP_MODE_TRAIN_DRIVE_BLOCK_AM(0x60000000), // 点式有人自动驾驶模式
|
||||
IP_MODE_TRAIN_DRIVE_BLOCK_CM(0x70000000), // 点式人工驾驶模式
|
||||
IP_MODE_TRAIN_DRIVE_MODE_RMR(0x80000000), // RM模式后退
|
||||
IP_MODE_TRAIN_DRIVE_MODE_WASH(0x90000000); // 洗车模式
|
||||
// 枚举类型的值
|
||||
private final int value;
|
||||
|
||||
// 枚举类型的构造函数
|
||||
DeviceTypeStatusTRAIN_MODEEnum(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
// 获取枚举类型的值
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package club.joylink.xiannccda.ats.message.rep.device;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public enum DeviceType {
|
||||
/**
|
||||
* 未知的设备
|
||||
*/
|
||||
DEVICE_TYPE_UNKNOW(0),
|
||||
/**
|
||||
* 集中站
|
||||
*/
|
||||
DEVICE_TYPE_RTU(1),
|
||||
/**
|
||||
* 车站
|
||||
*/
|
||||
DEVICE_TYPE_STATION(2),
|
||||
/**
|
||||
* 信号机
|
||||
*/
|
||||
DEVICE_TYPE_SIGNAL(3),
|
||||
/**
|
||||
* 道岔
|
||||
*/
|
||||
DEVICE_TYPE_SWITCH(4),
|
||||
/**
|
||||
* 轨道
|
||||
*/
|
||||
DEVICE_TYPE_TRACK(5),
|
||||
/**
|
||||
* 方向
|
||||
*/
|
||||
DEVICE_TYPE_ENTRY(6),
|
||||
/**
|
||||
* 站台
|
||||
*/
|
||||
DEVICE_TYPE_PLATFORM(7),
|
||||
/**
|
||||
* 供电区段
|
||||
*/
|
||||
DEVICE_TYPE_SCADA(9),
|
||||
/**
|
||||
* 防淹门
|
||||
*/
|
||||
DEVICE_TYPE_WATERPROOF_DOOR(11),
|
||||
/**
|
||||
* 工作区
|
||||
*/
|
||||
DEVICE_TYPE_WORK_AREA(12),
|
||||
/**
|
||||
* 区域自动驾驶
|
||||
*/
|
||||
DEVICE_TYPE_GAMA(13),
|
||||
;
|
||||
int val;
|
||||
|
||||
DeviceType(int d) {
|
||||
this.val = d;
|
||||
}
|
||||
|
||||
public static DeviceType of(int d) {
|
||||
return Arrays.stream(DeviceType.values()).filter(dd -> dd.val == d).findFirst().orElse(null);
|
||||
|
||||
}
|
||||
}
|
@ -4,8 +4,10 @@ import club.joylink.xiannccda.ats.message.MessageData;
|
||||
import club.joylink.xiannccda.ats.message.MessageId;
|
||||
import club.joylink.xiannccda.ats.message.MessageRequest;
|
||||
import club.joylink.xiannccda.ats.message.line3.DateTimeUtil;
|
||||
import club.joylink.xiannccda.ats.message.rep.ScheduleSubIdType;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 2.8.9 事件及告警信息请求消息
|
||||
@ -39,7 +41,7 @@ public class AlarmAckRequest extends MessageRequest {
|
||||
* <p>
|
||||
* 02H:列车信息、系统事件
|
||||
*/
|
||||
private Short msgType;
|
||||
private MsgTypeEnum msgType;
|
||||
/**
|
||||
* 开始时间(7)
|
||||
*/
|
||||
@ -53,7 +55,7 @@ public class AlarmAckRequest extends MessageRequest {
|
||||
public void encode2(ByteBuf buf) {
|
||||
buf.writeShort(this.lineId);
|
||||
buf.writeShort(this.reportId);
|
||||
buf.writeShort(this.msgType);
|
||||
buf.writeShort(this.msgType.val);
|
||||
byte[] st = new byte[7];
|
||||
DateTimeUtil.convert(LocalDateTime.now(), st);
|
||||
byte[] et = new byte[7];
|
||||
@ -62,4 +64,18 @@ public class AlarmAckRequest extends MessageRequest {
|
||||
buf.writeBytes(st);
|
||||
buf.writeBytes(et);
|
||||
}
|
||||
|
||||
public enum MsgTypeEnum {
|
||||
OPTION_COMMON(0X01), TRAIN_EVENT(0X02);
|
||||
private final int val;
|
||||
|
||||
MsgTypeEnum(int val) {
|
||||
this.val = val;
|
||||
}
|
||||
|
||||
public static MsgTypeEnum of(int d) {
|
||||
return Arrays.stream(MsgTypeEnum.values()).filter(dd -> dd.val == d).findFirst().orElse(null);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user