diff --git a/src/main/java/club/joylink/xiannccda/ats/message/rep/ActionReportResponse.java b/src/main/java/club/joylink/xiannccda/ats/message/rep/ActionReportResponse.java index 4be62ce..8778300 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/rep/ActionReportResponse.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/rep/ActionReportResponse.java @@ -1,8 +1,7 @@ package club.joylink.xiannccda.ats.message.rep; import club.joylink.xiannccda.ats.message.MessageResponse; -import club.joylink.xiannccda.ats.message.rep.EntityParse.ReadData; -import com.google.common.collect.Lists; +import club.joylink.xiannccda.ats.message.rep.EntityParseUtil.ReadData; import io.netty.buffer.ByteBuf; import java.util.List; @@ -47,18 +46,38 @@ public class ActionReportResponse extends MessageResponse { this.totalMessage = buf.readShort(); this.messageSequence = buf.readShort(); this.count = buf.readShort(); - this.entityList = EntityParse.collect(this.count, buf, ActionReportEntity.class); + this.entityList = EntityParseUtil.collect(this.count, buf, ActionReportEntity.class); } + public enum ActionSiteEnum { + STATION(0x01), CENTER(0x02), UNKNOW(0x00); + int val; + + ActionSiteEnum(int b) { + this.val = b; + } + } public static class ActionReportEntity implements ReadData { /** - * 单位类型(1) 0x01:车站 0x02:中心 0x00:未知 + * 单位类型(1) + *

+ * 0x01:车站 + *

+ * 0x02:中心 + *

+ * 0x00:未知 */ private Byte actionSite; /** - * 单位编码(2) 单位类型为中心时,单位编码为调度台ID,中心服务器为0 单位类型为车站时,单位编码为站码 当单位类型为未知时,此项无效 + * 单位编码(2) + *

+ * 单位类型为中心时,单位编码为调度台ID,中心服务器为0 + *

+ * 单位类型为车站时,单位编码为站码 + *

+ * 当单位类型为未知时,此项无效 */ private Short actionSiteid; /** diff --git a/src/main/java/club/joylink/xiannccda/ats/message/rep/AlarmReportResponse.java b/src/main/java/club/joylink/xiannccda/ats/message/rep/AlarmReportResponse.java index 1521ac0..124738f 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/rep/AlarmReportResponse.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/rep/AlarmReportResponse.java @@ -2,9 +2,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.ActionReportResponse.ActionReportEntity; -import club.joylink.xiannccda.ats.message.rep.EntityParse.ReadData; -import com.google.common.collect.Lists; +import club.joylink.xiannccda.ats.message.rep.EntityParseUtil.ReadData; import io.netty.buffer.ByteBuf; import java.util.List; @@ -52,17 +50,29 @@ public class AlarmReportResponse extends MessageResponse { this.totalMessage = buf.readShort(); this.messageSequence = buf.readShort(); this.count = buf.readShort(); - this.entityList = EntityParse.collect(this.count, buf, AlarmReportEntity.class); + this.entityList = EntityParseUtil.collect(this.count, buf, AlarmReportEntity.class); } public static class AlarmReportEntity implements ReadData { /** - * 单位类型(1) 0x01:车站 0x02:中心 0x00:未知 + * 单位类型(1) + *

+ * 0x01:车站 + *

+ * 0x02:中心 + *

+ * 0x00:未知 */ private Byte alamrSite; /** - * 单位编码(2) 单位类型为中心时,单位编码为调度台ID,中心服务器为0 单位类型为车站时,单位编码为站码 当单位类型为未知时,此项无效 + * 单位编码(2) + *

+ * 单位类型为中心时,单位编码为调度台ID,中心服务器为0 + *

+ * 单位类型为车站时,单位编码为站码 + *

+ * 当单位类型为未知时,此项无效 */ private Short alarmSiteid; /** diff --git a/src/main/java/club/joylink/xiannccda/ats/message/rep/DepotPlanResponse.java b/src/main/java/club/joylink/xiannccda/ats/message/rep/DepotPlanResponse.java index 8021ba5..a35ac3f 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/rep/DepotPlanResponse.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/rep/DepotPlanResponse.java @@ -1,17 +1,22 @@ 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.EntityParse.ReadData; -import club.joylink.xiannccda.ats.message.rep.SignalRouteStatusResponse.RouteStatusEntity; -import com.google.common.collect.Lists; +import club.joylink.xiannccda.ats.message.rep.EntityParseUtil.ReadData; import io.netty.buffer.ByteBuf; import java.util.List; /** * 2.7.7 出入库派班计划消息 + *

+ * 发送条件: + *

+ * 当OCC FEP收到NCC FEP的ATS信息请求消息时,发送此信息给NCC; + *

+ * 当OCC FEP判断和OCC服务器断开重连上后,发送此信息给NCC; + *

+ * 当天出入库派班计划发生变更时,OCC FEP发送此信息给NCC 。 */ /* 2.7.7.1 应用场景 @@ -50,7 +55,7 @@ public class DepotPlanResponse extends MessageResponse { this.lineId = buf.readShort(); this.date = new DateTime(buf); this.depotCount = buf.readShort(); - this.entityList = EntityParse.collect(this.depotCount, buf, DepotPlanEntity.class); + this.entityList = EntityParseUtil.collect(this.depotCount, buf, DepotPlanEntity.class); } diff --git a/src/main/java/club/joylink/xiannccda/ats/message/rep/DeviceStatusBitmapResponse.java b/src/main/java/club/joylink/xiannccda/ats/message/rep/DeviceStatusBitmapResponse.java index f9e5100..18f2584 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/rep/DeviceStatusBitmapResponse.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/rep/DeviceStatusBitmapResponse.java @@ -1,10 +1,8 @@ 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.EntityParse.ReadData; -import com.google.common.collect.Lists; +import club.joylink.xiannccda.ats.message.rep.EntityParseUtil.ReadData; import io.netty.buffer.ByteBuf; import java.util.List; @@ -54,7 +52,7 @@ public class DeviceStatusBitmapResponse extends MessageResponse { this.lineId = buf.readShort(); this.rtuId = buf.readShort(); this.typeCnt = buf.readShort(); - this.entityList = EntityParse.collect(this.typeCnt, buf, DeviceTypeEntity.class); + this.entityList = EntityParseUtil.collect(this.typeCnt, buf, DeviceTypeEntity.class); } public static class DeviceTypeEntity implements ReadData { @@ -85,7 +83,7 @@ public class DeviceStatusBitmapResponse extends MessageResponse { entity.type = buf.readShort(); entity.objCount = buf.readShort(); - entity.deviceList = EntityParse.collect(entity.objCount, buf, DeviceEntity.class); + entity.deviceList = EntityParseUtil.collect(entity.objCount, buf, DeviceEntity.class); return entity; } @@ -95,10 +93,11 @@ public class DeviceStatusBitmapResponse extends MessageResponse { /** * 设备名称(24)(左对齐,其它空字符填\0) + *

+ * device_name: 设备名称。字符型,由于信号平面图上逻辑区段描述存在重复现象,西安3号线将按照本线路ATS系统内部基友的规则命名所有设备来保证输出信息的设备名称唯一性; + *

+ * 当type为DEVICE_TYPE_RTU时,该值为空;当type为DEVICE_TYPE_STATION时,该值预留 */ - /*device_name: 设备名称。字符型,由于信号平面图上逻辑区段描述存在重复现象,西安3号线将按照本线路ATS系统内部基友的规则命名所有设备来保证输出信息的设备名称唯一性; - 当type为DEVICE_TYPE_RTU时,该值为空;当type为DEVICE_TYPE_STATION时,该值预留*/ - private byte[] devName = new byte[24]; /** * 设备的状态(4),见附录3 diff --git a/src/main/java/club/joylink/xiannccda/ats/message/rep/DeviceStatusChangeResponse.java b/src/main/java/club/joylink/xiannccda/ats/message/rep/DeviceStatusChangeResponse.java index cfc4ad1..1562b90 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/rep/DeviceStatusChangeResponse.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/rep/DeviceStatusChangeResponse.java @@ -7,14 +7,14 @@ import io.netty.buffer.ByteBuf; /** * 2.7.5 设备状态变化消息 + *

+ * 实时表示信息的变化数据。 + *

+ * 发送条件: + *

+ * 当某个设备状态变化时,OCC发送该消息给NCC。集中站状态变化也作为设备状态变化发。 */ -/* -定义: - 实时表示信息的变化数据。 - 发送条件: - 当某个设备状态变化时,OCC发送该消息给NCC。集中站状态变化也作为设备状态变化发。 -*/ public class DeviceStatusChangeResponse extends MessageResponse { diff --git a/src/main/java/club/joylink/xiannccda/ats/message/rep/EntityParse.java b/src/main/java/club/joylink/xiannccda/ats/message/rep/EntityParseUtil.java similarity index 70% rename from src/main/java/club/joylink/xiannccda/ats/message/rep/EntityParse.java rename to src/main/java/club/joylink/xiannccda/ats/message/rep/EntityParseUtil.java index e5214cb..dba5ddf 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/rep/EntityParse.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/rep/EntityParseUtil.java @@ -1,15 +1,10 @@ package club.joylink.xiannccda.ats.message.rep; -import club.joylink.xiannccda.ats.message.rep.ActionReportResponse.ActionReportEntity; import com.google.common.collect.Lists; import io.netty.buffer.ByteBuf; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; import java.util.List; -import java.util.stream.IntStream; -public class EntityParse { +public class EntityParseUtil { public static List collect(int count, ByteBuf buf, Class tClass) { diff --git a/src/main/java/club/joylink/xiannccda/ats/message/rep/HistoryScheduleResponse.java b/src/main/java/club/joylink/xiannccda/ats/message/rep/HistoryScheduleResponse.java index b37443b..be3b62e 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/rep/HistoryScheduleResponse.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/rep/HistoryScheduleResponse.java @@ -2,19 +2,19 @@ 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.EntityParse.ReadData; -import com.google.common.collect.Lists; +import club.joylink.xiannccda.ats.message.rep.EntityParseUtil.ReadData; import io.netty.buffer.ByteBuf; import java.util.List; /** * 2.8.15 实际列车运行图消息 + *

+ * 发送条件: + *

+ * 当OCC收到NCC的历史运行图申请消息时,OCC根据消息类型发送历史实际运行信息给NCC; + *

+ * 当OCC收到NCC ATS信息请求消息时,发送当天实际列车运行信息给NCC。 */ -/* -发送条件: - 当OCC收到NCC的历史运行图申请消息时,OCC根据消息类型发送历史实际运行信息给NCC; - 当OCC收到NCC ATS信息请求消息时,发送当天实际列车运行信息给NCC。 -*/ public class HistoryScheduleResponse extends MessageResponse { @@ -61,7 +61,7 @@ public class HistoryScheduleResponse extends MessageResponse { if (this.subId == ScheduleSubIdType.RUNING.val) { buf.readBytes(this.groupId); this.recCnt = buf.readShort(); - this.entityList = EntityParse.collect(this.recCnt, buf, HistoryScheduleEntity.class); + this.entityList = EntityParseUtil.collect(this.recCnt, buf, HistoryScheduleEntity.class); } @@ -87,7 +87,11 @@ public class HistoryScheduleResponse extends MessageResponse { */ private DateTime dTime; /** - * 1表示下行,2表示上行,0表示未知 + * 1表示下行, + *

+ * 2表示上行, + *

+ * 0表示未知 */ private Short flag; /** @@ -103,7 +107,11 @@ public class HistoryScheduleResponse extends MessageResponse { */ private byte[] destinationId; /** - * 类型 1表示计划车,0表示非计划车。 + * 类型 + *

+ * 1表示计划车, + *

+ * 0表示非计划车。 */ private Short type; /** diff --git a/src/main/java/club/joylink/xiannccda/ats/message/rep/InusedScheduleResponse.java b/src/main/java/club/joylink/xiannccda/ats/message/rep/InusedScheduleResponse.java index 97a4108..0bf31ff 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/rep/InusedScheduleResponse.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/rep/InusedScheduleResponse.java @@ -2,20 +2,21 @@ 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.EntityParse.ReadData; -import com.google.common.collect.Lists; +import club.joylink.xiannccda.ats.message.rep.EntityParseUtil.ReadData; import io.netty.buffer.ByteBuf; import java.util.List; /** * 2.8.14 计划列车运行图消息 + *

+ * 发送条件: + *

+ * 当OCC端创建当天计划或当天计划进行了更新,OCC主动发送当天计划列车运行信息给NCC; + *

+ * 当OCC收到NCC的历史运行图申请消息时,OCC根据消息类型发送历史计划运行信息给NCC; + *

+ * 当OCC收到NCC ATS信息请求消息时,发送当天计划列车运行信息给NCC。 */ -/* -发送条件: - 当OCC端创建当天计划或当天计划进行了更新,OCC主动发送当天计划列车运行信息给NCC; - 当OCC收到NCC的历史运行图申请消息时,OCC根据消息类型发送历史计划运行信息给NCC; - 当OCC收到NCC ATS信息请求消息时,发送当天计划列车运行信息给NCC。 -*/ public class InusedScheduleResponse extends MessageResponse { @@ -57,7 +58,7 @@ public class InusedScheduleResponse extends MessageResponse { if (this.subId == ScheduleSubIdType.RUNING.val) { buf.readBytes(this.trainId); this.tripCnt = buf.readShort(); - this.entityList = EntityParse.collect(this.tripCnt, buf, InusedScheduleEntity.class); + this.entityList = EntityParseUtil.collect(this.tripCnt, buf, InusedScheduleEntity.class); } } @@ -90,7 +91,7 @@ public class InusedScheduleResponse extends MessageResponse { buf.readBytes(entity.groupId); buf.readBytes(entity.destinationId); entity.recCnt = buf.readShort(); - entity.recordList = EntityParse.collect(entity.recCnt, buf, EntityRecord.class); + entity.recordList = EntityParseUtil.collect(entity.recCnt, buf, EntityRecord.class); return entity; } } @@ -114,7 +115,13 @@ public class InusedScheduleResponse extends MessageResponse { */ private DateTime dTime; /** - * 第4位为1,表示出库,第5位为1表示入库,第6位为1表示下行,为0表示上行。(首位为第0位)(2) + * 第4位为1,表示出库, + *

+ * 第5位为1表示入库, + *

+ * 第6位为1表示下行, + *

+ * 为0表示上行。(首位为第0位)(2) */ private Short flag; diff --git a/src/main/java/club/joylink/xiannccda/ats/message/rep/NetworkAliveStatusResponse.java b/src/main/java/club/joylink/xiannccda/ats/message/rep/NetworkAliveStatusResponse.java index b81123e..bd865ba 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/rep/NetworkAliveStatusResponse.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/rep/NetworkAliveStatusResponse.java @@ -7,9 +7,12 @@ import io.netty.buffer.ByteBuf; /** * 2.7.2 信息源网络状态消息 + *

+ * 本消息用于OCC FEP向NCC FEP报告其当前与OCC服务器的网络状态变化情况。 + *

+ * 当网络状态变化时发送此消息。当NCC FEP与OCC FEP初始建立通信时,OCC FEP也发送此消息 */ -//本消息用于OCC FEP向NCC FEP报告其当前与OCC服务器的网络状态变化情况。 -// 当网络状态变化时发送此消息。当NCC FEP与OCC FEP初始建立通信时,OCC FEP也发送此消息 + public class NetworkAliveStatusResponse extends MessageResponse { /** @@ -18,7 +21,11 @@ public class NetworkAliveStatusResponse extends MessageResponse { private Short linId; /** - * 状态字节(1): 1:代表与当前线路号的信息源(server)连接正常; 0:代表断开。 + * 状态字节(1): + *

+ * 1:代表与当前线路号的信息源(server)连接正常; + *

+ * 0:代表断开。 */ private Byte status; diff --git a/src/main/java/club/joylink/xiannccda/ats/message/rep/ReportNackResponse.java b/src/main/java/club/joylink/xiannccda/ats/message/rep/ReportNackResponse.java index 83919cd..c0d935a 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/rep/ReportNackResponse.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/rep/ReportNackResponse.java @@ -6,12 +6,14 @@ import io.netty.buffer.ByteBuf; /** * 2.8.12 查询无结果消息 + *

+ * 应用场景 + *

+ * NCC FEP主动发起查询请求,因某种原因(如:查询无结果,数据量太大、与信息源中断等)导致OCC FEP无法正常返回查询结果时,可使用此消息进行答复。 + *

+ * 对统计信息查询消息(REPORT_ASK)、事件及告警信息请求消息(ALARM_ACK),在特殊情况下OCC FEP均可使用此消息进行答复。 */ -/* -2.8.12.1 应用场景 - NCC FEP主动发起查询请求,因某种原因(如:查询无结果,数据量太大、与信息源中断等)导致OCC FEP无法正常返回查询结果时,可使用此消息进行答复。 - 对统计信息查询消息(REPORT_ASK)、事件及告警信息请求消息(ALARM_ACK),在特殊情况下OCC FEP均可使用此消息进行答复。 -*/ + public class ReportNackResponse extends MessageResponse { diff --git a/src/main/java/club/joylink/xiannccda/ats/message/rep/SignalRouteStatusResponse.java b/src/main/java/club/joylink/xiannccda/ats/message/rep/SignalRouteStatusResponse.java index be9d0e4..9385355 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/rep/SignalRouteStatusResponse.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/rep/SignalRouteStatusResponse.java @@ -2,7 +2,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.EntityParse.ReadData; +import club.joylink.xiannccda.ats.message.rep.EntityParseUtil.ReadData; import io.netty.buffer.ByteBuf; import java.util.List; @@ -48,7 +48,7 @@ public class SignalRouteStatusResponse extends MessageResponse { this.lineId = buf.readShort(); this.rtuId = buf.readShort(); this.singalCount = buf.readShort(); - this.signals = EntityParse.collect(this.singalCount, buf, SignalStatusEntity.class); + this.signals = EntityParseUtil.collect(this.singalCount, buf, SignalStatusEntity.class); } @@ -72,7 +72,7 @@ public class SignalRouteStatusResponse extends MessageResponse { buf.readBytes(entity.signalName); entity.routeCount = buf.readByte(); - entity.routes = EntityParse.collect(entity.routeCount, buf, RouteStatusEntity.class); + entity.routes = EntityParseUtil.collect(entity.routeCount, buf, RouteStatusEntity.class); return entity; } } @@ -104,4 +104,13 @@ public class SignalRouteStatusResponse extends MessageResponse { return entity; } } + + public enum RouteStatusEnum { + ATS_AUTO_SIGNAL(0x55), NOT_ATS_SIGNAL(0xaa); + int val; + + RouteStatusEnum(int v) { + this.val = v; + } + } } diff --git a/src/main/java/club/joylink/xiannccda/ats/message/req/LoadDeviceStatusRequest.java b/src/main/java/club/joylink/xiannccda/ats/message/req/LoadDeviceStatusRequest.java index 971d672..339e7ef 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/req/LoadDeviceStatusRequest.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/req/LoadDeviceStatusRequest.java @@ -7,23 +7,36 @@ import io.netty.buffer.ByteBuf; /** * 2.7.3 ATS信息请求消息 + *

+ * 每次当NCC FEP需要更新ATS信息的时候,它需要向OCC FEP发送本消息。当OCC FEP收到本消息后,需要向NCC FEP同步全部的ATS信息,以正确初始化NCC,然后通过不断发送变化状态来同步。 + *

+ * 如果OCC FEP和OCC服务器断开后重连, NCC FEP并不重发本消息,需要由OCC FEP来管理重发,以维护连接的有效性。 + *

+ * 当OCC FEP收到NCC FEP的LOAD_DEVICE_STATUS后需要向NCC FEP发送的消息如下: + *

+ * (1)实时通道回复如下消息 + *

+ *  DEVICE_STATUS_BITMAP(设备状态全体消息); + *

+ *  SIGNAL_ROUTE_STATUS(自动/人工信号模式消息); + *

+ *  TRAIN_INDICATION_INIT(列车信息全体消息); + *

+ *  DEPOT_PLAN(当天出入库派班计划消息); + *

+ *  TRAIN_BLOCK_INFO(列车阻塞消息); + *

+ *  INUSED_SCHEDULE_PARAMETER(当天计划运行图参数消息)。 + *

+ * (2)非实时通道回复如下消息 + *

+ *  INUSED_SCHEDULE(当天计划运行图消息); + *

+ *  HISTORY_SCHEDULE(当天实际运行图消息)。 */ -//每次当NCC FEP需要更新ATS信息的时候,它需要向OCC FEP发送本消息。当OCC FEP收到本消息后,需要向NCC FEP同步全部的ATS信息,以正确初始化NCC,然后通过不断发送变化状态来同步。 -// 如果OCC FEP和OCC服务器断开后重连, NCC FEP并不重发本消息,需要由OCC FEP来管理重发,以维护连接的有效性。 -// 当OCC FEP收到NCC FEP的LOAD_DEVICE_STATUS后需要向NCC FEP发送的消息如下: -// (1)实时通道回复如下消息 -//  DEVICE_STATUS_BITMAP(设备状态全体消息); -//  SIGNAL_ROUTE_STATUS(自动/人工信号模式消息); -//  TRAIN_INDICATION_INIT(列车信息全体消息); -//  DEPOT_PLAN(当天出入库派班计划消息); -//  TRAIN_BLOCK_INFO(列车阻塞消息); -//  INUSED_SCHEDULE_PARAMETER(当天计划运行图参数消息)。 -// (2)非实时通道回复如下消息 -//  INUSED_SCHEDULE(当天计划运行图消息); -//  HISTORY_SCHEDULE(当天实际运行图消息)。 public class LoadDeviceStatusRequest extends MessageRequest { - + /** * 线路号(2) */ diff --git a/src/main/java/club/joylink/xiannccda/ats/message/req/LoadHistoryTGDataRequest.java b/src/main/java/club/joylink/xiannccda/ats/message/req/LoadHistoryTGDataRequest.java index ad4879a..ad0fcb1 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/req/LoadHistoryTGDataRequest.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/req/LoadHistoryTGDataRequest.java @@ -5,16 +5,15 @@ import club.joylink.xiannccda.ats.message.MessageRequest; import io.netty.buffer.ByteBuf; /** - * 2.8.13 历史运行图申请消息 + * 2.8.13 历史运行图申请消息 定义: + *

+ * 用于申请指定日期的历史计划和历史实际运行数据。 + *

+ * 发送条件: + *

+ * 当NCC与OCC通信长时间中断引起某些日期的历史数据(非当天)缺损时,NCC FEP人工发起此消息给OCC FEP,由OCC FEP根据消息类型和申请时间发送历史计划和历史运行数据给NCC。 */ -/* -2.8.13.1 应用场景 - 定义: - 用于申请指定日期的历史计划和历史实际运行数据。 - 发送条件: - 当NCC与OCC通信长时间中断引起某些日期的历史数据(非当天)缺损时,NCC FEP人工发起此消息给OCC FEP,由OCC FEP根据消息类型和申请时间发送历史计划和历史运行数据给NCC。 -*/ public class LoadHistoryTGDataRequest extends MessageRequest { @@ -32,16 +31,28 @@ public class LoadHistoryTGDataRequest extends MessageRequest { */ private DateTime date; /** - * 申请类型(1) 0x01:计划图 + * 申请类型(1) + *

+ * 0x01:计划图 *

* 0x02:实际图 */ private Byte tgType; + @Override public void encode2(ByteBuf buf) { buf.writeShort(this.lineId); buf.writeBytes(this.date.requestData()); buf.writeByte(this.tgType); } + + public enum ApplyTypeEnum { + PLAN_GRAPH(0x01), REAL_GRAPH(0x02); + int val; + + ApplyTypeEnum(int v) { + this.val = v; + } + } }