From 4fe577e87c9ff27c610589592c4b338f3eb13e3a Mon Sep 17 00:00:00 2001 From: weizhihong Date: Fri, 21 Jul 2023 09:21:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=BA=BF=E8=B7=AF=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E9=80=BB=E8=BE=91=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ats/cache/LineGraphicDataRepository.java | 15 + .../convertor/LineNetTrainComMethod.java | 126 ++- .../convertor/LineNetTrainInitConvertor.java | 5 +- .../LineNetTrainRecordConvertor.java | 52 - .../LineNetTrainUpdateConvertor.java | 4 +- .../xiannccda/dto/protos/DeviceInfoProto.java | 200 +++- .../dto/protos/LayoutGraphicsProto.java | 896 ++++++++++++++++-- .../service/LineDeviceStatusService.java | 43 +- xian-ncc-da-message | 2 +- 9 files changed, 1152 insertions(+), 191 deletions(-) delete mode 100644 src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainRecordConvertor.java diff --git a/src/main/java/club/joylink/xiannccda/ats/cache/LineGraphicDataRepository.java b/src/main/java/club/joylink/xiannccda/ats/cache/LineGraphicDataRepository.java index 77ed407..7248e0e 100644 --- a/src/main/java/club/joylink/xiannccda/ats/cache/LineGraphicDataRepository.java +++ b/src/main/java/club/joylink/xiannccda/ats/cache/LineGraphicDataRepository.java @@ -92,6 +92,20 @@ public class LineGraphicDataRepository { lineGraphMap.remove(id); } + /** + * 获取线路的区段集合 + * + * @param lineId 线路ID + * @return 区段集合 + */ + public static Map getLineSectionBuild(int lineId) { + Map> lineDataMap = lineGraphMap.get(lineId); + if (CollectionUtils.isNotEmpty(lineDataMap)) { + return lineDataMap.get(DeviceType.Section.name()); + } + return Map.of(); + } + /** * 构建程序中的区段信息 * @@ -117,6 +131,7 @@ public class LineGraphicDataRepository { ? (DeviceInfoProto.Section.Builder) cacheSectionMap.get(sid) : DeviceInfoProto.Section.newBuilder().setId(sid); sectionBuilder.setCode(section.getCode()); + sectionBuilder.setDestinationCode(section.getDestinationCode()); if (section.getChildrenCount() > 0) { sectionBuilder.addAllChildrenId(section.getChildrenList()); // 初始化逻辑区段信息,建立逻辑区段与物理区段之间的关系 diff --git a/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainComMethod.java b/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainComMethod.java index 13368e3..22ee9f7 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainComMethod.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainComMethod.java @@ -6,11 +6,15 @@ import club.joylink.xiannccda.ats.message.collect.DeviceStatusDataRepository; import club.joylink.xiannccda.ats.message.collect.datasource.DeviceStatusData; import club.joylink.xiannccda.ats.message.line3.changer.DeviceNameChangerManage; import club.joylink.xiannccda.ats.message.line3.device.DeviceType; +import club.joylink.xiannccda.dto.protos.DeviceInfoProto; import club.joylink.xiannccda.dto.protos.WsMessageProto; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.google.protobuf.GeneratedMessageV3.Builder; import java.util.List; import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import lombok.Getter; import lombok.extern.slf4j.Slf4j; /** 线网的列车数据,一些公共方法 */ @@ -51,27 +55,121 @@ public abstract class LineNetTrainComMethod { */ public static void setUpKilometerCode( WsMessageProto.WsLineNetTrainOffsetMessage.Builder obj, DeviceType type, String deviceName) { + // 获取到当前区段公里标 + List kmList = getDeviceKilometerCode(obj.getLineId(), type, deviceName); + if (CollectionUtils.isNotEmpty(kmList)) { + obj.setKilometerCode(selectDeviceKilometerCode(obj.getDir(), kmList)); + } else { + log.warn(String.format("设备%s没有公里标信息", deviceName)); + } + } + + /** + * 根据目的码确定方向,并确定公里标 + * + * @param obj 要设置的对象 + * @param destinationCode 目的码 + * @param type 设备类型 + * @param deviceName 设备名称 + */ + public static void setTrainDirectionAndKilometerCode( + WsMessageProto.WsLineNetTrainOffsetMessage.Builder obj, + String destinationCode, + DeviceType type, + String deviceName) { + List deviceKmList = getDeviceKilometerCode(obj.getLineId(), type, deviceName); + if (CollectionUtils.isEmpty(deviceKmList)) { + return; + } + List destinationKmList = getDirectionCodeKilometerCode(obj.getLineId(), destinationCode); + if (CollectionUtils.isEmpty(destinationKmList)) { + return; + } + // 确定方向 + long deviceMax = deviceKmList.stream().max(Long::compareTo).get(); + long destinationMax = destinationKmList.stream().max(Long::compareTo).get(); + if (destinationMax > deviceMax) { // 目的地最大公里标大于设备最大公里标,上行 + obj.setDir(TrainRunDirection.UP.getNum()); + } else { + obj.setDir(TrainRunDirection.DOWN.getNum()); + } + // 赋值公里标 + obj.setKilometerCode(selectDeviceKilometerCode(obj.getDir(), deviceKmList)); + } + + /** + * 获取设备的公里标 + * + * @param lineId 线路ID + * @param type 设备类型 + * @param deviceName 设备名称 + * @return 公里标列表 + */ + private static List getDeviceKilometerCode(int lineId, DeviceType type, String deviceName) { // 非区段、道岔直接返回 if (!DeviceType.DEVICE_TYPE_TRACK.equals(type) && !DeviceType.DEVICE_TYPE_SWITCH.equals(type)) { - return; + return List.of(); } // 转换成程序中的名称 String convertName = DeviceNameChangerManage.findMatch(type, deviceName); // 获取到当前区段公里标 - List kmList = - LineGraphicDataRepository.getKilometerCodeList(obj.getLineId(), convertName); - if (CollectionUtils.isNotEmpty(kmList)) { - long kilometer; - if (obj.getDir() == 1) { // 下行取大值 - kilometer = kmList.stream().min(Long::compareTo).get(); - } else if (obj.getDir() == 2) { // 上行取小值 - kilometer = kmList.stream().max(Long::compareTo).get(); - } else { // 无方向获取第一个 - kilometer = kmList.get(0); - } - obj.setKilometerCode(kilometer); + return LineGraphicDataRepository.getKilometerCodeList(lineId, convertName); + } + + /** + * 获取目的地码的公里标信息 + * + * @param lineId 线路ID + * @param code 目的地码 + * @return 公里标列表 + */ + private static List getDirectionCodeKilometerCode(int lineId, String code) { + Map map = LineGraphicDataRepository.getLineSectionBuild(lineId); + Optional destination = + map.values().stream() + .filter( + s -> { + DeviceInfoProto.Section.Builder b = (DeviceInfoProto.Section.Builder) s; + return Objects.equals(b.getDestinationCode(), code); + }) + .findFirst(); + if (destination.isPresent()) { + DeviceInfoProto.Section.Builder b = (DeviceInfoProto.Section.Builder) destination.get(); + return b.getConvertKilometerList(); } else { - log.warn(String.format("设备%s没有公里标信息", convertName)); + return List.of(); + } + } + + /** + * 选择对应的公里标信息 + * + * @param dir 运行方向 + * @param kmList 公里标列表 + * @return 公里标 + */ + private static long selectDeviceKilometerCode(int dir, List kmList) { + long kilometer; + if (dir == 1) { // 下行取大值 + kilometer = kmList.stream().min(Long::compareTo).get(); + } else if (dir == 2) { // 上行取小值 + kilometer = kmList.stream().max(Long::compareTo).get(); + } else { // 无方向获取第一个 + kilometer = kmList.get(0); + } + return kilometer; + } + + @Getter + public static enum TrainRunDirection { + UP(2), + DOWN(1), + NO(0); + + private int num; + + TrainRunDirection(int num) { + this.num = num; } } } diff --git a/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainInitConvertor.java b/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainInitConvertor.java index d40a405..5fad374 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainInitConvertor.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainInitConvertor.java @@ -35,9 +35,8 @@ public class LineNetTrainInitConvertor extends DeviceStatusConvertor { offset.setLineId(response.getLineId()); // 线路id offset.setTrainIndex(trainCell.getTrainIndex()); // 列车标示号,全线唯一 offset.setGroupId(trainCell.getGroupId()); // 车组号 - offset.setDir(0); // 初始设置无运行方向 - LineNetTrainComMethod.setUpKilometerCode( - offset, trainCell.getDevType(), trainCell.getDevName()); + LineNetTrainComMethod.setTrainDirectionAndKilometerCode( + offset, trainCell.getDestinationId(), trainCell.getDevType(), trainCell.getDevName()); offset.setShow(offset.getKilometerCode() != 0); buildList.add(offset); } diff --git a/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainRecordConvertor.java b/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainRecordConvertor.java deleted file mode 100644 index 66b683c..0000000 --- a/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainRecordConvertor.java +++ /dev/null @@ -1,52 +0,0 @@ -package club.joylink.xiannccda.ats.message.collect.convertor; - -import club.joylink.xiannccda.ats.message.MessageData; -import club.joylink.xiannccda.ats.message.MessageId; -import club.joylink.xiannccda.ats.message.collect.DeviceStatusConvertor; - -import club.joylink.xiannccda.ats.message.collect.DeviceStatusDataOperate; -import club.joylink.xiannccda.ats.message.line3.device.DeviceType; -import club.joylink.xiannccda.ats.message.line3.rep.TrainRecordResponse; -import club.joylink.xiannccda.dto.protos.WsMessageProto; -import com.google.common.collect.Lists; -import com.google.protobuf.GeneratedMessageV3.Builder; -import java.util.List; -import java.util.Objects; -import lombok.extern.slf4j.Slf4j; - -@Slf4j -public class LineNetTrainRecordConvertor extends DeviceStatusConvertor { - - @Override - public MessageId getMessageId() { - return MessageId.TRAIN_RECORD; - } - - @Override - public void run(List messageDataList) { - try { - List buildList = Lists.newArrayList(); - // 已存在的设备信息 - for (MessageData data : messageDataList) { - if (Objects.equals(getMessageId(), data.getMsgId())) { // 消息类型一致 - TrainRecordResponse response = (TrainRecordResponse) data; - WsMessageProto.WsLineNetTrainOffsetMessage.Builder offset = - WsMessageProto.WsLineNetTrainOffsetMessage.newBuilder(); - offset.setLineId(response.getLineId()); // 线路id - offset.setGroupId(response.getGroupId()); // 车组号 - LineNetTrainComMethod.getDeviceStatusById(offset); // 合并老旧数据 - offset.setDir(response.getDirection().getValue()); // 初始设置无运行方向 - // 设置公里标信息 - LineNetTrainComMethod.setUpKilometerCode( - offset, DeviceType.DEVICE_TYPE_TRACK, response.getTrackName()); - offset.setShow(offset.getKilometerCode() != 0); - buildList.add(offset); - } - } - // 增加设备信息 - DeviceStatusDataOperate.addDevices(buildList, LineNetTrainComMethod.getDeviceStatusData()); - } catch (Exception e) { - log.error("信息生成出错", e); - } - } -} diff --git a/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainUpdateConvertor.java b/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainUpdateConvertor.java index b8f03ef..1a58744 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainUpdateConvertor.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainUpdateConvertor.java @@ -35,8 +35,8 @@ public class LineNetTrainUpdateConvertor extends DeviceStatusConvertor { offset.setTrainIndex(response.getTrainIndex()); // 列车标示号,全线唯一 offset.setGroupId(response.getGroupId()); // 车组号 LineNetTrainComMethod.getDeviceStatusById(offset); // 合并老旧数据 - LineNetTrainComMethod.setUpKilometerCode( - offset, response.getDevType(), response.getDevName()); + LineNetTrainComMethod.setTrainDirectionAndKilometerCode( + offset, response.getDestinationId(), response.getDevType(), response.getDevName()); offset.setShow(offset.getKilometerCode() != 0); buildList.add(offset); } diff --git a/src/main/java/club/joylink/xiannccda/dto/protos/DeviceInfoProto.java b/src/main/java/club/joylink/xiannccda/dto/protos/DeviceInfoProto.java index 564bb04..8c9b6b9 100644 --- a/src/main/java/club/joylink/xiannccda/dto/protos/DeviceInfoProto.java +++ b/src/main/java/club/joylink/xiannccda/dto/protos/DeviceInfoProto.java @@ -183,6 +183,26 @@ public final class DeviceInfoProto { */ com.google.protobuf.ByteString getPhysicalSectionIdBytes(); + + /** + *
+     * 目的地码
+     * 
+ * + * string destinationCode = 7; + * @return The destinationCode. + */ + java.lang.String getDestinationCode(); + /** + *
+     * 目的地码
+     * 
+ * + * string destinationCode = 7; + * @return The bytes for destinationCode. + */ + com.google.protobuf.ByteString + getDestinationCodeBytes(); } /** *
@@ -208,6 +228,7 @@ public final class DeviceInfoProto {
       kilometerSystem_ = java.util.Collections.emptyList();
       convertKilometer_ = emptyLongList();
       physicalSectionId_ = "";
+      destinationCode_ = "";
     }
 
     @java.lang.Override
@@ -518,6 +539,53 @@ public final class DeviceInfoProto {
       }
     }
 
+    public static final int DESTINATIONCODE_FIELD_NUMBER = 7;
+    @SuppressWarnings("serial")
+    private volatile java.lang.Object destinationCode_ = "";
+    /**
+     * 
+     * 目的地码
+     * 
+ * + * string destinationCode = 7; + * @return The destinationCode. + */ + @java.lang.Override + public java.lang.String getDestinationCode() { + java.lang.Object ref = destinationCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationCode_ = s; + return s; + } + } + /** + *
+     * 目的地码
+     * 
+ * + * string destinationCode = 7; + * @return The bytes for destinationCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDestinationCodeBytes() { + java.lang.Object ref = destinationCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + destinationCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -555,6 +623,9 @@ public final class DeviceInfoProto { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(physicalSectionId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, physicalSectionId_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destinationCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, destinationCode_); + } getUnknownFields().writeTo(output); } @@ -599,6 +670,9 @@ public final class DeviceInfoProto { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(physicalSectionId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, physicalSectionId_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destinationCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, destinationCode_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -626,6 +700,8 @@ public final class DeviceInfoProto { .equals(other.getConvertKilometerList())) return false; if (!getPhysicalSectionId() .equals(other.getPhysicalSectionId())) return false; + if (!getDestinationCode() + .equals(other.getDestinationCode())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -655,6 +731,8 @@ public final class DeviceInfoProto { } hash = (37 * hash) + PHYSICALSECTIONID_FIELD_NUMBER; hash = (53 * hash) + getPhysicalSectionId().hashCode(); + hash = (37 * hash) + DESTINATIONCODE_FIELD_NUMBER; + hash = (53 * hash) + getDestinationCode().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -803,6 +881,7 @@ public final class DeviceInfoProto { bitField0_ = (bitField0_ & ~0x00000008); convertKilometer_ = emptyLongList(); physicalSectionId_ = ""; + destinationCode_ = ""; return this; } @@ -867,6 +946,9 @@ public final class DeviceInfoProto { if (((from_bitField0_ & 0x00000020) != 0)) { result.physicalSectionId_ = physicalSectionId_; } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.destinationCode_ = destinationCode_; + } } @java.lang.Override @@ -942,6 +1024,11 @@ public final class DeviceInfoProto { bitField0_ |= 0x00000020; onChanged(); } + if (!other.getDestinationCode().isEmpty()) { + destinationCode_ = other.destinationCode_; + bitField0_ |= 0x00000040; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1018,6 +1105,11 @@ public final class DeviceInfoProto { bitField0_ |= 0x00000020; break; } // case 50 + case 58: { + destinationCode_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -1858,6 +1950,98 @@ public final class DeviceInfoProto { onChanged(); return this; } + + private java.lang.Object destinationCode_ = ""; + /** + *
+       * 目的地码
+       * 
+ * + * string destinationCode = 7; + * @return The destinationCode. + */ + public java.lang.String getDestinationCode() { + java.lang.Object ref = destinationCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * 目的地码
+       * 
+ * + * string destinationCode = 7; + * @return The bytes for destinationCode. + */ + public com.google.protobuf.ByteString + getDestinationCodeBytes() { + java.lang.Object ref = destinationCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + destinationCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * 目的地码
+       * 
+ * + * string destinationCode = 7; + * @param value The destinationCode to set. + * @return This builder for chaining. + */ + public Builder setDestinationCode( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + destinationCode_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
+       * 目的地码
+       * 
+ * + * string destinationCode = 7; + * @return This builder for chaining. + */ + public Builder clearDestinationCode() { + destinationCode_ = getDefaultInstance().getDestinationCode(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + *
+       * 目的地码
+       * 
+ * + * string destinationCode = 7; + * @param value The bytes for destinationCode to set. + * @return This builder for chaining. + */ + public Builder setDestinationCodeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + destinationCode_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -3348,16 +3532,16 @@ public final class DeviceInfoProto { static { java.lang.String[] descriptorData = { "\n\021device_info.proto\022\005state\032\033stationLayou" + - "tGraphics.proto\"\243\001\n\007Section\022\n\n\002id\030\001 \001(\t\022" + + "tGraphics.proto\"\274\001\n\007Section\022\n\n\002id\030\001 \001(\t\022" + "\014\n\004code\030\002 \001(\t\022\022\n\nchildrenId\030\003 \003(\t\0225\n\017kil" + "ometerSystem\030\004 \003(\0132\034.graphicData.Kilomet" + "erSystem\022\030\n\020convertKilometer\030\005 \003(\003\022\031\n\021ph" + - "ysicalSectionId\030\006 \001(\t\"t\n\007Turnout\022\n\n\002id\030\001" + - " \001(\t\022\014\n\004code\030\002 \001(\t\0225\n\017kilometerSystem\030\003 " + - "\003(\0132\034.graphicData.KilometerSystem\022\030\n\020con" + - "vertKilometer\030\004 \003(\003B4\n!club.joylink.xian" + - "nccda.dto.protosB\017DeviceInfoProtob\006proto" + - "3" + "ysicalSectionId\030\006 \001(\t\022\027\n\017destinationCode" + + "\030\007 \001(\t\"t\n\007Turnout\022\n\n\002id\030\001 \001(\t\022\014\n\004code\030\002 " + + "\001(\t\0225\n\017kilometerSystem\030\003 \003(\0132\034.graphicDa" + + "ta.KilometerSystem\022\030\n\020convertKilometer\030\004" + + " \003(\003B4\n!club.joylink.xiannccda.dto.proto" + + "sB\017DeviceInfoProtob\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -3369,7 +3553,7 @@ public final class DeviceInfoProto { internal_static_state_Section_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_state_Section_descriptor, - new java.lang.String[] { "Id", "Code", "ChildrenId", "KilometerSystem", "ConvertKilometer", "PhysicalSectionId", }); + new java.lang.String[] { "Id", "Code", "ChildrenId", "KilometerSystem", "ConvertKilometer", "PhysicalSectionId", "DestinationCode", }); internal_static_state_Turnout_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_state_Turnout_fieldAccessorTable = new diff --git a/src/main/java/club/joylink/xiannccda/dto/protos/LayoutGraphicsProto.java b/src/main/java/club/joylink/xiannccda/dto/protos/LayoutGraphicsProto.java index de9e470..68367d3 100644 --- a/src/main/java/club/joylink/xiannccda/dto/protos/LayoutGraphicsProto.java +++ b/src/main/java/club/joylink/xiannccda/dto/protos/LayoutGraphicsProto.java @@ -16923,6 +16923,46 @@ public final class LayoutGraphicsProto { */ com.google.protobuf.ByteString getDirectionBytes(); + + /** + *
+     *上下行--upLink表示上行,downLink表示下行
+     * 
+ * + * string upAndDown = 5; + * @return The upAndDown. + */ + java.lang.String getUpAndDown(); + /** + *
+     *上下行--upLink表示上行,downLink表示下行
+     * 
+ * + * string upAndDown = 5; + * @return The bytes for upAndDown. + */ + com.google.protobuf.ByteString + getUpAndDownBytes(); + + /** + *
+     *关联的车站
+     * 
+ * + * string refStation = 6; + * @return The refStation. + */ + java.lang.String getRefStation(); + /** + *
+     *关联的车站
+     * 
+ * + * string refStation = 6; + * @return The bytes for refStation. + */ + com.google.protobuf.ByteString + getRefStationBytes(); } /** * Protobuf type {@code graphicData.Platform} @@ -16939,6 +16979,8 @@ public final class LayoutGraphicsProto { private Platform() { code_ = ""; direction_ = ""; + upAndDown_ = ""; + refStation_ = ""; } @java.lang.Override @@ -17088,6 +17130,100 @@ public final class LayoutGraphicsProto { } } + public static final int UPANDDOWN_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object upAndDown_ = ""; + /** + *
+     *上下行--upLink表示上行,downLink表示下行
+     * 
+ * + * string upAndDown = 5; + * @return The upAndDown. + */ + @java.lang.Override + public java.lang.String getUpAndDown() { + java.lang.Object ref = upAndDown_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + upAndDown_ = s; + return s; + } + } + /** + *
+     *上下行--upLink表示上行,downLink表示下行
+     * 
+ * + * string upAndDown = 5; + * @return The bytes for upAndDown. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUpAndDownBytes() { + java.lang.Object ref = upAndDown_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + upAndDown_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REFSTATION_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object refStation_ = ""; + /** + *
+     *关联的车站
+     * 
+ * + * string refStation = 6; + * @return The refStation. + */ + @java.lang.Override + public java.lang.String getRefStation() { + java.lang.Object ref = refStation_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + refStation_ = s; + return s; + } + } + /** + *
+     *关联的车站
+     * 
+ * + * string refStation = 6; + * @return The bytes for refStation. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRefStationBytes() { + java.lang.Object ref = refStation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + refStation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -17114,6 +17250,12 @@ public final class LayoutGraphicsProto { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(direction_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, direction_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(upAndDown_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, upAndDown_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(refStation_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, refStation_); + } getUnknownFields().writeTo(output); } @@ -17137,6 +17279,12 @@ public final class LayoutGraphicsProto { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(direction_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, direction_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(upAndDown_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, upAndDown_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(refStation_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, refStation_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -17163,6 +17311,10 @@ public final class LayoutGraphicsProto { != other.getHasdoor()) return false; if (!getDirection() .equals(other.getDirection())) return false; + if (!getUpAndDown() + .equals(other.getUpAndDown())) return false; + if (!getRefStation() + .equals(other.getRefStation())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -17185,6 +17337,10 @@ public final class LayoutGraphicsProto { getHasdoor()); hash = (37 * hash) + DIRECTION_FIELD_NUMBER; hash = (53 * hash) + getDirection().hashCode(); + hash = (37 * hash) + UPANDDOWN_FIELD_NUMBER; + hash = (53 * hash) + getUpAndDown().hashCode(); + hash = (37 * hash) + REFSTATION_FIELD_NUMBER; + hash = (53 * hash) + getRefStation().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -17324,6 +17480,8 @@ public final class LayoutGraphicsProto { code_ = ""; hasdoor_ = false; direction_ = ""; + upAndDown_ = ""; + refStation_ = ""; return this; } @@ -17371,6 +17529,12 @@ public final class LayoutGraphicsProto { if (((from_bitField0_ & 0x00000008) != 0)) { result.direction_ = direction_; } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.upAndDown_ = upAndDown_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.refStation_ = refStation_; + } } @java.lang.Override @@ -17401,6 +17565,16 @@ public final class LayoutGraphicsProto { bitField0_ |= 0x00000008; onChanged(); } + if (!other.getUpAndDown().isEmpty()) { + upAndDown_ = other.upAndDown_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getRefStation().isEmpty()) { + refStation_ = other.refStation_; + bitField0_ |= 0x00000020; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -17449,6 +17623,16 @@ public final class LayoutGraphicsProto { bitField0_ |= 0x00000008; break; } // case 34 + case 42: { + upAndDown_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: { + refStation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -17792,6 +17976,190 @@ public final class LayoutGraphicsProto { onChanged(); return this; } + + private java.lang.Object upAndDown_ = ""; + /** + *
+       *上下行--upLink表示上行,downLink表示下行
+       * 
+ * + * string upAndDown = 5; + * @return The upAndDown. + */ + public java.lang.String getUpAndDown() { + java.lang.Object ref = upAndDown_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + upAndDown_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       *上下行--upLink表示上行,downLink表示下行
+       * 
+ * + * string upAndDown = 5; + * @return The bytes for upAndDown. + */ + public com.google.protobuf.ByteString + getUpAndDownBytes() { + java.lang.Object ref = upAndDown_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + upAndDown_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       *上下行--upLink表示上行,downLink表示下行
+       * 
+ * + * string upAndDown = 5; + * @param value The upAndDown to set. + * @return This builder for chaining. + */ + public Builder setUpAndDown( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + upAndDown_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
+       *上下行--upLink表示上行,downLink表示下行
+       * 
+ * + * string upAndDown = 5; + * @return This builder for chaining. + */ + public Builder clearUpAndDown() { + upAndDown_ = getDefaultInstance().getUpAndDown(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + *
+       *上下行--upLink表示上行,downLink表示下行
+       * 
+ * + * string upAndDown = 5; + * @param value The bytes for upAndDown to set. + * @return This builder for chaining. + */ + public Builder setUpAndDownBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + upAndDown_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object refStation_ = ""; + /** + *
+       *关联的车站
+       * 
+ * + * string refStation = 6; + * @return The refStation. + */ + public java.lang.String getRefStation() { + java.lang.Object ref = refStation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + refStation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       *关联的车站
+       * 
+ * + * string refStation = 6; + * @return The bytes for refStation. + */ + public com.google.protobuf.ByteString + getRefStationBytes() { + java.lang.Object ref = refStation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + refStation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       *关联的车站
+       * 
+ * + * string refStation = 6; + * @param value The refStation to set. + * @return This builder for chaining. + */ + public Builder setRefStation( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + refStation_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
+       *关联的车站
+       * 
+ * + * string refStation = 6; + * @return This builder for chaining. + */ + public Builder clearRefStation() { + refStation_ = getDefaultInstance().getRefStation(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + *
+       *关联的车站
+       * 
+ * + * string refStation = 6; + * @param value The bytes for refStation to set. + * @return This builder for chaining. + */ + public Builder setRefStationBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + refStation_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -17933,6 +18301,18 @@ public final class LayoutGraphicsProto { * .graphicData.KilometerSystem kilometerSystem = 6; */ club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystemOrBuilder getKilometerSystemOrBuilder(); + + /** + * string name = 7; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 7; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); } /** * Protobuf type {@code graphicData.Station} @@ -17948,6 +18328,7 @@ public final class LayoutGraphicsProto { } private Station() { code_ = ""; + name_ = ""; } @java.lang.Override @@ -18103,6 +18484,45 @@ public final class LayoutGraphicsProto { return kilometerSystem_ == null ? club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.getDefaultInstance() : kilometerSystem_; } + public static final int NAME_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * string name = 7; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * string name = 7; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -18132,6 +18552,9 @@ public final class LayoutGraphicsProto { if (kilometerSystem_ != null) { output.writeMessage(6, getKilometerSystem()); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, name_); + } getUnknownFields().writeTo(output); } @@ -18160,6 +18583,9 @@ public final class LayoutGraphicsProto { size += com.google.protobuf.CodedOutputStream .computeMessageSize(6, getKilometerSystem()); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, name_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -18191,6 +18617,8 @@ public final class LayoutGraphicsProto { if (!getKilometerSystem() .equals(other.getKilometerSystem())) return false; } + if (!getName() + .equals(other.getName())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -18218,6 +18646,8 @@ public final class LayoutGraphicsProto { hash = (37 * hash) + KILOMETERSYSTEM_FIELD_NUMBER; hash = (53 * hash) + getKilometerSystem().hashCode(); } + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -18362,6 +18792,7 @@ public final class LayoutGraphicsProto { kilometerSystemBuilder_.dispose(); kilometerSystemBuilder_ = null; } + name_ = ""; return this; } @@ -18414,6 +18845,9 @@ public final class LayoutGraphicsProto { ? kilometerSystem_ : kilometerSystemBuilder_.build(); } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.name_ = name_; + } } @java.lang.Override @@ -18445,6 +18879,11 @@ public final class LayoutGraphicsProto { if (other.hasKilometerSystem()) { mergeKilometerSystem(other.getKilometerSystem()); } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000020; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -18500,6 +18939,11 @@ public final class LayoutGraphicsProto { bitField0_ |= 0x00000010; break; } // case 50 + case 58: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 58 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -18950,6 +19394,78 @@ public final class LayoutGraphicsProto { } return kilometerSystemBuilder_; } + + private java.lang.Object name_ = ""; + /** + * string name = 7; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string name = 7; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string name = 7; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * string name = 7; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * string name = 7; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -29749,6 +30265,35 @@ public final class LayoutGraphicsProto { */ com.google.protobuf.ByteString getLineIdBytes(); + + /** + *
+     * 虚线段点序号
+     * 
+ * + * repeated int32 dashPointIndexs = 11; + * @return A list containing the dashPointIndexs. + */ + java.util.List getDashPointIndexsList(); + /** + *
+     * 虚线段点序号
+     * 
+ * + * repeated int32 dashPointIndexs = 11; + * @return The count of dashPointIndexs. + */ + int getDashPointIndexsCount(); + /** + *
+     * 虚线段点序号
+     * 
+ * + * repeated int32 dashPointIndexs = 11; + * @param index The index of the element to return. + * @return The dashPointIndexs at the given index. + */ + int getDashPointIndexs(int index); } /** * Protobuf type {@code graphicData.RunLine} @@ -29772,6 +30317,7 @@ public final class LayoutGraphicsProto { linkPathLines_ = com.google.protobuf.LazyStringArrayList.emptyList(); lineId_ = ""; + dashPointIndexs_ = emptyIntList(); } @java.lang.Override @@ -30111,6 +30657,47 @@ public final class LayoutGraphicsProto { } } + public static final int DASHPOINTINDEXS_FIELD_NUMBER = 11; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList dashPointIndexs_; + /** + *
+     * 虚线段点序号
+     * 
+ * + * repeated int32 dashPointIndexs = 11; + * @return A list containing the dashPointIndexs. + */ + @java.lang.Override + public java.util.List + getDashPointIndexsList() { + return dashPointIndexs_; + } + /** + *
+     * 虚线段点序号
+     * 
+ * + * repeated int32 dashPointIndexs = 11; + * @return The count of dashPointIndexs. + */ + public int getDashPointIndexsCount() { + return dashPointIndexs_.size(); + } + /** + *
+     * 虚线段点序号
+     * 
+ * + * repeated int32 dashPointIndexs = 11; + * @param index The index of the element to return. + * @return The dashPointIndexs at the given index. + */ + public int getDashPointIndexs(int index) { + return dashPointIndexs_.getInt(index); + } + private int dashPointIndexsMemoizedSerializedSize = -1; + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -30125,6 +30712,7 @@ public final class LayoutGraphicsProto { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); if (common_ != null) { output.writeMessage(1, getCommon()); } @@ -30149,6 +30737,13 @@ public final class LayoutGraphicsProto { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lineId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 10, lineId_); } + if (getDashPointIndexsList().size() > 0) { + output.writeUInt32NoTag(90); + output.writeUInt32NoTag(dashPointIndexsMemoizedSerializedSize); + } + for (int i = 0; i < dashPointIndexs_.size(); i++) { + output.writeInt32NoTag(dashPointIndexs_.getInt(i)); + } getUnknownFields().writeTo(output); } @@ -30194,6 +30789,20 @@ public final class LayoutGraphicsProto { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lineId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, lineId_); } + { + int dataSize = 0; + for (int i = 0; i < dashPointIndexs_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dashPointIndexs_.getInt(i)); + } + size += dataSize; + if (!getDashPointIndexsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + dashPointIndexsMemoizedSerializedSize = dataSize; + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -30228,6 +30837,8 @@ public final class LayoutGraphicsProto { .equals(other.getLinkPathLinesList())) return false; if (!getLineId() .equals(other.getLineId())) return false; + if (!getDashPointIndexsList() + .equals(other.getDashPointIndexsList())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -30263,6 +30874,10 @@ public final class LayoutGraphicsProto { } hash = (37 * hash) + LINEID_FIELD_NUMBER; hash = (53 * hash) + getLineId().hashCode(); + if (getDashPointIndexsCount() > 0) { + hash = (37 * hash) + DASHPOINTINDEXS_FIELD_NUMBER; + hash = (53 * hash) + getDashPointIndexsList().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -30414,6 +31029,7 @@ public final class LayoutGraphicsProto { linkPathLines_ = com.google.protobuf.LazyStringArrayList.emptyList(); lineId_ = ""; + dashPointIndexs_ = emptyIntList(); return this; } @@ -30456,6 +31072,11 @@ public final class LayoutGraphicsProto { } else { result.points_ = pointsBuilder_.build(); } + if (((bitField0_ & 0x00000100) != 0)) { + dashPointIndexs_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.dashPointIndexs_ = dashPointIndexs_; } private void buildPartial0(club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.RunLine result) { @@ -30568,6 +31189,16 @@ public final class LayoutGraphicsProto { bitField0_ |= 0x00000080; onChanged(); } + if (!other.dashPointIndexs_.isEmpty()) { + if (dashPointIndexs_.isEmpty()) { + dashPointIndexs_ = other.dashPointIndexs_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureDashPointIndexsIsMutable(); + dashPointIndexs_.addAll(other.dashPointIndexs_); + } + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -30646,6 +31277,22 @@ public final class LayoutGraphicsProto { bitField0_ |= 0x00000080; break; } // case 82 + case 88: { + int v = input.readInt32(); + ensureDashPointIndexsIsMutable(); + dashPointIndexs_.addInt(v); + break; + } // case 88 + case 90: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureDashPointIndexsIsMutable(); + while (input.getBytesUntilLimit() > 0) { + dashPointIndexs_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 90 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -31576,6 +32223,115 @@ public final class LayoutGraphicsProto { onChanged(); return this; } + + private com.google.protobuf.Internal.IntList dashPointIndexs_ = emptyIntList(); + private void ensureDashPointIndexsIsMutable() { + if (!((bitField0_ & 0x00000100) != 0)) { + dashPointIndexs_ = mutableCopy(dashPointIndexs_); + bitField0_ |= 0x00000100; + } + } + /** + *
+       * 虚线段点序号
+       * 
+ * + * repeated int32 dashPointIndexs = 11; + * @return A list containing the dashPointIndexs. + */ + public java.util.List + getDashPointIndexsList() { + return ((bitField0_ & 0x00000100) != 0) ? + java.util.Collections.unmodifiableList(dashPointIndexs_) : dashPointIndexs_; + } + /** + *
+       * 虚线段点序号
+       * 
+ * + * repeated int32 dashPointIndexs = 11; + * @return The count of dashPointIndexs. + */ + public int getDashPointIndexsCount() { + return dashPointIndexs_.size(); + } + /** + *
+       * 虚线段点序号
+       * 
+ * + * repeated int32 dashPointIndexs = 11; + * @param index The index of the element to return. + * @return The dashPointIndexs at the given index. + */ + public int getDashPointIndexs(int index) { + return dashPointIndexs_.getInt(index); + } + /** + *
+       * 虚线段点序号
+       * 
+ * + * repeated int32 dashPointIndexs = 11; + * @param index The index to set the value at. + * @param value The dashPointIndexs to set. + * @return This builder for chaining. + */ + public Builder setDashPointIndexs( + int index, int value) { + + ensureDashPointIndexsIsMutable(); + dashPointIndexs_.setInt(index, value); + onChanged(); + return this; + } + /** + *
+       * 虚线段点序号
+       * 
+ * + * repeated int32 dashPointIndexs = 11; + * @param value The dashPointIndexs to add. + * @return This builder for chaining. + */ + public Builder addDashPointIndexs(int value) { + + ensureDashPointIndexsIsMutable(); + dashPointIndexs_.addInt(value); + onChanged(); + return this; + } + /** + *
+       * 虚线段点序号
+       * 
+ * + * repeated int32 dashPointIndexs = 11; + * @param values The dashPointIndexs to add. + * @return This builder for chaining. + */ + public Builder addAllDashPointIndexs( + java.lang.Iterable values) { + ensureDashPointIndexsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, dashPointIndexs_); + onChanged(); + return this; + } + /** + *
+       * 虚线段点序号
+       * 
+ * + * repeated int32 dashPointIndexs = 11; + * @return This builder for chaining. + */ + public Builder clearDashPointIndexs() { + dashPointIndexs_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -40075,76 +40831,78 @@ public final class LayoutGraphicsProto { "\n\007Polygon\022\'\n\006common\030\001 \001(\0132\027.graphicData." + "CommonInfo\022\014\n\004code\030\002 \001(\t\022\021\n\tlineWidth\030\003 " + "\001(\005\022\021\n\tlineColor\030\004 \001(\t\022\"\n\006points\030\005 \003(\0132\022" + - ".graphicData.Point\"e\n\010Platform\022\'\n\006common" + - "\030\001 \001(\0132\027.graphicData.CommonInfo\022\014\n\004code\030" + - "\002 \001(\t\022\017\n\007hasdoor\030\003 \001(\010\022\021\n\tdirection\030\004 \001(" + - "\t\"\252\001\n\007Station\022\'\n\006common\030\001 \001(\0132\027.graphicD" + + ".graphicData.Point\"\214\001\n\010Platform\022\'\n\006commo" + + "n\030\001 \001(\0132\027.graphicData.CommonInfo\022\014\n\004code" + + "\030\002 \001(\t\022\017\n\007hasdoor\030\003 \001(\010\022\021\n\tdirection\030\004 \001" + + "(\t\022\021\n\tupAndDown\030\005 \001(\t\022\022\n\nrefStation\030\006 \001(" + + "\t\"\270\001\n\007Station\022\'\n\006common\030\001 \001(\0132\027.graphicD" + "ata.CommonInfo\022\014\n\004code\030\002 \001(\t\022\022\n\nhasContr" + "ol\030\003 \001(\010\022\035\n\025concentrationStations\030\004 \001(\010\022" + "5\n\017kilometerSystem\030\006 \001(\0132\034.graphicData.K" + - "ilometerSystem\"k\n\013StationLine\022\'\n\006common\030" + - "\001 \001(\0132\027.graphicData.CommonInfo\022\014\n\004code\030\002" + - " \001(\t\022\023\n\013hasTransfer\030\003 \001(\010\022\020\n\010hideName\030\004 " + - "\001(\010\"Y\n\013TrainWindow\022\'\n\006common\030\001 \001(\0132\027.gra" + - "phicData.CommonInfo\022\014\n\004code\030\002 \001(\t\022\023\n\013ref" + - "DeviceId\030\003 \003(\t\"\256\001\n\014AxleCounting\022\'\n\006commo" + - "n\030\001 \001(\0132\027.graphicData.CommonInfo\022\014\n\004code" + - "\030\002 \001(\t\0225\n\017kilometerSystem\030\003 \001(\0132\034.graphi" + - "cData.KilometerSystem\0220\n\017axleCountingRef" + - "\030\004 \003(\0132\027.graphicData.RelatedRef\">\n\005Train" + - "\022\'\n\006common\030\001 \001(\0132\027.graphicData.CommonInf" + - "o\022\014\n\004code\030\002 \001(\t\"B\n\tTrainLine\022\'\n\006common\030\001" + + "ilometerSystem\022\014\n\004name\030\007 \001(\t\"k\n\013StationL" + + "ine\022\'\n\006common\030\001 \001(\0132\027.graphicData.Common" + + "Info\022\014\n\004code\030\002 \001(\t\022\023\n\013hasTransfer\030\003 \001(\010\022" + + "\020\n\010hideName\030\004 \001(\010\"Y\n\013TrainWindow\022\'\n\006comm" + + "on\030\001 \001(\0132\027.graphicData.CommonInfo\022\014\n\004cod" + + "e\030\002 \001(\t\022\023\n\013refDeviceId\030\003 \003(\t\"\256\001\n\014AxleCou" + + "nting\022\'\n\006common\030\001 \001(\0132\027.graphicData.Comm" + + "onInfo\022\014\n\004code\030\002 \001(\t\0225\n\017kilometerSystem\030" + + "\003 \001(\0132\034.graphicData.KilometerSystem\0220\n\017a" + + "xleCountingRef\030\004 \003(\0132\027.graphicData.Relat" + + "edRef\">\n\005Train\022\'\n\006common\030\001 \001(\0132\027.graphic" + + "Data.CommonInfo\022\014\n\004code\030\002 \001(\t\"B\n\tTrainLi" + + "ne\022\'\n\006common\030\001 \001(\0132\027.graphicData.CommonI" + + "nfo\022\014\n\004code\030\002 \001(\t\"@\n\007IscsFan\022\'\n\006common\030\001" + " \001(\0132\027.graphicData.CommonInfo\022\014\n\004code\030\002 " + - "\001(\t\"@\n\007IscsFan\022\'\n\006common\030\001 \001(\0132\027.graphic" + - "Data.CommonInfo\022\014\n\004code\030\002 \001(\t\"\333\002\n\007Turnou" + - "t\022\'\n\006common\030\001 \001(\0132\027.graphicData.CommonIn" + - "fo\022\014\n\004code\030\002 \001(\t\022\"\n\006pointA\030\006 \003(\0132\022.graph" + - "icData.Point\022\"\n\006pointB\030\007 \003(\0132\022.graphicDa" + - "ta.Point\022\"\n\006pointC\030\010 \003(\0132\022.graphicData.P" + - "oint\022&\n\005paRef\030\t \001(\0132\027.graphicData.Relate" + - "dRef\022&\n\005pbRef\030\n \001(\0132\027.graphicData.Relate" + - "dRef\022&\n\005pcRef\030\013 \001(\0132\027.graphicData.Relate" + - "dRef\0225\n\017kilometerSystem\030\r \003(\0132\034.graphicD" + - "ata.KilometerSystem\">\n\017KilometerSystem\022\021" + - "\n\tkilometer\030\001 \001(\003\022\030\n\020coordinateSystem\030\002 " + - "\001(\t\"\206\001\n\006Signal\022\'\n\006common\030\001 \001(\0132\027.graphic" + - "Data.CommonInfo\022\014\n\004code\030\002 \001(\t\022\016\n\006mirror\030" + - "\003 \001(\010\0225\n\017kilometerSystem\030\006 \001(\0132\034.graphic" + - "Data.KilometerSystem\"\307\001\n\007RunLine\022\'\n\006comm" + - "on\030\001 \001(\0132\027.graphicData.CommonInfo\022\014\n\004cod" + - "e\030\002 \001(\t\022\"\n\006points\030\003 \003(\0132\022.graphicData.Po" + - "int\022\021\n\tnameColor\030\004 \001(\t\022\023\n\013nameBgColor\030\005 " + - "\001(\t\022\022\n\ncontainSta\030\010 \003(\t\022\025\n\rlinkPathLines" + - "\030\t \003(\t\022\016\n\006lineId\030\n \001(\t\"\337\002\n\007Section\022\'\n\006co" + - "mmon\030\001 \001(\0132\027.graphicData.CommonInfo\022\014\n\004c" + - "ode\030\002 \001(\t\022\"\n\006points\030\003 \003(\0132\022.graphicData." + - "Point\022&\n\005paRef\030\004 \001(\0132\027.graphicData.Relat" + - "edRef\022&\n\005pbRef\030\005 \001(\0132\027.graphicData.Relat" + - "edRef\0225\n\013sectionType\030\006 \001(\0162 .graphicData" + - ".Section.SectionType\022\025\n\raxleCountings\030\007 " + - "\003(\t\022\020\n\010children\030\010 \003(\t\022\027\n\017destinationCode" + - "\030\t \001(\t\"0\n\013SectionType\022\014\n\010Physical\020\000\022\023\n\017T" + - "urnoutPhysical\020\002\"i\n\014LogicSection\022\'\n\006comm" + - "on\030\001 \001(\0132\027.graphicData.CommonInfo\022\014\n\004cod" + - "e\030\002 \001(\t\022\"\n\006points\030\003 \003(\0132\022.graphicData.Po" + - "int\"V\n\016KilometerPoint\022!\n\005point\030\001 \001(\0132\022.g" + - "raphicData.Point\022\021\n\tkilometer\030\002 \001(\003\022\016\n\006s" + - "tName\030\003 \001(\t\"\277\001\n\010PathLine\022\'\n\006common\030\001 \001(\013" + - "2\027.graphicData.CommonInfo\022\014\n\004code\030\002 \001(\t\022" + - "\"\n\006points\030\003 \003(\0132\022.graphicData.Point\022\014\n\004i" + - "sUp\030\004 \001(\010\0224\n\017kilometerPoints\030\005 \003(\0132\033.gra" + - "phicData.KilometerPoint\022\024\n\014isKmIncrease\030" + - "\006 \001(\010\"\366\001\n\nRelatedRef\0226\n\ndeviceType\030\001 \001(\016" + - "2\".graphicData.RelatedRef.DeviceType\022\n\n\002" + - "id\030\002 \001(\t\0226\n\ndevicePort\030\003 \001(\0162\".graphicDa" + - "ta.RelatedRef.DevicePort\"I\n\nDeviceType\022\013" + - "\n\007Section\020\000\022\013\n\007Turnout\020\001\022\017\n\013TrainWindow\020" + - "\002\022\020\n\014AxleCounting\020\003\"!\n\nDevicePort\022\005\n\001A\020\000" + - "\022\005\n\001B\020\001\022\005\n\001C\020\002\"Y\n\tSeparator\022\'\n\006common\030\001 " + - "\001(\0132\027.graphicData.CommonInfo\022\014\n\004code\030\002 \001" + - "(\t\022\025\n\rseparatorType\030\003 \001(\tB8\n!club.joylin" + - "k.xiannccda.dto.protosB\023LayoutGraphicsPr" + - "otob\006proto3" + "\001(\t\"\333\002\n\007Turnout\022\'\n\006common\030\001 \001(\0132\027.graphi" + + "cData.CommonInfo\022\014\n\004code\030\002 \001(\t\022\"\n\006pointA" + + "\030\006 \003(\0132\022.graphicData.Point\022\"\n\006pointB\030\007 \003" + + "(\0132\022.graphicData.Point\022\"\n\006pointC\030\010 \003(\0132\022" + + ".graphicData.Point\022&\n\005paRef\030\t \001(\0132\027.grap" + + "hicData.RelatedRef\022&\n\005pbRef\030\n \001(\0132\027.grap" + + "hicData.RelatedRef\022&\n\005pcRef\030\013 \001(\0132\027.grap" + + "hicData.RelatedRef\0225\n\017kilometerSystem\030\r " + + "\003(\0132\034.graphicData.KilometerSystem\">\n\017Kil" + + "ometerSystem\022\021\n\tkilometer\030\001 \001(\003\022\030\n\020coord" + + "inateSystem\030\002 \001(\t\"\206\001\n\006Signal\022\'\n\006common\030\001" + + " \001(\0132\027.graphicData.CommonInfo\022\014\n\004code\030\002 " + + "\001(\t\022\016\n\006mirror\030\003 \001(\010\0225\n\017kilometerSystem\030\006" + + " \001(\0132\034.graphicData.KilometerSystem\"\340\001\n\007R" + + "unLine\022\'\n\006common\030\001 \001(\0132\027.graphicData.Com" + + "monInfo\022\014\n\004code\030\002 \001(\t\022\"\n\006points\030\003 \003(\0132\022." + + "graphicData.Point\022\021\n\tnameColor\030\004 \001(\t\022\023\n\013" + + "nameBgColor\030\005 \001(\t\022\022\n\ncontainSta\030\010 \003(\t\022\025\n" + + "\rlinkPathLines\030\t \003(\t\022\016\n\006lineId\030\n \001(\t\022\027\n\017" + + "dashPointIndexs\030\013 \003(\005\"\337\002\n\007Section\022\'\n\006com" + + "mon\030\001 \001(\0132\027.graphicData.CommonInfo\022\014\n\004co" + + "de\030\002 \001(\t\022\"\n\006points\030\003 \003(\0132\022.graphicData.P" + + "oint\022&\n\005paRef\030\004 \001(\0132\027.graphicData.Relate" + + "dRef\022&\n\005pbRef\030\005 \001(\0132\027.graphicData.Relate" + + "dRef\0225\n\013sectionType\030\006 \001(\0162 .graphicData." + + "Section.SectionType\022\025\n\raxleCountings\030\007 \003" + + "(\t\022\020\n\010children\030\010 \003(\t\022\027\n\017destinationCode\030" + + "\t \001(\t\"0\n\013SectionType\022\014\n\010Physical\020\000\022\023\n\017Tu" + + "rnoutPhysical\020\002\"i\n\014LogicSection\022\'\n\006commo" + + "n\030\001 \001(\0132\027.graphicData.CommonInfo\022\014\n\004code" + + "\030\002 \001(\t\022\"\n\006points\030\003 \003(\0132\022.graphicData.Poi" + + "nt\"V\n\016KilometerPoint\022!\n\005point\030\001 \001(\0132\022.gr" + + "aphicData.Point\022\021\n\tkilometer\030\002 \001(\003\022\016\n\006st" + + "Name\030\003 \001(\t\"\277\001\n\010PathLine\022\'\n\006common\030\001 \001(\0132" + + "\027.graphicData.CommonInfo\022\014\n\004code\030\002 \001(\t\022\"" + + "\n\006points\030\003 \003(\0132\022.graphicData.Point\022\014\n\004is" + + "Up\030\004 \001(\010\0224\n\017kilometerPoints\030\005 \003(\0132\033.grap" + + "hicData.KilometerPoint\022\024\n\014isKmIncrease\030\006" + + " \001(\010\"\366\001\n\nRelatedRef\0226\n\ndeviceType\030\001 \001(\0162" + + "\".graphicData.RelatedRef.DeviceType\022\n\n\002i" + + "d\030\002 \001(\t\0226\n\ndevicePort\030\003 \001(\0162\".graphicDat" + + "a.RelatedRef.DevicePort\"I\n\nDeviceType\022\013\n" + + "\007Section\020\000\022\013\n\007Turnout\020\001\022\017\n\013TrainWindow\020\002" + + "\022\020\n\014AxleCounting\020\003\"!\n\nDevicePort\022\005\n\001A\020\000\022" + + "\005\n\001B\020\001\022\005\n\001C\020\002\"Y\n\tSeparator\022\'\n\006common\030\001 \001" + + "(\0132\027.graphicData.CommonInfo\022\014\n\004code\030\002 \001(" + + "\t\022\025\n\rseparatorType\030\003 \001(\tB8\n!club.joylink" + + ".xiannccda.dto.protosB\023LayoutGraphicsPro" + + "tob\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -40209,13 +40967,13 @@ public final class LayoutGraphicsProto { internal_static_graphicData_Platform_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_graphicData_Platform_descriptor, - new java.lang.String[] { "Common", "Code", "Hasdoor", "Direction", }); + new java.lang.String[] { "Common", "Code", "Hasdoor", "Direction", "UpAndDown", "RefStation", }); internal_static_graphicData_Station_descriptor = getDescriptor().getMessageTypes().get(10); internal_static_graphicData_Station_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_graphicData_Station_descriptor, - new java.lang.String[] { "Common", "Code", "HasControl", "ConcentrationStations", "KilometerSystem", }); + new java.lang.String[] { "Common", "Code", "HasControl", "ConcentrationStations", "KilometerSystem", "Name", }); internal_static_graphicData_StationLine_descriptor = getDescriptor().getMessageTypes().get(11); internal_static_graphicData_StationLine_fieldAccessorTable = new @@ -40275,7 +41033,7 @@ public final class LayoutGraphicsProto { internal_static_graphicData_RunLine_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_graphicData_RunLine_descriptor, - new java.lang.String[] { "Common", "Code", "Points", "NameColor", "NameBgColor", "ContainSta", "LinkPathLines", "LineId", }); + new java.lang.String[] { "Common", "Code", "Points", "NameColor", "NameBgColor", "ContainSta", "LinkPathLines", "LineId", "DashPointIndexs", }); internal_static_graphicData_Section_descriptor = getDescriptor().getMessageTypes().get(21); internal_static_graphicData_Section_fieldAccessorTable = new diff --git a/src/main/java/club/joylink/xiannccda/service/LineDeviceStatusService.java b/src/main/java/club/joylink/xiannccda/service/LineDeviceStatusService.java index 986f967..83e7a3e 100644 --- a/src/main/java/club/joylink/xiannccda/service/LineDeviceStatusService.java +++ b/src/main/java/club/joylink/xiannccda/service/LineDeviceStatusService.java @@ -1,13 +1,10 @@ package club.joylink.xiannccda.service; -import club.joylink.xiannccda.ats.message.MessageData; -import club.joylink.xiannccda.ats.message.MessageId; import club.joylink.xiannccda.ats.message.collect.DeviceStatusConvertorManager; import club.joylink.xiannccda.ats.message.collect.convertor.DeviceChangeStatusConvertor; import club.joylink.xiannccda.ats.message.collect.convertor.DeviceInitConvertor; import club.joylink.xiannccda.ats.message.collect.convertor.LineNetTrainInitConvertor; -import club.joylink.xiannccda.ats.message.collect.convertor.LineNetTrainRecordConvertor; import club.joylink.xiannccda.ats.message.collect.convertor.LineNetTrainRemoveConvertor; import club.joylink.xiannccda.ats.message.collect.convertor.LineNetTrainUpdateConvertor; import club.joylink.xiannccda.ats.message.collect.convertor.TrainInitConvertor; @@ -20,10 +17,7 @@ import club.joylink.xiannccda.ws.LineNetMessageServer; import club.joylink.xiannccda.ws.LineTrainMessageServer; import club.joylink.xiannccda.ws.WsMessageServerManager; import jakarta.annotation.PostConstruct; -import java.util.List; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicLong; + import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -47,8 +41,6 @@ public class LineDeviceStatusService { this.createDataConvertor(); // 添加初始化转换方法 DeviceStatusConvertorManager.addStatusConvertor(new LineNetTrainInitConvertor()); - // 列车报点信息转换方法 - DeviceStatusConvertorManager.addStatusConvertor(new LineNetTrainRecordConvertor()); // 列车更新转换方法 DeviceStatusConvertorManager.addStatusConvertor(new LineNetTrainUpdateConvertor()); // 列车删除转换方法 @@ -58,9 +50,6 @@ public class LineDeviceStatusService { wsMessageServerManager.registerMessageServer(new LineNetMessageServer()); wsMessageServerManager.registerMessageServer(new LineTrainMessageServer()); wsMessageServerManager.registerMessageServer(new LineDeviceMessageServer()); - - // 加载数据 - refreshTestData(); } private void createDataConvertor() { @@ -72,34 +61,4 @@ public class LineDeviceStatusService { DeviceStatusConvertorManager.addStatusConvertor(new TrainRecordConvertor()); DeviceStatusConvertorManager.addStatusConvertor(new TrainUpdateConvertor()); } - - public void refreshTestData() { - List allMockData = nccMockDataService.loadAllTrainInitData(); - DeviceStatusConvertorManager.doConvertor(allMockData); - int frequency = 1500, stopTime = 30000; - AtomicLong id = new AtomicLong(0); - AtomicLong resetTimes = new AtomicLong(stopTime); - Executors.newSingleThreadScheduledExecutor() - .scheduleWithFixedDelay( - () -> { - boolean isEmpty = true; - if (resetTimes.get() == stopTime) { // 代表还没有停顿,不相等说明已经进入空循环 - List updateMockData = - nccMockDataService.loadUpdateData(id, MessageId.TRAIN_RECORD.name(), 2); - DeviceStatusConvertorManager.doConvertor(updateMockData); - isEmpty = updateMockData.size() == 0; - } - if (isEmpty) { // 假数据已经用完了,开始重复使用,中间停顿30000ms - if (resetTimes.get() <= 0) { - id.set(0); - resetTimes.set(stopTime); - } else { - resetTimes.set(resetTimes.get() - frequency); - } - } - }, - frequency, - frequency, - TimeUnit.MILLISECONDS); - } } diff --git a/xian-ncc-da-message b/xian-ncc-da-message index 90b6f46..4f27cc3 160000 --- a/xian-ncc-da-message +++ b/xian-ncc-da-message @@ -1 +1 @@ -Subproject commit 90b6f4600e531c496d849163653acb80c6e933ea +Subproject commit 4f27cc3670bcb4071706bb0e66d6fdfd817e27a4 From cfa8eb81a180cb98e90fd8e9da04bba6dfaa8af9 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Fri, 21 Jul 2023 17:01:43 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=85=AC=E9=87=8C=E6=A0=87=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E9=81=93=E5=B2=94=E5=8C=BA=E6=AE=B5?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ats/cache/LineGraphicDataManage.java | 6 +- .../ats/cache/LineGraphicDataRepository.java | 323 +- .../convertor/LineNetTrainComMethod.java | 70 +- .../LineNetTrainRecordConvertor.java | 52 + .../xiannccda/dto/protos/DeviceInfoProto.java | 2756 ++++++++--------- .../dto/protos/LayoutGraphicsProto.java | 441 ++- .../service/LineDeviceStatusService.java | 50 +- xian-ncc-da-message | 2 +- 8 files changed, 1908 insertions(+), 1792 deletions(-) create mode 100644 src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainRecordConvertor.java diff --git a/src/main/java/club/joylink/xiannccda/ats/cache/LineGraphicDataManage.java b/src/main/java/club/joylink/xiannccda/ats/cache/LineGraphicDataManage.java index 81c9482..0781ab4 100644 --- a/src/main/java/club/joylink/xiannccda/ats/cache/LineGraphicDataManage.java +++ b/src/main/java/club/joylink/xiannccda/ats/cache/LineGraphicDataManage.java @@ -5,20 +5,18 @@ import club.joylink.xiannccda.dto.PublishedGIQueryDTO; import club.joylink.xiannccda.entity.PublishedGi; import club.joylink.xiannccda.repository.IPublishedGiRepository; import java.util.List; +import lombok.RequiredArgsConstructor; import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationRunner; import org.springframework.stereotype.Component; /** 线路发布数据内存管理 */ @Component +@RequiredArgsConstructor public class LineGraphicDataManage implements ApplicationRunner { final IPublishedGiRepository iPublishedGiRepository; - public LineGraphicDataManage(IPublishedGiRepository iPublishedGiRepository) { - this.iPublishedGiRepository = iPublishedGiRepository; - } - @Override public void run(ApplicationArguments args) throws Exception { PublishedGIQueryDTO query = new PublishedGIQueryDTO(); diff --git a/src/main/java/club/joylink/xiannccda/ats/cache/LineGraphicDataRepository.java b/src/main/java/club/joylink/xiannccda/ats/cache/LineGraphicDataRepository.java index b1ab4a7..10ea9df 100644 --- a/src/main/java/club/joylink/xiannccda/ats/cache/LineGraphicDataRepository.java +++ b/src/main/java/club/joylink/xiannccda/ats/cache/LineGraphicDataRepository.java @@ -1,6 +1,8 @@ package club.joylink.xiannccda.ats.cache; import club.joylink.xiannccda.dto.protos.DeviceInfoProto; +import club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer; +import club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout; import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto; import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem; import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.RelatedRef.DeviceType; @@ -55,13 +57,17 @@ public class LineGraphicDataRepository { // DeviceNameChanger.init(storage); Map> lineDataMap = new HashMap<>(); // 构建区段 - sectionInitLineGraph(lineDataMap, storage); + physicalSectionInitLineGraph(lineDataMap, storage); // 构建道岔 turnoutInitLineGraph(publishGi.getLineId(), lineDataMap, storage); // 设置公里标 setUpKilometerCode(publishGi.getLineId(), lineDataMap, storage); + // --------------------这里需要依赖区段、道岔初始化信息 start----------------- // 设置公里标后,开始构建逻辑区段的编码、公里标信息 setUpLogicSectionInfo(lineDataMap, storage); + // 设置道岔区段信息 + setUpTurnoutPhysicalSectionInfo(lineDataMap, storage); + // --------------------这里需要依赖区段、道岔初始化信息 end ------------------ lineGraphMap.put(publishGi.getLineId(), lineDataMap); // 填充line_code_table @@ -79,14 +85,14 @@ public class LineGraphicDataRepository { * @param sectionName 区段名称 * @return 公里标 */ - public static List getKilometerCodeList(int lineId, String sectionName) { + public static DeviceKilometer.Builder getKilometerCodeList(int lineId, String sectionName) { Map> lineDataMap = lineGraphMap.get(lineId); if (CollectionUtils.isNotEmpty(lineDataMap)) { Map sectionMap = lineDataMap.get(DeviceType.Section.name()); for (Builder v : sectionMap.values()) { DeviceInfoProto.Section.Builder builder = (DeviceInfoProto.Section.Builder) v; if (Objects.equals(builder.getCode(), sectionName)) { - return builder.getConvertKilometerList(); + return builder.getKilometerBuilder(); } } @@ -94,11 +100,11 @@ public class LineGraphicDataRepository { for (Builder v : turnoutMap.values()) { DeviceInfoProto.Turnout.Builder builder = (DeviceInfoProto.Turnout.Builder) v; if (Objects.equals(builder.getCode(), sectionName)) { - return builder.getConvertKilometerList(); + return builder.getKilometerBuilder(); } } } - return List.of(); + return null; } /** 删除线路绘图数据 */ @@ -160,24 +166,22 @@ public class LineGraphicDataRepository { * @param dataMap 缓存数据 * @param storage 地图构建数据 */ - private static void sectionInitLineGraph( + private static void physicalSectionInitLineGraph( Map> dataMap, LayoutGraphicsProto.RtssGraphicStorage storage) { - // 地图 - List
sectionList = storage.getSectionList(); - // 物理区段数据 - Map cacheSectionMap = new HashMap<>(sectionList.size()); - // 要保存的逻辑区段信息,预设值[section数量 * 【ABCD】] - Map cacheLogicSectionMap = new HashMap<>(sectionList.size() * 4); + // 先初始化物理区段信息 + List
sectionList = + storage.getSectionList().stream() + .filter(s -> Objects.equals(s.getSectionType(), SectionType.Physical)) + .toList(); + // 物理区段数据 + 逻辑区段数据(预设值[物理section数量 * 【ABCD】]) + Map sectionMap = new HashMap<>(sectionList.size() * 5); sectionList.stream() // 目前数据中还存在 区段类型为 逻辑区段类型暂时先过滤掉错误 .filter(section -> !SectionType.UNRECOGNIZED.equals(section.getSectionType())) .forEach( section -> { String sid = section.getCommon().getId(); - DeviceInfoProto.Section.Builder sectionBuilder = - cacheSectionMap.containsKey(sid) - ? (DeviceInfoProto.Section.Builder) cacheSectionMap.get(sid) - : DeviceInfoProto.Section.newBuilder().setId(sid); + DeviceInfoProto.Section.Builder sectionBuilder = initSection(sectionMap, sid); sectionBuilder.setCode(section.getCode()); sectionBuilder.setDestinationCode(section.getDestinationCode()); if (section.getChildrenCount() > 0) { @@ -185,19 +189,10 @@ public class LineGraphicDataRepository { // 初始化逻辑区段信息,建立逻辑区段与物理区段之间的关系 section .getChildrenList() - .forEach( - id -> - cacheLogicSectionMap.put( - id, - DeviceInfoProto.Section.newBuilder() - .setId(id) - .setPhysicalSectionId(sid))); + .forEach(id -> initSection(sectionMap, id).setPhysicalSectionId(sid)); } - cacheSectionMap.put(sid, sectionBuilder); }); - // 将逻辑区段信息放入区段集合中 - cacheSectionMap.putAll(cacheLogicSectionMap); - dataMap.put(DeviceType.Section.name(), cacheSectionMap); + dataMap.put(DeviceType.Section.name(), sectionMap); } /** @@ -224,33 +219,52 @@ public class LineGraphicDataRepository { DeviceInfoProto.Turnout.Builder turnoutBuilder = DeviceInfoProto.Turnout.newBuilder(); turnoutBuilder.setId(t.getCommon().getId()); turnoutBuilder.setCode(t.getCode()); - turnoutBuilder.addAllKilometerSystem(systemList); + turnoutBuilder.setKilometer(initKilometer(systemList)); cacheSwitchMap.put(t.getCommon().getId(), turnoutBuilder); - // 从道岔中生成坐标转换对象 - if (systemList.size() > 1) { - for (int i = 0, len = systemList.size(); i < len; i++) { - KilometerSystem si = systemList.get(i); - for (int j = i + 1; j < len; j++) { - KilometerSystem sj = systemList.get(j); - // 坐标系不一致时,生成转换对象 - if (!Objects.equals(sj.getCoordinateSystem(), si.getCoordinateSystem())) { - String convertorKey = - CoordinateConvertor.generateConvertorKey( - sj.getCoordinateSystem(), si.getCoordinateSystem()); - if (!convertorMap.containsKey(convertorKey)) { - convertorMap.put( - convertorKey, - CoordinateConvertor.generate( - si, sj.getCoordinateSystem(), sj.getKilometer())); - } - } - } - } - } + convertorCoordinateByTurnoutKM(convertorMap, systemList); }); dataMap.put(DeviceType.Turnout.name(), cacheSwitchMap); } + /** + * 设置道岔区段信息 + * + * @param dataMap 设备信息 + * @param storage + */ + private static void setUpTurnoutPhysicalSectionInfo( + Map> dataMap, LayoutGraphicsProto.RtssGraphicStorage storage) { + Map curSectionMap = dataMap.getOrDefault(DeviceType.Section.name(), Map.of()); + Map turnoutMap = dataMap.getOrDefault(DeviceType.Turnout.name(), Map.of()); + // 先初始化物理区段信息 + List
sectionList = + storage.getSectionList().stream() + .filter(s -> Objects.equals(s.getSectionType(), SectionType.TurnoutPhysical)) + .toList(); + // 道岔区段数据 + Map sectionMap = new HashMap<>(sectionList.size()); + sectionList.forEach( + section -> { + String sid = section.getCommon().getId(); + DeviceInfoProto.Section.Builder s = initSection(sectionMap, sid); + s.setCode(section.getCode()); + s.setDestinationCode(section.getDestinationCode()); + if (section.getChildrenCount() > 0) { + section + .getChildrenList() + .forEach( + tid -> { + Turnout.Builder t = findTurnout(turnoutMap, tid); + if (t != null) { + updateMinAndMaxKilometer(s.getKilometerBuilder(), t.getKilometerBuilder()); + } + }); + } + }); + curSectionMap.putAll(sectionMap); + dataMap.put(DeviceType.Section.name(), curSectionMap); + } + /** * 设置公里标 * @@ -275,27 +289,23 @@ public class LineGraphicDataRepository { .forEach( ref -> { if (Objects.equals(DeviceType.Section, ref.getDeviceType())) { - if (sectionMap.containsKey(ref.getId())) { - DeviceInfoProto.Section.Builder sectionBuilder = - (DeviceInfoProto.Section.Builder) sectionMap.get(ref.getId()); - sectionBuilder.addKilometerSystem(ac.getKilometerSystem()); - sectionBuilder.addConvertKilometer(mainLineCoordinate); + DeviceInfoProto.Section.Builder b = findSection(sectionMap, ref.getId()); + if (b != null) { + DeviceInfoProto.DeviceKilometer.Builder k = b.getKilometerBuilder(); + updateKilometer(k, ac.getKilometerSystem(), mainLineCoordinate); } } else if (Objects.equals(DeviceType.Turnout, ref.getDeviceType())) { - if (turnoutMap.containsKey(ref.getId())) { - DeviceInfoProto.Turnout.Builder turnoutBuilder = - (DeviceInfoProto.Turnout.Builder) turnoutMap.get(ref.getId()); - // 如果已经转换过则不再做转换 - if (turnoutBuilder.getConvertKilometerCount() == 0) { - turnoutBuilder.getKilometerSystemList().stream() - .filter(s -> StringUtils.isNotEmpty(s.getCoordinateSystem())) - .forEach( - s -> - turnoutBuilder.addConvertKilometer( - doConvertorCoordinate(lineId, s))); - } - // 放入当前计轴转换信息 - turnoutBuilder.addConvertKilometer(mainLineCoordinate); + DeviceInfoProto.Turnout.Builder b = findTurnout(turnoutMap, ref.getId()); + if (b != null) { + DeviceInfoProto.DeviceKilometer.Builder k = b.getKilometerBuilder(); + // 更新道岔自身的公里标数据 + k.getKilometerSystemList() + .forEach( + s -> + updateMinAndMaxKilometer( + k, doConvertorCoordinate(lineId, s))); + // 放入当前计轴信息 + updateKilometer(k, ac.getKilometerSystem(), mainLineCoordinate); } } }); @@ -333,8 +343,8 @@ public class LineGraphicDataRepository { DeviceType.Turnout.equals(ref.getDeviceType()) && turnoutMap.containsKey(ref.getId())) .map(ref -> (DeviceInfoProto.Turnout.Builder) turnoutMap.get(ref.getId())) - .filter(t -> t.getKilometerSystemCount() > 0) - .map(t -> t.getKilometerSystemList().get(0)) + .filter(t -> t.getKilometer().getKilometerSystemCount() > 0) + .map(t -> t.getKilometer().getKilometerSystemList().get(0)) .toList(); // 如果关联多个道岔 if (kilometerSystemList.size() > 1) { @@ -377,6 +387,49 @@ public class LineGraphicDataRepository { }); } + /** + * 根据道岔的公里标获取转换信息 + * + * @param convertorMap 转换保存集合 + * @param systemList 公里标集合 + */ + private static void convertorCoordinateByTurnoutKM( + Map convertorMap, List systemList) { + if (CollectionUtils.isEmpty(systemList)) { + return; + } + // 有效坐标系 + List effectiveList = + systemList.stream().filter(s -> StringUtils.isNotEmpty(s.getCoordinateSystem())).toList(); + if (CollectionUtils.isEmpty(effectiveList)) { + return; + } + // 坐标系的种类 + long typeCount = + effectiveList.stream().map(KilometerSystem::getCoordinateSystem).distinct().count(); + if (typeCount < 2) { // 种类小于2,则不需要转换 + return; + } + // 从道岔中生成坐标转换对象 + for (int i = 0, len = effectiveList.size(); i < len; i++) { + KilometerSystem si = effectiveList.get(i); + for (int j = i + 1; j < len; j++) { + KilometerSystem sj = effectiveList.get(j); + // 坐标系不一致时,生成转换对象 + if (!Objects.equals(sj.getCoordinateSystem(), si.getCoordinateSystem())) { + String convertorKey = + CoordinateConvertor.generateConvertorKey( + sj.getCoordinateSystem(), si.getCoordinateSystem()); + if (!convertorMap.containsKey(convertorKey)) { + convertorMap.put( + convertorKey, + CoordinateConvertor.generate(si, sj.getCoordinateSystem(), sj.getKilometer())); + } + } + } + } + } + /** * 公里标转换 * @@ -416,29 +469,133 @@ public class LineGraphicDataRepository { section -> { String sid = section.getCommon().getId(); if (sectionMap.containsKey(sid)) { - DeviceInfoProto.Section.Builder sectionBuilder = - (DeviceInfoProto.Section.Builder) sectionMap.get(sid); + DeviceInfoProto.Section.Builder sectionBuilder = findSection(sectionMap, sid); sectionBuilder.setCode(section.getCode()); // 获取到物理区段信息 DeviceInfoProto.Section.Builder physicalSection = - (DeviceInfoProto.Section.Builder) - sectionMap.get(sectionBuilder.getPhysicalSectionId()); - if (physicalSection.getKilometerSystemCount() > 0) { - long min = - physicalSection.getConvertKilometerList().stream().min(Long::compareTo).get(); - long max = - physicalSection.getConvertKilometerList().stream().max(Long::compareTo).get(); + findSection(sectionMap, sectionBuilder.getPhysicalSectionId()); + DeviceKilometer.Builder deviceKilometer = sectionBuilder.getKilometerBuilder(); + DeviceKilometer.Builder parentKilometer = physicalSection.getKilometerBuilder(); + if (parentKilometer.getKilometerSystemCount() > 0) { + long min = parentKilometer.getMinKilometer(); + long max = parentKilometer.getMaxKilometer(); long avgDistance = (max - min) / physicalSection.getChildrenIdCount(); int index = physicalSection.getChildrenIdList().indexOf(sid); - // 最小公里标 - sectionBuilder.addConvertKilometer(min + index * avgDistance); - // 最大公里标 - sectionBuilder.addConvertKilometer(min + (index + 1) * avgDistance); + deviceKilometer.setMinKilometer(min + index * avgDistance); // 最小公里标 + deviceKilometer.setMaxKilometer(min + (index + 1) * avgDistance); // 最大公里标 } } }); } + /** + * 生成默认的公里标对象 + * + * @param list 公里标列表 + * @return 对象信息 + */ + private static DeviceInfoProto.DeviceKilometer.Builder initKilometer(List list) { + DeviceInfoProto.DeviceKilometer.Builder builder = initKilometer(); + if (CollectionUtils.isNotEmpty(list)) { + builder.addAllKilometerSystem(list); + } + return builder; + } + + /** + * 生成默认的公里标对象 + * + * @return 对象信息 + */ + private static DeviceInfoProto.DeviceKilometer.Builder initKilometer() { + DeviceInfoProto.DeviceKilometer.Builder builder = DeviceInfoProto.DeviceKilometer.newBuilder(); + builder.setMinKilometer(Long.MAX_VALUE); + builder.setMaxKilometer(Long.MIN_VALUE); + return builder; + } + + /** + * 更新实体内的公里标信息 + * + * @param kilometer 公里标对象 + * @param km 传入的公里标 + * @param mainLineCoordinate 转换成的正线公里标信息 + */ + private static void updateKilometer( + DeviceInfoProto.DeviceKilometer.Builder kilometer, + KilometerSystem km, + long mainLineCoordinate) { + kilometer.addKilometerSystem(km); + kilometer.setMinKilometer(Math.min(kilometer.getMinKilometer(), mainLineCoordinate)); + kilometer.setMaxKilometer(Math.max(kilometer.getMaxKilometer(), mainLineCoordinate)); + } + + /** + * 更新实体最大最小公里标 + * + * @param kilometer 公里标对象 + * @param mainLineCoordinate 转换的正线数据 + */ + private static void updateMinAndMaxKilometer( + DeviceInfoProto.DeviceKilometer.Builder kilometer, long mainLineCoordinate) { + kilometer.setMinKilometer(Math.min(kilometer.getMinKilometer(), mainLineCoordinate)); + kilometer.setMaxKilometer(Math.max(kilometer.getMaxKilometer(), mainLineCoordinate)); + } + + private static void updateMinAndMaxKilometer( + DeviceInfoProto.DeviceKilometer.Builder kilometer, + DeviceInfoProto.DeviceKilometer.Builder km) { + kilometer.setMinKilometer(Math.min(kilometer.getMinKilometer(), km.getMinKilometer())); + kilometer.setMaxKilometer(Math.max(kilometer.getMaxKilometer(), km.getMaxKilometer())); + } + + /** + * 获取区段信息,没有时,创建并放入map中 + * + * @param map 区段的集合 + * @param id 区段ID + * @return 区段实体信息 + */ + private static DeviceInfoProto.Section.Builder initSection(Map map, String id) { + if (map.containsKey(id)) { + return (DeviceInfoProto.Section.Builder) map.get(id); + } else { + DeviceInfoProto.Section.Builder builder = DeviceInfoProto.Section.newBuilder(); + builder.setId(id); + builder.setKilometer(initKilometer()); + map.put(id, builder); + return builder; + } + } + + /** + * 获取区段信息 + * + * @param map 区段集合 + * @param id 区段ID + * @return 区段信息 + */ + private static DeviceInfoProto.Section.Builder findSection(Map map, String id) { + if (map.containsKey(id)) { + return (DeviceInfoProto.Section.Builder) map.get(id); + } + return null; + } + + /** + * 获取道岔信息 + * + * @param map 道岔集合 + * @param id 道岔ID + * @return 道岔信息 + */ + private static DeviceInfoProto.Turnout.Builder findTurnout(Map map, String id) { + if (map.containsKey(id)) { + return (DeviceInfoProto.Turnout.Builder) map.get(id); + } + return null; + } + /** 坐标系枚举 */ @Getter private enum CoordinateEnum { diff --git a/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainComMethod.java b/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainComMethod.java index 22ee9f7..da2e871 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainComMethod.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainComMethod.java @@ -7,10 +7,9 @@ import club.joylink.xiannccda.ats.message.collect.datasource.DeviceStatusData; import club.joylink.xiannccda.ats.message.line3.changer.DeviceNameChangerManage; import club.joylink.xiannccda.ats.message.line3.device.DeviceType; import club.joylink.xiannccda.dto.protos.DeviceInfoProto; +import club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer; import club.joylink.xiannccda.dto.protos.WsMessageProto; -import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.google.protobuf.GeneratedMessageV3.Builder; -import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -56,9 +55,9 @@ public abstract class LineNetTrainComMethod { public static void setUpKilometerCode( WsMessageProto.WsLineNetTrainOffsetMessage.Builder obj, DeviceType type, String deviceName) { // 获取到当前区段公里标 - List kmList = getDeviceKilometerCode(obj.getLineId(), type, deviceName); - if (CollectionUtils.isNotEmpty(kmList)) { - obj.setKilometerCode(selectDeviceKilometerCode(obj.getDir(), kmList)); + DeviceKilometer.Builder km = getDeviceKM(obj.getLineId(), type, deviceName); + if (km != null) { + obj.setKilometerCode(selectDeviceKilometerCode(obj.getDir(), km)); } else { log.warn(String.format("设备%s没有公里标信息", deviceName)); } @@ -70,31 +69,29 @@ public abstract class LineNetTrainComMethod { * @param obj 要设置的对象 * @param destinationCode 目的码 * @param type 设备类型 - * @param deviceName 设备名称 + * @param name 设备名称 */ public static void setTrainDirectionAndKilometerCode( WsMessageProto.WsLineNetTrainOffsetMessage.Builder obj, String destinationCode, DeviceType type, - String deviceName) { - List deviceKmList = getDeviceKilometerCode(obj.getLineId(), type, deviceName); - if (CollectionUtils.isEmpty(deviceKmList)) { + String name) { + DeviceKilometer.Builder deviceKm = getDeviceKM(obj.getLineId(), type, name); + if (deviceKm == null) { return; } - List destinationKmList = getDirectionCodeKilometerCode(obj.getLineId(), destinationCode); - if (CollectionUtils.isEmpty(destinationKmList)) { + DeviceKilometer.Builder destinationKm = getDirectionCodeKM(obj.getLineId(), destinationCode); + if (destinationKm == null) { return; } // 确定方向 - long deviceMax = deviceKmList.stream().max(Long::compareTo).get(); - long destinationMax = destinationKmList.stream().max(Long::compareTo).get(); - if (destinationMax > deviceMax) { // 目的地最大公里标大于设备最大公里标,上行 - obj.setDir(TrainRunDirection.UP.getNum()); + if (destinationKm.getMaxKilometer() > deviceKm.getMaxKilometer()) { // 目的地最大公里标大于设备最大公里标,上行 + obj.setDir(TrainRunDirection.UP.getDir()); } else { - obj.setDir(TrainRunDirection.DOWN.getNum()); + obj.setDir(TrainRunDirection.DOWN.getDir()); } // 赋值公里标 - obj.setKilometerCode(selectDeviceKilometerCode(obj.getDir(), deviceKmList)); + obj.setKilometerCode(selectDeviceKilometerCode(obj.getDir(), deviceKm)); } /** @@ -102,16 +99,16 @@ public abstract class LineNetTrainComMethod { * * @param lineId 线路ID * @param type 设备类型 - * @param deviceName 设备名称 + * @param name 设备名称 * @return 公里标列表 */ - private static List getDeviceKilometerCode(int lineId, DeviceType type, String deviceName) { + private static DeviceKilometer.Builder getDeviceKM(int lineId, DeviceType type, String name) { // 非区段、道岔直接返回 if (!DeviceType.DEVICE_TYPE_TRACK.equals(type) && !DeviceType.DEVICE_TYPE_SWITCH.equals(type)) { - return List.of(); + return null; } // 转换成程序中的名称 - String convertName = DeviceNameChangerManage.findMatch(type, deviceName); + String convertName = DeviceNameChangerManage.findMatch(type, name); // 获取到当前区段公里标 return LineGraphicDataRepository.getKilometerCodeList(lineId, convertName); } @@ -123,7 +120,7 @@ public abstract class LineNetTrainComMethod { * @param code 目的地码 * @return 公里标列表 */ - private static List getDirectionCodeKilometerCode(int lineId, String code) { + private static DeviceKilometer.Builder getDirectionCodeKM(int lineId, String code) { Map map = LineGraphicDataRepository.getLineSectionBuild(lineId); Optional destination = map.values().stream() @@ -135,9 +132,9 @@ public abstract class LineNetTrainComMethod { .findFirst(); if (destination.isPresent()) { DeviceInfoProto.Section.Builder b = (DeviceInfoProto.Section.Builder) destination.get(); - return b.getConvertKilometerList(); + return b.getKilometerBuilder(); } else { - return List.of(); + return null; } } @@ -145,19 +142,12 @@ public abstract class LineNetTrainComMethod { * 选择对应的公里标信息 * * @param dir 运行方向 - * @param kmList 公里标列表 + * @param km 公里标信息 * @return 公里标 */ - private static long selectDeviceKilometerCode(int dir, List kmList) { - long kilometer; - if (dir == 1) { // 下行取大值 - kilometer = kmList.stream().min(Long::compareTo).get(); - } else if (dir == 2) { // 上行取小值 - kilometer = kmList.stream().max(Long::compareTo).get(); - } else { // 无方向获取第一个 - kilometer = kmList.get(0); - } - return kilometer; + private static long selectDeviceKilometerCode(int dir, DeviceKilometer.Builder km) { + // 下行(1)取小值 \ 上行(2)取大值 + return TrainRunDirection.UP.isMatch(dir) ? km.getMaxKilometer() : km.getMinKilometer(); } @Getter @@ -166,10 +156,14 @@ public abstract class LineNetTrainComMethod { DOWN(1), NO(0); - private int num; + private int dir; - TrainRunDirection(int num) { - this.num = num; + TrainRunDirection(int dir) { + this.dir = dir; + } + + public boolean isMatch(int dir) { + return this.dir == dir; } } } diff --git a/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainRecordConvertor.java b/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainRecordConvertor.java new file mode 100644 index 0000000..66b683c --- /dev/null +++ b/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainRecordConvertor.java @@ -0,0 +1,52 @@ +package club.joylink.xiannccda.ats.message.collect.convertor; + +import club.joylink.xiannccda.ats.message.MessageData; +import club.joylink.xiannccda.ats.message.MessageId; +import club.joylink.xiannccda.ats.message.collect.DeviceStatusConvertor; + +import club.joylink.xiannccda.ats.message.collect.DeviceStatusDataOperate; +import club.joylink.xiannccda.ats.message.line3.device.DeviceType; +import club.joylink.xiannccda.ats.message.line3.rep.TrainRecordResponse; +import club.joylink.xiannccda.dto.protos.WsMessageProto; +import com.google.common.collect.Lists; +import com.google.protobuf.GeneratedMessageV3.Builder; +import java.util.List; +import java.util.Objects; +import lombok.extern.slf4j.Slf4j; + +@Slf4j +public class LineNetTrainRecordConvertor extends DeviceStatusConvertor { + + @Override + public MessageId getMessageId() { + return MessageId.TRAIN_RECORD; + } + + @Override + public void run(List messageDataList) { + try { + List buildList = Lists.newArrayList(); + // 已存在的设备信息 + for (MessageData data : messageDataList) { + if (Objects.equals(getMessageId(), data.getMsgId())) { // 消息类型一致 + TrainRecordResponse response = (TrainRecordResponse) data; + WsMessageProto.WsLineNetTrainOffsetMessage.Builder offset = + WsMessageProto.WsLineNetTrainOffsetMessage.newBuilder(); + offset.setLineId(response.getLineId()); // 线路id + offset.setGroupId(response.getGroupId()); // 车组号 + LineNetTrainComMethod.getDeviceStatusById(offset); // 合并老旧数据 + offset.setDir(response.getDirection().getValue()); // 初始设置无运行方向 + // 设置公里标信息 + LineNetTrainComMethod.setUpKilometerCode( + offset, DeviceType.DEVICE_TYPE_TRACK, response.getTrackName()); + offset.setShow(offset.getKilometerCode() != 0); + buildList.add(offset); + } + } + // 增加设备信息 + DeviceStatusDataOperate.addDevices(buildList, LineNetTrainComMethod.getDeviceStatusData()); + } catch (Exception e) { + log.error("信息生成出错", e); + } + } +} diff --git a/src/main/java/club/joylink/xiannccda/dto/protos/DeviceInfoProto.java b/src/main/java/club/joylink/xiannccda/dto/protos/DeviceInfoProto.java index 8c9b6b9..ea5f307 100644 --- a/src/main/java/club/joylink/xiannccda/dto/protos/DeviceInfoProto.java +++ b/src/main/java/club/joylink/xiannccda/dto/protos/DeviceInfoProto.java @@ -91,85 +91,12 @@ public final class DeviceInfoProto { com.google.protobuf.ByteString getChildrenIdBytes(int index); - /** - *
-     * 公里标
-     * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - java.util.List - getKilometerSystemList(); - /** - *
-     * 公里标
-     * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem getKilometerSystem(int index); - /** - *
-     * 公里标
-     * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - int getKilometerSystemCount(); - /** - *
-     * 公里标
-     * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - java.util.List - getKilometerSystemOrBuilderList(); - /** - *
-     * 公里标
-     * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystemOrBuilder getKilometerSystemOrBuilder( - int index); - - /** - *
-     * 转换后的公里标数字
-     * 
- * - * repeated int64 convertKilometer = 5; - * @return A list containing the convertKilometer. - */ - java.util.List getConvertKilometerList(); - /** - *
-     * 转换后的公里标数字
-     * 
- * - * repeated int64 convertKilometer = 5; - * @return The count of convertKilometer. - */ - int getConvertKilometerCount(); - /** - *
-     * 转换后的公里标数字
-     * 
- * - * repeated int64 convertKilometer = 5; - * @param index The index of the element to return. - * @return The convertKilometer at the given index. - */ - long getConvertKilometer(int index); - /** *
      * 物理区段Id
      * 
* - * string physicalSectionId = 6; + * string physicalSectionId = 4; * @return The physicalSectionId. */ java.lang.String getPhysicalSectionId(); @@ -178,7 +105,7 @@ public final class DeviceInfoProto { * 物理区段Id *
* - * string physicalSectionId = 6; + * string physicalSectionId = 4; * @return The bytes for physicalSectionId. */ com.google.protobuf.ByteString @@ -189,7 +116,7 @@ public final class DeviceInfoProto { * 目的地码 * * - * string destinationCode = 7; + * string destinationCode = 5; * @return The destinationCode. */ java.lang.String getDestinationCode(); @@ -198,11 +125,38 @@ public final class DeviceInfoProto { * 目的地码 * * - * string destinationCode = 7; + * string destinationCode = 5; * @return The bytes for destinationCode. */ com.google.protobuf.ByteString getDestinationCodeBytes(); + + /** + *
+     * 公里标信息
+     * 
+ * + * .state.DeviceKilometer kilometer = 6; + * @return Whether the kilometer field is set. + */ + boolean hasKilometer(); + /** + *
+     * 公里标信息
+     * 
+ * + * .state.DeviceKilometer kilometer = 6; + * @return The kilometer. + */ + club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer getKilometer(); + /** + *
+     * 公里标信息
+     * 
+ * + * .state.DeviceKilometer kilometer = 6; + */ + club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometerOrBuilder getKilometerOrBuilder(); } /** *
@@ -225,8 +179,6 @@ public final class DeviceInfoProto {
       code_ = "";
       childrenId_ =
           com.google.protobuf.LazyStringArrayList.emptyList();
-      kilometerSystem_ = java.util.Collections.emptyList();
-      convertKilometer_ = emptyLongList();
       physicalSectionId_ = "";
       destinationCode_ = "";
     }
@@ -390,109 +342,7 @@ public final class DeviceInfoProto {
       return childrenId_.getByteString(index);
     }
 
-    public static final int KILOMETERSYSTEM_FIELD_NUMBER = 4;
-    @SuppressWarnings("serial")
-    private java.util.List kilometerSystem_;
-    /**
-     * 
-     * 公里标
-     * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - @java.lang.Override - public java.util.List getKilometerSystemList() { - return kilometerSystem_; - } - /** - *
-     * 公里标
-     * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - @java.lang.Override - public java.util.List - getKilometerSystemOrBuilderList() { - return kilometerSystem_; - } - /** - *
-     * 公里标
-     * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - @java.lang.Override - public int getKilometerSystemCount() { - return kilometerSystem_.size(); - } - /** - *
-     * 公里标
-     * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - @java.lang.Override - public club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem getKilometerSystem(int index) { - return kilometerSystem_.get(index); - } - /** - *
-     * 公里标
-     * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - @java.lang.Override - public club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystemOrBuilder getKilometerSystemOrBuilder( - int index) { - return kilometerSystem_.get(index); - } - - public static final int CONVERTKILOMETER_FIELD_NUMBER = 5; - @SuppressWarnings("serial") - private com.google.protobuf.Internal.LongList convertKilometer_; - /** - *
-     * 转换后的公里标数字
-     * 
- * - * repeated int64 convertKilometer = 5; - * @return A list containing the convertKilometer. - */ - @java.lang.Override - public java.util.List - getConvertKilometerList() { - return convertKilometer_; - } - /** - *
-     * 转换后的公里标数字
-     * 
- * - * repeated int64 convertKilometer = 5; - * @return The count of convertKilometer. - */ - public int getConvertKilometerCount() { - return convertKilometer_.size(); - } - /** - *
-     * 转换后的公里标数字
-     * 
- * - * repeated int64 convertKilometer = 5; - * @param index The index of the element to return. - * @return The convertKilometer at the given index. - */ - public long getConvertKilometer(int index) { - return convertKilometer_.getLong(index); - } - private int convertKilometerMemoizedSerializedSize = -1; - - public static final int PHYSICALSECTIONID_FIELD_NUMBER = 6; + public static final int PHYSICALSECTIONID_FIELD_NUMBER = 4; @SuppressWarnings("serial") private volatile java.lang.Object physicalSectionId_ = ""; /** @@ -500,7 +350,7 @@ public final class DeviceInfoProto { * 物理区段Id *
* - * string physicalSectionId = 6; + * string physicalSectionId = 4; * @return The physicalSectionId. */ @java.lang.Override @@ -521,7 +371,7 @@ public final class DeviceInfoProto { * 物理区段Id * * - * string physicalSectionId = 6; + * string physicalSectionId = 4; * @return The bytes for physicalSectionId. */ @java.lang.Override @@ -539,7 +389,7 @@ public final class DeviceInfoProto { } } - public static final int DESTINATIONCODE_FIELD_NUMBER = 7; + public static final int DESTINATIONCODE_FIELD_NUMBER = 5; @SuppressWarnings("serial") private volatile java.lang.Object destinationCode_ = ""; /** @@ -547,7 +397,7 @@ public final class DeviceInfoProto { * 目的地码 * * - * string destinationCode = 7; + * string destinationCode = 5; * @return The destinationCode. */ @java.lang.Override @@ -568,7 +418,7 @@ public final class DeviceInfoProto { * 目的地码 * * - * string destinationCode = 7; + * string destinationCode = 5; * @return The bytes for destinationCode. */ @java.lang.Override @@ -586,6 +436,44 @@ public final class DeviceInfoProto { } } + public static final int KILOMETER_FIELD_NUMBER = 6; + private club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer kilometer_; + /** + *
+     * 公里标信息
+     * 
+ * + * .state.DeviceKilometer kilometer = 6; + * @return Whether the kilometer field is set. + */ + @java.lang.Override + public boolean hasKilometer() { + return kilometer_ != null; + } + /** + *
+     * 公里标信息
+     * 
+ * + * .state.DeviceKilometer kilometer = 6; + * @return The kilometer. + */ + @java.lang.Override + public club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer getKilometer() { + return kilometer_ == null ? club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.getDefaultInstance() : kilometer_; + } + /** + *
+     * 公里标信息
+     * 
+ * + * .state.DeviceKilometer kilometer = 6; + */ + @java.lang.Override + public club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometerOrBuilder getKilometerOrBuilder() { + return kilometer_ == null ? club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.getDefaultInstance() : kilometer_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -600,7 +488,6 @@ public final class DeviceInfoProto { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); } @@ -610,21 +497,14 @@ public final class DeviceInfoProto { for (int i = 0; i < childrenId_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, childrenId_.getRaw(i)); } - for (int i = 0; i < kilometerSystem_.size(); i++) { - output.writeMessage(4, kilometerSystem_.get(i)); - } - if (getConvertKilometerList().size() > 0) { - output.writeUInt32NoTag(42); - output.writeUInt32NoTag(convertKilometerMemoizedSerializedSize); - } - for (int i = 0; i < convertKilometer_.size(); i++) { - output.writeInt64NoTag(convertKilometer_.getLong(i)); - } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(physicalSectionId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, physicalSectionId_); + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, physicalSectionId_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destinationCode_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, destinationCode_); + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, destinationCode_); + } + if (kilometer_ != null) { + output.writeMessage(6, getKilometer()); } getUnknownFields().writeTo(output); } @@ -649,29 +529,15 @@ public final class DeviceInfoProto { size += dataSize; size += 1 * getChildrenIdList().size(); } - for (int i = 0; i < kilometerSystem_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, kilometerSystem_.get(i)); - } - { - int dataSize = 0; - for (int i = 0; i < convertKilometer_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt64SizeNoTag(convertKilometer_.getLong(i)); - } - size += dataSize; - if (!getConvertKilometerList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - convertKilometerMemoizedSerializedSize = dataSize; - } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(physicalSectionId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, physicalSectionId_); + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, physicalSectionId_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destinationCode_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, destinationCode_); + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, destinationCode_); + } + if (kilometer_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getKilometer()); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -694,14 +560,15 @@ public final class DeviceInfoProto { .equals(other.getCode())) return false; if (!getChildrenIdList() .equals(other.getChildrenIdList())) return false; - if (!getKilometerSystemList() - .equals(other.getKilometerSystemList())) return false; - if (!getConvertKilometerList() - .equals(other.getConvertKilometerList())) return false; if (!getPhysicalSectionId() .equals(other.getPhysicalSectionId())) return false; if (!getDestinationCode() .equals(other.getDestinationCode())) return false; + if (hasKilometer() != other.hasKilometer()) return false; + if (hasKilometer()) { + if (!getKilometer() + .equals(other.getKilometer())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -721,18 +588,14 @@ public final class DeviceInfoProto { hash = (37 * hash) + CHILDRENID_FIELD_NUMBER; hash = (53 * hash) + getChildrenIdList().hashCode(); } - if (getKilometerSystemCount() > 0) { - hash = (37 * hash) + KILOMETERSYSTEM_FIELD_NUMBER; - hash = (53 * hash) + getKilometerSystemList().hashCode(); - } - if (getConvertKilometerCount() > 0) { - hash = (37 * hash) + CONVERTKILOMETER_FIELD_NUMBER; - hash = (53 * hash) + getConvertKilometerList().hashCode(); - } hash = (37 * hash) + PHYSICALSECTIONID_FIELD_NUMBER; hash = (53 * hash) + getPhysicalSectionId().hashCode(); hash = (37 * hash) + DESTINATIONCODE_FIELD_NUMBER; hash = (53 * hash) + getDestinationCode().hashCode(); + if (hasKilometer()) { + hash = (37 * hash) + KILOMETER_FIELD_NUMBER; + hash = (53 * hash) + getKilometer().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -872,16 +735,13 @@ public final class DeviceInfoProto { code_ = ""; childrenId_ = com.google.protobuf.LazyStringArrayList.emptyList(); - if (kilometerSystemBuilder_ == null) { - kilometerSystem_ = java.util.Collections.emptyList(); - } else { - kilometerSystem_ = null; - kilometerSystemBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000008); - convertKilometer_ = emptyLongList(); physicalSectionId_ = ""; destinationCode_ = ""; + kilometer_ = null; + if (kilometerBuilder_ != null) { + kilometerBuilder_.dispose(); + kilometerBuilder_ = null; + } return this; } @@ -908,29 +768,11 @@ public final class DeviceInfoProto { @java.lang.Override public club.joylink.xiannccda.dto.protos.DeviceInfoProto.Section buildPartial() { club.joylink.xiannccda.dto.protos.DeviceInfoProto.Section result = new club.joylink.xiannccda.dto.protos.DeviceInfoProto.Section(this); - buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartialRepeatedFields(club.joylink.xiannccda.dto.protos.DeviceInfoProto.Section result) { - if (kilometerSystemBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { - kilometerSystem_ = java.util.Collections.unmodifiableList(kilometerSystem_); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.kilometerSystem_ = kilometerSystem_; - } else { - result.kilometerSystem_ = kilometerSystemBuilder_.build(); - } - if (((bitField0_ & 0x00000010) != 0)) { - convertKilometer_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000010); - } - result.convertKilometer_ = convertKilometer_; - } - private void buildPartial0(club.joylink.xiannccda.dto.protos.DeviceInfoProto.Section result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { @@ -943,12 +785,17 @@ public final class DeviceInfoProto { childrenId_.makeImmutable(); result.childrenId_ = childrenId_; } - if (((from_bitField0_ & 0x00000020) != 0)) { + if (((from_bitField0_ & 0x00000008) != 0)) { result.physicalSectionId_ = physicalSectionId_; } - if (((from_bitField0_ & 0x00000040) != 0)) { + if (((from_bitField0_ & 0x00000010) != 0)) { result.destinationCode_ = destinationCode_; } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.kilometer_ = kilometerBuilder_ == null + ? kilometer_ + : kilometerBuilder_.build(); + } } @java.lang.Override @@ -983,52 +830,19 @@ public final class DeviceInfoProto { } onChanged(); } - if (kilometerSystemBuilder_ == null) { - if (!other.kilometerSystem_.isEmpty()) { - if (kilometerSystem_.isEmpty()) { - kilometerSystem_ = other.kilometerSystem_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureKilometerSystemIsMutable(); - kilometerSystem_.addAll(other.kilometerSystem_); - } - onChanged(); - } - } else { - if (!other.kilometerSystem_.isEmpty()) { - if (kilometerSystemBuilder_.isEmpty()) { - kilometerSystemBuilder_.dispose(); - kilometerSystemBuilder_ = null; - kilometerSystem_ = other.kilometerSystem_; - bitField0_ = (bitField0_ & ~0x00000008); - kilometerSystemBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getKilometerSystemFieldBuilder() : null; - } else { - kilometerSystemBuilder_.addAllMessages(other.kilometerSystem_); - } - } - } - if (!other.convertKilometer_.isEmpty()) { - if (convertKilometer_.isEmpty()) { - convertKilometer_ = other.convertKilometer_; - bitField0_ = (bitField0_ & ~0x00000010); - } else { - ensureConvertKilometerIsMutable(); - convertKilometer_.addAll(other.convertKilometer_); - } - onChanged(); - } if (!other.getPhysicalSectionId().isEmpty()) { physicalSectionId_ = other.physicalSectionId_; - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000008; onChanged(); } if (!other.getDestinationCode().isEmpty()) { destinationCode_ = other.destinationCode_; - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000010; onChanged(); } + if (other.hasKilometer()) { + mergeKilometer(other.getKilometer()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1072,44 +886,22 @@ public final class DeviceInfoProto { break; } // case 26 case 34: { - club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem m = - input.readMessage( - club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.parser(), - extensionRegistry); - if (kilometerSystemBuilder_ == null) { - ensureKilometerSystemIsMutable(); - kilometerSystem_.add(m); - } else { - kilometerSystemBuilder_.addMessage(m); - } + physicalSectionId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; break; } // case 34 - case 40: { - long v = input.readInt64(); - ensureConvertKilometerIsMutable(); - convertKilometer_.addLong(v); - break; - } // case 40 case 42: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - ensureConvertKilometerIsMutable(); - while (input.getBytesUntilLimit() > 0) { - convertKilometer_.addLong(input.readInt64()); - } - input.popLimit(limit); + destinationCode_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; break; } // case 42 case 50: { - physicalSectionId_ = input.readStringRequireUtf8(); + input.readMessage( + getKilometerFieldBuilder().getBuilder(), + extensionRegistry); bitField0_ |= 0x00000020; break; } // case 50 - case 58: { - destinationCode_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000040; - break; - } // case 58 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -1438,434 +1230,13 @@ public final class DeviceInfoProto { return this; } - private java.util.List kilometerSystem_ = - java.util.Collections.emptyList(); - private void ensureKilometerSystemIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - kilometerSystem_ = new java.util.ArrayList(kilometerSystem_); - bitField0_ |= 0x00000008; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystemOrBuilder> kilometerSystemBuilder_; - - /** - *
-       * 公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - public java.util.List getKilometerSystemList() { - if (kilometerSystemBuilder_ == null) { - return java.util.Collections.unmodifiableList(kilometerSystem_); - } else { - return kilometerSystemBuilder_.getMessageList(); - } - } - /** - *
-       * 公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - public int getKilometerSystemCount() { - if (kilometerSystemBuilder_ == null) { - return kilometerSystem_.size(); - } else { - return kilometerSystemBuilder_.getCount(); - } - } - /** - *
-       * 公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - public club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem getKilometerSystem(int index) { - if (kilometerSystemBuilder_ == null) { - return kilometerSystem_.get(index); - } else { - return kilometerSystemBuilder_.getMessage(index); - } - } - /** - *
-       * 公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - public Builder setKilometerSystem( - int index, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem value) { - if (kilometerSystemBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureKilometerSystemIsMutable(); - kilometerSystem_.set(index, value); - onChanged(); - } else { - kilometerSystemBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-       * 公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - public Builder setKilometerSystem( - int index, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder builderForValue) { - if (kilometerSystemBuilder_ == null) { - ensureKilometerSystemIsMutable(); - kilometerSystem_.set(index, builderForValue.build()); - onChanged(); - } else { - kilometerSystemBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-       * 公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - public Builder addKilometerSystem(club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem value) { - if (kilometerSystemBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureKilometerSystemIsMutable(); - kilometerSystem_.add(value); - onChanged(); - } else { - kilometerSystemBuilder_.addMessage(value); - } - return this; - } - /** - *
-       * 公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - public Builder addKilometerSystem( - int index, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem value) { - if (kilometerSystemBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureKilometerSystemIsMutable(); - kilometerSystem_.add(index, value); - onChanged(); - } else { - kilometerSystemBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-       * 公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - public Builder addKilometerSystem( - club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder builderForValue) { - if (kilometerSystemBuilder_ == null) { - ensureKilometerSystemIsMutable(); - kilometerSystem_.add(builderForValue.build()); - onChanged(); - } else { - kilometerSystemBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-       * 公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - public Builder addKilometerSystem( - int index, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder builderForValue) { - if (kilometerSystemBuilder_ == null) { - ensureKilometerSystemIsMutable(); - kilometerSystem_.add(index, builderForValue.build()); - onChanged(); - } else { - kilometerSystemBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-       * 公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - public Builder addAllKilometerSystem( - java.lang.Iterable values) { - if (kilometerSystemBuilder_ == null) { - ensureKilometerSystemIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, kilometerSystem_); - onChanged(); - } else { - kilometerSystemBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-       * 公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - public Builder clearKilometerSystem() { - if (kilometerSystemBuilder_ == null) { - kilometerSystem_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - } else { - kilometerSystemBuilder_.clear(); - } - return this; - } - /** - *
-       * 公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - public Builder removeKilometerSystem(int index) { - if (kilometerSystemBuilder_ == null) { - ensureKilometerSystemIsMutable(); - kilometerSystem_.remove(index); - onChanged(); - } else { - kilometerSystemBuilder_.remove(index); - } - return this; - } - /** - *
-       * 公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - public club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder getKilometerSystemBuilder( - int index) { - return getKilometerSystemFieldBuilder().getBuilder(index); - } - /** - *
-       * 公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - public club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystemOrBuilder getKilometerSystemOrBuilder( - int index) { - if (kilometerSystemBuilder_ == null) { - return kilometerSystem_.get(index); } else { - return kilometerSystemBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-       * 公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - public java.util.List - getKilometerSystemOrBuilderList() { - if (kilometerSystemBuilder_ != null) { - return kilometerSystemBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(kilometerSystem_); - } - } - /** - *
-       * 公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - public club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder addKilometerSystemBuilder() { - return getKilometerSystemFieldBuilder().addBuilder( - club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.getDefaultInstance()); - } - /** - *
-       * 公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - public club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder addKilometerSystemBuilder( - int index) { - return getKilometerSystemFieldBuilder().addBuilder( - index, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.getDefaultInstance()); - } - /** - *
-       * 公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 4; - */ - public java.util.List - getKilometerSystemBuilderList() { - return getKilometerSystemFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystemOrBuilder> - getKilometerSystemFieldBuilder() { - if (kilometerSystemBuilder_ == null) { - kilometerSystemBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystemOrBuilder>( - kilometerSystem_, - ((bitField0_ & 0x00000008) != 0), - getParentForChildren(), - isClean()); - kilometerSystem_ = null; - } - return kilometerSystemBuilder_; - } - - private com.google.protobuf.Internal.LongList convertKilometer_ = emptyLongList(); - private void ensureConvertKilometerIsMutable() { - if (!((bitField0_ & 0x00000010) != 0)) { - convertKilometer_ = mutableCopy(convertKilometer_); - bitField0_ |= 0x00000010; - } - } - /** - *
-       * 转换后的公里标数字
-       * 
- * - * repeated int64 convertKilometer = 5; - * @return A list containing the convertKilometer. - */ - public java.util.List - getConvertKilometerList() { - return ((bitField0_ & 0x00000010) != 0) ? - java.util.Collections.unmodifiableList(convertKilometer_) : convertKilometer_; - } - /** - *
-       * 转换后的公里标数字
-       * 
- * - * repeated int64 convertKilometer = 5; - * @return The count of convertKilometer. - */ - public int getConvertKilometerCount() { - return convertKilometer_.size(); - } - /** - *
-       * 转换后的公里标数字
-       * 
- * - * repeated int64 convertKilometer = 5; - * @param index The index of the element to return. - * @return The convertKilometer at the given index. - */ - public long getConvertKilometer(int index) { - return convertKilometer_.getLong(index); - } - /** - *
-       * 转换后的公里标数字
-       * 
- * - * repeated int64 convertKilometer = 5; - * @param index The index to set the value at. - * @param value The convertKilometer to set. - * @return This builder for chaining. - */ - public Builder setConvertKilometer( - int index, long value) { - - ensureConvertKilometerIsMutable(); - convertKilometer_.setLong(index, value); - onChanged(); - return this; - } - /** - *
-       * 转换后的公里标数字
-       * 
- * - * repeated int64 convertKilometer = 5; - * @param value The convertKilometer to add. - * @return This builder for chaining. - */ - public Builder addConvertKilometer(long value) { - - ensureConvertKilometerIsMutable(); - convertKilometer_.addLong(value); - onChanged(); - return this; - } - /** - *
-       * 转换后的公里标数字
-       * 
- * - * repeated int64 convertKilometer = 5; - * @param values The convertKilometer to add. - * @return This builder for chaining. - */ - public Builder addAllConvertKilometer( - java.lang.Iterable values) { - ensureConvertKilometerIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, convertKilometer_); - onChanged(); - return this; - } - /** - *
-       * 转换后的公里标数字
-       * 
- * - * repeated int64 convertKilometer = 5; - * @return This builder for chaining. - */ - public Builder clearConvertKilometer() { - convertKilometer_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000010); - onChanged(); - return this; - } - private java.lang.Object physicalSectionId_ = ""; /** *
        * 物理区段Id
        * 
* - * string physicalSectionId = 6; + * string physicalSectionId = 4; * @return The physicalSectionId. */ public java.lang.String getPhysicalSectionId() { @@ -1885,7 +1256,7 @@ public final class DeviceInfoProto { * 物理区段Id * * - * string physicalSectionId = 6; + * string physicalSectionId = 4; * @return The bytes for physicalSectionId. */ public com.google.protobuf.ByteString @@ -1906,7 +1277,7 @@ public final class DeviceInfoProto { * 物理区段Id * * - * string physicalSectionId = 6; + * string physicalSectionId = 4; * @param value The physicalSectionId to set. * @return This builder for chaining. */ @@ -1914,7 +1285,7 @@ public final class DeviceInfoProto { java.lang.String value) { if (value == null) { throw new NullPointerException(); } physicalSectionId_ = value; - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1923,12 +1294,12 @@ public final class DeviceInfoProto { * 物理区段Id * * - * string physicalSectionId = 6; + * string physicalSectionId = 4; * @return This builder for chaining. */ public Builder clearPhysicalSectionId() { physicalSectionId_ = getDefaultInstance().getPhysicalSectionId(); - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } @@ -1937,7 +1308,7 @@ public final class DeviceInfoProto { * 物理区段Id * * - * string physicalSectionId = 6; + * string physicalSectionId = 4; * @param value The bytes for physicalSectionId to set. * @return This builder for chaining. */ @@ -1946,7 +1317,7 @@ public final class DeviceInfoProto { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); physicalSectionId_ = value; - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1957,7 +1328,7 @@ public final class DeviceInfoProto { * 目的地码 * * - * string destinationCode = 7; + * string destinationCode = 5; * @return The destinationCode. */ public java.lang.String getDestinationCode() { @@ -1977,7 +1348,7 @@ public final class DeviceInfoProto { * 目的地码 * * - * string destinationCode = 7; + * string destinationCode = 5; * @return The bytes for destinationCode. */ public com.google.protobuf.ByteString @@ -1998,7 +1369,7 @@ public final class DeviceInfoProto { * 目的地码 * * - * string destinationCode = 7; + * string destinationCode = 5; * @param value The destinationCode to set. * @return This builder for chaining. */ @@ -2006,7 +1377,7 @@ public final class DeviceInfoProto { java.lang.String value) { if (value == null) { throw new NullPointerException(); } destinationCode_ = value; - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -2015,12 +1386,12 @@ public final class DeviceInfoProto { * 目的地码 * * - * string destinationCode = 7; + * string destinationCode = 5; * @return This builder for chaining. */ public Builder clearDestinationCode() { destinationCode_ = getDefaultInstance().getDestinationCode(); - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } @@ -2029,7 +1400,7 @@ public final class DeviceInfoProto { * 目的地码 * * - * string destinationCode = 7; + * string destinationCode = 5; * @param value The bytes for destinationCode to set. * @return This builder for chaining. */ @@ -2038,10 +1409,165 @@ public final class DeviceInfoProto { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); destinationCode_ = value; - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000010; onChanged(); return this; } + + private club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer kilometer_; + private com.google.protobuf.SingleFieldBuilderV3< + club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer, club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.Builder, club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometerOrBuilder> kilometerBuilder_; + /** + *
+       * 公里标信息
+       * 
+ * + * .state.DeviceKilometer kilometer = 6; + * @return Whether the kilometer field is set. + */ + public boolean hasKilometer() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + *
+       * 公里标信息
+       * 
+ * + * .state.DeviceKilometer kilometer = 6; + * @return The kilometer. + */ + public club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer getKilometer() { + if (kilometerBuilder_ == null) { + return kilometer_ == null ? club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.getDefaultInstance() : kilometer_; + } else { + return kilometerBuilder_.getMessage(); + } + } + /** + *
+       * 公里标信息
+       * 
+ * + * .state.DeviceKilometer kilometer = 6; + */ + public Builder setKilometer(club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer value) { + if (kilometerBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kilometer_ = value; + } else { + kilometerBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
+       * 公里标信息
+       * 
+ * + * .state.DeviceKilometer kilometer = 6; + */ + public Builder setKilometer( + club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.Builder builderForValue) { + if (kilometerBuilder_ == null) { + kilometer_ = builderForValue.build(); + } else { + kilometerBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
+       * 公里标信息
+       * 
+ * + * .state.DeviceKilometer kilometer = 6; + */ + public Builder mergeKilometer(club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer value) { + if (kilometerBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + kilometer_ != null && + kilometer_ != club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.getDefaultInstance()) { + getKilometerBuilder().mergeFrom(value); + } else { + kilometer_ = value; + } + } else { + kilometerBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
+       * 公里标信息
+       * 
+ * + * .state.DeviceKilometer kilometer = 6; + */ + public Builder clearKilometer() { + bitField0_ = (bitField0_ & ~0x00000020); + kilometer_ = null; + if (kilometerBuilder_ != null) { + kilometerBuilder_.dispose(); + kilometerBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+       * 公里标信息
+       * 
+ * + * .state.DeviceKilometer kilometer = 6; + */ + public club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.Builder getKilometerBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getKilometerFieldBuilder().getBuilder(); + } + /** + *
+       * 公里标信息
+       * 
+ * + * .state.DeviceKilometer kilometer = 6; + */ + public club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometerOrBuilder getKilometerOrBuilder() { + if (kilometerBuilder_ != null) { + return kilometerBuilder_.getMessageOrBuilder(); + } else { + return kilometer_ == null ? + club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.getDefaultInstance() : kilometer_; + } + } + /** + *
+       * 公里标信息
+       * 
+ * + * .state.DeviceKilometer kilometer = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer, club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.Builder, club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometerOrBuilder> + getKilometerFieldBuilder() { + if (kilometerBuilder_ == null) { + kilometerBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer, club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.Builder, club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometerOrBuilder>( + getKilometer(), + getParentForChildren(), + isClean()); + kilometer_ = null; + } + return kilometerBuilder_; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -2136,76 +1662,30 @@ public final class DeviceInfoProto { /** *
-     * 关联道岔的公里标
+     * 公里标信息
      * 
* - * repeated .graphicData.KilometerSystem kilometerSystem = 3; + * .state.DeviceKilometer kilometer = 3; + * @return Whether the kilometer field is set. */ - java.util.List - getKilometerSystemList(); + boolean hasKilometer(); /** *
-     * 关联道岔的公里标
+     * 公里标信息
      * 
* - * repeated .graphicData.KilometerSystem kilometerSystem = 3; + * .state.DeviceKilometer kilometer = 3; + * @return The kilometer. */ - club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem getKilometerSystem(int index); + club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer getKilometer(); /** *
-     * 关联道岔的公里标
+     * 公里标信息
      * 
* - * repeated .graphicData.KilometerSystem kilometerSystem = 3; + * .state.DeviceKilometer kilometer = 3; */ - int getKilometerSystemCount(); - /** - *
-     * 关联道岔的公里标
-     * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 3; - */ - java.util.List - getKilometerSystemOrBuilderList(); - /** - *
-     * 关联道岔的公里标
-     * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 3; - */ - club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystemOrBuilder getKilometerSystemOrBuilder( - int index); - - /** - *
-     * 转换后的公里标数字
-     * 
- * - * repeated int64 convertKilometer = 4; - * @return A list containing the convertKilometer. - */ - java.util.List getConvertKilometerList(); - /** - *
-     * 转换后的公里标数字
-     * 
- * - * repeated int64 convertKilometer = 4; - * @return The count of convertKilometer. - */ - int getConvertKilometerCount(); - /** - *
-     * 转换后的公里标数字
-     * 
- * - * repeated int64 convertKilometer = 4; - * @param index The index of the element to return. - * @return The convertKilometer at the given index. - */ - long getConvertKilometer(int index); + club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometerOrBuilder getKilometerOrBuilder(); } /** *
@@ -2226,8 +1706,6 @@ public final class DeviceInfoProto {
     private Turnout() {
       id_ = "";
       code_ = "";
-      kilometerSystem_ = java.util.Collections.emptyList();
-      convertKilometer_ = emptyLongList();
     }
 
     @java.lang.Override
@@ -2328,107 +1806,43 @@ public final class DeviceInfoProto {
       }
     }
 
-    public static final int KILOMETERSYSTEM_FIELD_NUMBER = 3;
-    @SuppressWarnings("serial")
-    private java.util.List kilometerSystem_;
+    public static final int KILOMETER_FIELD_NUMBER = 3;
+    private club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer kilometer_;
     /**
      * 
-     * 关联道岔的公里标
+     * 公里标信息
      * 
* - * repeated .graphicData.KilometerSystem kilometerSystem = 3; + * .state.DeviceKilometer kilometer = 3; + * @return Whether the kilometer field is set. */ @java.lang.Override - public java.util.List getKilometerSystemList() { - return kilometerSystem_; + public boolean hasKilometer() { + return kilometer_ != null; } /** *
-     * 关联道岔的公里标
+     * 公里标信息
      * 
* - * repeated .graphicData.KilometerSystem kilometerSystem = 3; + * .state.DeviceKilometer kilometer = 3; + * @return The kilometer. */ @java.lang.Override - public java.util.List - getKilometerSystemOrBuilderList() { - return kilometerSystem_; + public club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer getKilometer() { + return kilometer_ == null ? club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.getDefaultInstance() : kilometer_; } /** *
-     * 关联道岔的公里标
+     * 公里标信息
      * 
* - * repeated .graphicData.KilometerSystem kilometerSystem = 3; + * .state.DeviceKilometer kilometer = 3; */ @java.lang.Override - public int getKilometerSystemCount() { - return kilometerSystem_.size(); + public club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometerOrBuilder getKilometerOrBuilder() { + return kilometer_ == null ? club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.getDefaultInstance() : kilometer_; } - /** - *
-     * 关联道岔的公里标
-     * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 3; - */ - @java.lang.Override - public club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem getKilometerSystem(int index) { - return kilometerSystem_.get(index); - } - /** - *
-     * 关联道岔的公里标
-     * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 3; - */ - @java.lang.Override - public club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystemOrBuilder getKilometerSystemOrBuilder( - int index) { - return kilometerSystem_.get(index); - } - - public static final int CONVERTKILOMETER_FIELD_NUMBER = 4; - @SuppressWarnings("serial") - private com.google.protobuf.Internal.LongList convertKilometer_; - /** - *
-     * 转换后的公里标数字
-     * 
- * - * repeated int64 convertKilometer = 4; - * @return A list containing the convertKilometer. - */ - @java.lang.Override - public java.util.List - getConvertKilometerList() { - return convertKilometer_; - } - /** - *
-     * 转换后的公里标数字
-     * 
- * - * repeated int64 convertKilometer = 4; - * @return The count of convertKilometer. - */ - public int getConvertKilometerCount() { - return convertKilometer_.size(); - } - /** - *
-     * 转换后的公里标数字
-     * 
- * - * repeated int64 convertKilometer = 4; - * @param index The index of the element to return. - * @return The convertKilometer at the given index. - */ - public long getConvertKilometer(int index) { - return convertKilometer_.getLong(index); - } - private int convertKilometerMemoizedSerializedSize = -1; private byte memoizedIsInitialized = -1; @java.lang.Override @@ -2444,22 +1858,14 @@ public final class DeviceInfoProto { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(code_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, code_); } - for (int i = 0; i < kilometerSystem_.size(); i++) { - output.writeMessage(3, kilometerSystem_.get(i)); - } - if (getConvertKilometerList().size() > 0) { - output.writeUInt32NoTag(34); - output.writeUInt32NoTag(convertKilometerMemoizedSerializedSize); - } - for (int i = 0; i < convertKilometer_.size(); i++) { - output.writeInt64NoTag(convertKilometer_.getLong(i)); + if (kilometer_ != null) { + output.writeMessage(3, getKilometer()); } getUnknownFields().writeTo(output); } @@ -2476,23 +1882,9 @@ public final class DeviceInfoProto { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(code_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, code_); } - for (int i = 0; i < kilometerSystem_.size(); i++) { + if (kilometer_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, kilometerSystem_.get(i)); - } - { - int dataSize = 0; - for (int i = 0; i < convertKilometer_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt64SizeNoTag(convertKilometer_.getLong(i)); - } - size += dataSize; - if (!getConvertKilometerList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - convertKilometerMemoizedSerializedSize = dataSize; + .computeMessageSize(3, getKilometer()); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -2513,10 +1905,11 @@ public final class DeviceInfoProto { .equals(other.getId())) return false; if (!getCode() .equals(other.getCode())) return false; - if (!getKilometerSystemList() - .equals(other.getKilometerSystemList())) return false; - if (!getConvertKilometerList() - .equals(other.getConvertKilometerList())) return false; + if (hasKilometer() != other.hasKilometer()) return false; + if (hasKilometer()) { + if (!getKilometer() + .equals(other.getKilometer())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -2532,13 +1925,9 @@ public final class DeviceInfoProto { hash = (53 * hash) + getId().hashCode(); hash = (37 * hash) + CODE_FIELD_NUMBER; hash = (53 * hash) + getCode().hashCode(); - if (getKilometerSystemCount() > 0) { - hash = (37 * hash) + KILOMETERSYSTEM_FIELD_NUMBER; - hash = (53 * hash) + getKilometerSystemList().hashCode(); - } - if (getConvertKilometerCount() > 0) { - hash = (37 * hash) + CONVERTKILOMETER_FIELD_NUMBER; - hash = (53 * hash) + getConvertKilometerList().hashCode(); + if (hasKilometer()) { + hash = (37 * hash) + KILOMETER_FIELD_NUMBER; + hash = (53 * hash) + getKilometer().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; @@ -2677,14 +2066,11 @@ public final class DeviceInfoProto { bitField0_ = 0; id_ = ""; code_ = ""; - if (kilometerSystemBuilder_ == null) { - kilometerSystem_ = java.util.Collections.emptyList(); - } else { - kilometerSystem_ = null; - kilometerSystemBuilder_.clear(); + kilometer_ = null; + if (kilometerBuilder_ != null) { + kilometerBuilder_.dispose(); + kilometerBuilder_ = null; } - bitField0_ = (bitField0_ & ~0x00000004); - convertKilometer_ = emptyLongList(); return this; } @@ -2711,29 +2097,11 @@ public final class DeviceInfoProto { @java.lang.Override public club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout buildPartial() { club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout result = new club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout(this); - buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartialRepeatedFields(club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout result) { - if (kilometerSystemBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - kilometerSystem_ = java.util.Collections.unmodifiableList(kilometerSystem_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.kilometerSystem_ = kilometerSystem_; - } else { - result.kilometerSystem_ = kilometerSystemBuilder_.build(); - } - if (((bitField0_ & 0x00000008) != 0)) { - convertKilometer_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.convertKilometer_ = convertKilometer_; - } - private void buildPartial0(club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { @@ -2742,6 +2110,11 @@ public final class DeviceInfoProto { if (((from_bitField0_ & 0x00000002) != 0)) { result.code_ = code_; } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.kilometer_ = kilometerBuilder_ == null + ? kilometer_ + : kilometerBuilder_.build(); + } } @java.lang.Override @@ -2766,41 +2139,8 @@ public final class DeviceInfoProto { bitField0_ |= 0x00000002; onChanged(); } - if (kilometerSystemBuilder_ == null) { - if (!other.kilometerSystem_.isEmpty()) { - if (kilometerSystem_.isEmpty()) { - kilometerSystem_ = other.kilometerSystem_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureKilometerSystemIsMutable(); - kilometerSystem_.addAll(other.kilometerSystem_); - } - onChanged(); - } - } else { - if (!other.kilometerSystem_.isEmpty()) { - if (kilometerSystemBuilder_.isEmpty()) { - kilometerSystemBuilder_.dispose(); - kilometerSystemBuilder_ = null; - kilometerSystem_ = other.kilometerSystem_; - bitField0_ = (bitField0_ & ~0x00000004); - kilometerSystemBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getKilometerSystemFieldBuilder() : null; - } else { - kilometerSystemBuilder_.addAllMessages(other.kilometerSystem_); - } - } - } - if (!other.convertKilometer_.isEmpty()) { - if (convertKilometer_.isEmpty()) { - convertKilometer_ = other.convertKilometer_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureConvertKilometerIsMutable(); - convertKilometer_.addAll(other.convertKilometer_); - } - onChanged(); + if (other.hasKilometer()) { + mergeKilometer(other.getKilometer()); } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); @@ -2839,34 +2179,12 @@ public final class DeviceInfoProto { break; } // case 18 case 26: { - club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem m = - input.readMessage( - club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.parser(), - extensionRegistry); - if (kilometerSystemBuilder_ == null) { - ensureKilometerSystemIsMutable(); - kilometerSystem_.add(m); - } else { - kilometerSystemBuilder_.addMessage(m); - } + input.readMessage( + getKilometerFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; break; } // case 26 - case 32: { - long v = input.readInt64(); - ensureConvertKilometerIsMutable(); - convertKilometer_.addLong(v); - break; - } // case 32 - case 34: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - ensureConvertKilometerIsMutable(); - while (input.getBytesUntilLimit() > 0) { - convertKilometer_.addLong(input.readInt64()); - } - input.popLimit(limit); - break; - } // case 34 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -3028,425 +2346,159 @@ public final class DeviceInfoProto { return this; } - private java.util.List kilometerSystem_ = - java.util.Collections.emptyList(); - private void ensureKilometerSystemIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - kilometerSystem_ = new java.util.ArrayList(kilometerSystem_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystemOrBuilder> kilometerSystemBuilder_; - + private club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer kilometer_; + private com.google.protobuf.SingleFieldBuilderV3< + club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer, club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.Builder, club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometerOrBuilder> kilometerBuilder_; /** *
-       * 关联道岔的公里标
+       * 公里标信息
        * 
* - * repeated .graphicData.KilometerSystem kilometerSystem = 3; + * .state.DeviceKilometer kilometer = 3; + * @return Whether the kilometer field is set. */ - public java.util.List getKilometerSystemList() { - if (kilometerSystemBuilder_ == null) { - return java.util.Collections.unmodifiableList(kilometerSystem_); + public boolean hasKilometer() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+       * 公里标信息
+       * 
+ * + * .state.DeviceKilometer kilometer = 3; + * @return The kilometer. + */ + public club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer getKilometer() { + if (kilometerBuilder_ == null) { + return kilometer_ == null ? club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.getDefaultInstance() : kilometer_; } else { - return kilometerSystemBuilder_.getMessageList(); + return kilometerBuilder_.getMessage(); } } /** *
-       * 关联道岔的公里标
+       * 公里标信息
        * 
* - * repeated .graphicData.KilometerSystem kilometerSystem = 3; + * .state.DeviceKilometer kilometer = 3; */ - public int getKilometerSystemCount() { - if (kilometerSystemBuilder_ == null) { - return kilometerSystem_.size(); - } else { - return kilometerSystemBuilder_.getCount(); - } - } - /** - *
-       * 关联道岔的公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 3; - */ - public club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem getKilometerSystem(int index) { - if (kilometerSystemBuilder_ == null) { - return kilometerSystem_.get(index); - } else { - return kilometerSystemBuilder_.getMessage(index); - } - } - /** - *
-       * 关联道岔的公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 3; - */ - public Builder setKilometerSystem( - int index, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem value) { - if (kilometerSystemBuilder_ == null) { + public Builder setKilometer(club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer value) { + if (kilometerBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureKilometerSystemIsMutable(); - kilometerSystem_.set(index, value); - onChanged(); + kilometer_ = value; } else { - kilometerSystemBuilder_.setMessage(index, value); + kilometerBuilder_.setMessage(value); } + bitField0_ |= 0x00000004; + onChanged(); return this; } /** *
-       * 关联道岔的公里标
+       * 公里标信息
        * 
* - * repeated .graphicData.KilometerSystem kilometerSystem = 3; + * .state.DeviceKilometer kilometer = 3; */ - public Builder setKilometerSystem( - int index, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder builderForValue) { - if (kilometerSystemBuilder_ == null) { - ensureKilometerSystemIsMutable(); - kilometerSystem_.set(index, builderForValue.build()); - onChanged(); + public Builder setKilometer( + club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.Builder builderForValue) { + if (kilometerBuilder_ == null) { + kilometer_ = builderForValue.build(); } else { - kilometerSystemBuilder_.setMessage(index, builderForValue.build()); + kilometerBuilder_.setMessage(builderForValue.build()); } + bitField0_ |= 0x00000004; + onChanged(); return this; } /** *
-       * 关联道岔的公里标
+       * 公里标信息
        * 
* - * repeated .graphicData.KilometerSystem kilometerSystem = 3; + * .state.DeviceKilometer kilometer = 3; */ - public Builder addKilometerSystem(club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem value) { - if (kilometerSystemBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + public Builder mergeKilometer(club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer value) { + if (kilometerBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + kilometer_ != null && + kilometer_ != club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.getDefaultInstance()) { + getKilometerBuilder().mergeFrom(value); + } else { + kilometer_ = value; } - ensureKilometerSystemIsMutable(); - kilometerSystem_.add(value); - onChanged(); } else { - kilometerSystemBuilder_.addMessage(value); + kilometerBuilder_.mergeFrom(value); } + bitField0_ |= 0x00000004; + onChanged(); return this; } /** *
-       * 关联道岔的公里标
+       * 公里标信息
        * 
* - * repeated .graphicData.KilometerSystem kilometerSystem = 3; + * .state.DeviceKilometer kilometer = 3; */ - public Builder addKilometerSystem( - int index, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem value) { - if (kilometerSystemBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureKilometerSystemIsMutable(); - kilometerSystem_.add(index, value); - onChanged(); - } else { - kilometerSystemBuilder_.addMessage(index, value); + public Builder clearKilometer() { + bitField0_ = (bitField0_ & ~0x00000004); + kilometer_ = null; + if (kilometerBuilder_ != null) { + kilometerBuilder_.dispose(); + kilometerBuilder_ = null; } + onChanged(); return this; } /** *
-       * 关联道岔的公里标
+       * 公里标信息
        * 
* - * repeated .graphicData.KilometerSystem kilometerSystem = 3; + * .state.DeviceKilometer kilometer = 3; */ - public Builder addKilometerSystem( - club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder builderForValue) { - if (kilometerSystemBuilder_ == null) { - ensureKilometerSystemIsMutable(); - kilometerSystem_.add(builderForValue.build()); - onChanged(); + public club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.Builder getKilometerBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getKilometerFieldBuilder().getBuilder(); + } + /** + *
+       * 公里标信息
+       * 
+ * + * .state.DeviceKilometer kilometer = 3; + */ + public club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometerOrBuilder getKilometerOrBuilder() { + if (kilometerBuilder_ != null) { + return kilometerBuilder_.getMessageOrBuilder(); } else { - kilometerSystemBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-       * 关联道岔的公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 3; - */ - public Builder addKilometerSystem( - int index, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder builderForValue) { - if (kilometerSystemBuilder_ == null) { - ensureKilometerSystemIsMutable(); - kilometerSystem_.add(index, builderForValue.build()); - onChanged(); - } else { - kilometerSystemBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-       * 关联道岔的公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 3; - */ - public Builder addAllKilometerSystem( - java.lang.Iterable values) { - if (kilometerSystemBuilder_ == null) { - ensureKilometerSystemIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, kilometerSystem_); - onChanged(); - } else { - kilometerSystemBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-       * 关联道岔的公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 3; - */ - public Builder clearKilometerSystem() { - if (kilometerSystemBuilder_ == null) { - kilometerSystem_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - kilometerSystemBuilder_.clear(); - } - return this; - } - /** - *
-       * 关联道岔的公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 3; - */ - public Builder removeKilometerSystem(int index) { - if (kilometerSystemBuilder_ == null) { - ensureKilometerSystemIsMutable(); - kilometerSystem_.remove(index); - onChanged(); - } else { - kilometerSystemBuilder_.remove(index); - } - return this; - } - /** - *
-       * 关联道岔的公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 3; - */ - public club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder getKilometerSystemBuilder( - int index) { - return getKilometerSystemFieldBuilder().getBuilder(index); - } - /** - *
-       * 关联道岔的公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 3; - */ - public club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystemOrBuilder getKilometerSystemOrBuilder( - int index) { - if (kilometerSystemBuilder_ == null) { - return kilometerSystem_.get(index); } else { - return kilometerSystemBuilder_.getMessageOrBuilder(index); + return kilometer_ == null ? + club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.getDefaultInstance() : kilometer_; } } /** *
-       * 关联道岔的公里标
+       * 公里标信息
        * 
* - * repeated .graphicData.KilometerSystem kilometerSystem = 3; + * .state.DeviceKilometer kilometer = 3; */ - public java.util.List - getKilometerSystemOrBuilderList() { - if (kilometerSystemBuilder_ != null) { - return kilometerSystemBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(kilometerSystem_); - } - } - /** - *
-       * 关联道岔的公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 3; - */ - public club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder addKilometerSystemBuilder() { - return getKilometerSystemFieldBuilder().addBuilder( - club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.getDefaultInstance()); - } - /** - *
-       * 关联道岔的公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 3; - */ - public club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder addKilometerSystemBuilder( - int index) { - return getKilometerSystemFieldBuilder().addBuilder( - index, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.getDefaultInstance()); - } - /** - *
-       * 关联道岔的公里标
-       * 
- * - * repeated .graphicData.KilometerSystem kilometerSystem = 3; - */ - public java.util.List - getKilometerSystemBuilderList() { - return getKilometerSystemFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystemOrBuilder> - getKilometerSystemFieldBuilder() { - if (kilometerSystemBuilder_ == null) { - kilometerSystemBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystemOrBuilder>( - kilometerSystem_, - ((bitField0_ & 0x00000004) != 0), + private com.google.protobuf.SingleFieldBuilderV3< + club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer, club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.Builder, club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometerOrBuilder> + getKilometerFieldBuilder() { + if (kilometerBuilder_ == null) { + kilometerBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer, club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.Builder, club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometerOrBuilder>( + getKilometer(), getParentForChildren(), isClean()); - kilometerSystem_ = null; + kilometer_ = null; } - return kilometerSystemBuilder_; - } - - private com.google.protobuf.Internal.LongList convertKilometer_ = emptyLongList(); - private void ensureConvertKilometerIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - convertKilometer_ = mutableCopy(convertKilometer_); - bitField0_ |= 0x00000008; - } - } - /** - *
-       * 转换后的公里标数字
-       * 
- * - * repeated int64 convertKilometer = 4; - * @return A list containing the convertKilometer. - */ - public java.util.List - getConvertKilometerList() { - return ((bitField0_ & 0x00000008) != 0) ? - java.util.Collections.unmodifiableList(convertKilometer_) : convertKilometer_; - } - /** - *
-       * 转换后的公里标数字
-       * 
- * - * repeated int64 convertKilometer = 4; - * @return The count of convertKilometer. - */ - public int getConvertKilometerCount() { - return convertKilometer_.size(); - } - /** - *
-       * 转换后的公里标数字
-       * 
- * - * repeated int64 convertKilometer = 4; - * @param index The index of the element to return. - * @return The convertKilometer at the given index. - */ - public long getConvertKilometer(int index) { - return convertKilometer_.getLong(index); - } - /** - *
-       * 转换后的公里标数字
-       * 
- * - * repeated int64 convertKilometer = 4; - * @param index The index to set the value at. - * @param value The convertKilometer to set. - * @return This builder for chaining. - */ - public Builder setConvertKilometer( - int index, long value) { - - ensureConvertKilometerIsMutable(); - convertKilometer_.setLong(index, value); - onChanged(); - return this; - } - /** - *
-       * 转换后的公里标数字
-       * 
- * - * repeated int64 convertKilometer = 4; - * @param value The convertKilometer to add. - * @return This builder for chaining. - */ - public Builder addConvertKilometer(long value) { - - ensureConvertKilometerIsMutable(); - convertKilometer_.addLong(value); - onChanged(); - return this; - } - /** - *
-       * 转换后的公里标数字
-       * 
- * - * repeated int64 convertKilometer = 4; - * @param values The convertKilometer to add. - * @return This builder for chaining. - */ - public Builder addAllConvertKilometer( - java.lang.Iterable values) { - ensureConvertKilometerIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, convertKilometer_); - onChanged(); - return this; - } - /** - *
-       * 转换后的公里标数字
-       * 
- * - * repeated int64 convertKilometer = 4; - * @return This builder for chaining. - */ - public Builder clearConvertKilometer() { - convertKilometer_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - return this; + return kilometerBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -3512,6 +2564,910 @@ public final class DeviceInfoProto { } + public interface DeviceKilometerOrBuilder extends + // @@protoc_insertion_point(interface_extends:state.DeviceKilometer) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 minKilometer = 1; + * @return The minKilometer. + */ + long getMinKilometer(); + + /** + * int64 maxKilometer = 2; + * @return The maxKilometer. + */ + long getMaxKilometer(); + + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + java.util.List + getKilometerSystemList(); + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem getKilometerSystem(int index); + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + int getKilometerSystemCount(); + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + java.util.List + getKilometerSystemOrBuilderList(); + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystemOrBuilder getKilometerSystemOrBuilder( + int index); + } + /** + *
+   * 公共属性
+   * 
+ * + * Protobuf type {@code state.DeviceKilometer} + */ + public static final class DeviceKilometer extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:state.DeviceKilometer) + DeviceKilometerOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeviceKilometer.newBuilder() to construct. + private DeviceKilometer(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeviceKilometer() { + kilometerSystem_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeviceKilometer(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return club.joylink.xiannccda.dto.protos.DeviceInfoProto.internal_static_state_DeviceKilometer_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return club.joylink.xiannccda.dto.protos.DeviceInfoProto.internal_static_state_DeviceKilometer_fieldAccessorTable + .ensureFieldAccessorsInitialized( + club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.class, club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.Builder.class); + } + + public static final int MINKILOMETER_FIELD_NUMBER = 1; + private long minKilometer_ = 0L; + /** + * int64 minKilometer = 1; + * @return The minKilometer. + */ + @java.lang.Override + public long getMinKilometer() { + return minKilometer_; + } + + public static final int MAXKILOMETER_FIELD_NUMBER = 2; + private long maxKilometer_ = 0L; + /** + * int64 maxKilometer = 2; + * @return The maxKilometer. + */ + @java.lang.Override + public long getMaxKilometer() { + return maxKilometer_; + } + + public static final int KILOMETERSYSTEM_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private java.util.List kilometerSystem_; + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + @java.lang.Override + public java.util.List getKilometerSystemList() { + return kilometerSystem_; + } + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + @java.lang.Override + public java.util.List + getKilometerSystemOrBuilderList() { + return kilometerSystem_; + } + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + @java.lang.Override + public int getKilometerSystemCount() { + return kilometerSystem_.size(); + } + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + @java.lang.Override + public club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem getKilometerSystem(int index) { + return kilometerSystem_.get(index); + } + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + @java.lang.Override + public club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystemOrBuilder getKilometerSystemOrBuilder( + int index) { + return kilometerSystem_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (minKilometer_ != 0L) { + output.writeInt64(1, minKilometer_); + } + if (maxKilometer_ != 0L) { + output.writeInt64(2, maxKilometer_); + } + for (int i = 0; i < kilometerSystem_.size(); i++) { + output.writeMessage(3, kilometerSystem_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (minKilometer_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, minKilometer_); + } + if (maxKilometer_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, maxKilometer_); + } + for (int i = 0; i < kilometerSystem_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, kilometerSystem_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer)) { + return super.equals(obj); + } + club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer other = (club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer) obj; + + if (getMinKilometer() + != other.getMinKilometer()) return false; + if (getMaxKilometer() + != other.getMaxKilometer()) return false; + if (!getKilometerSystemList() + .equals(other.getKilometerSystemList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MINKILOMETER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMinKilometer()); + hash = (37 * hash) + MAXKILOMETER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMaxKilometer()); + if (getKilometerSystemCount() > 0) { + hash = (37 * hash) + KILOMETERSYSTEM_FIELD_NUMBER; + hash = (53 * hash) + getKilometerSystemList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * 公共属性
+     * 
+ * + * Protobuf type {@code state.DeviceKilometer} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:state.DeviceKilometer) + club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return club.joylink.xiannccda.dto.protos.DeviceInfoProto.internal_static_state_DeviceKilometer_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return club.joylink.xiannccda.dto.protos.DeviceInfoProto.internal_static_state_DeviceKilometer_fieldAccessorTable + .ensureFieldAccessorsInitialized( + club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.class, club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.Builder.class); + } + + // Construct using club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + minKilometer_ = 0L; + maxKilometer_ = 0L; + if (kilometerSystemBuilder_ == null) { + kilometerSystem_ = java.util.Collections.emptyList(); + } else { + kilometerSystem_ = null; + kilometerSystemBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return club.joylink.xiannccda.dto.protos.DeviceInfoProto.internal_static_state_DeviceKilometer_descriptor; + } + + @java.lang.Override + public club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer getDefaultInstanceForType() { + return club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.getDefaultInstance(); + } + + @java.lang.Override + public club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer build() { + club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer buildPartial() { + club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer result = new club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer result) { + if (kilometerSystemBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + kilometerSystem_ = java.util.Collections.unmodifiableList(kilometerSystem_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.kilometerSystem_ = kilometerSystem_; + } else { + result.kilometerSystem_ = kilometerSystemBuilder_.build(); + } + } + + private void buildPartial0(club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.minKilometer_ = minKilometer_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.maxKilometer_ = maxKilometer_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer) { + return mergeFrom((club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer other) { + if (other == club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer.getDefaultInstance()) return this; + if (other.getMinKilometer() != 0L) { + setMinKilometer(other.getMinKilometer()); + } + if (other.getMaxKilometer() != 0L) { + setMaxKilometer(other.getMaxKilometer()); + } + if (kilometerSystemBuilder_ == null) { + if (!other.kilometerSystem_.isEmpty()) { + if (kilometerSystem_.isEmpty()) { + kilometerSystem_ = other.kilometerSystem_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureKilometerSystemIsMutable(); + kilometerSystem_.addAll(other.kilometerSystem_); + } + onChanged(); + } + } else { + if (!other.kilometerSystem_.isEmpty()) { + if (kilometerSystemBuilder_.isEmpty()) { + kilometerSystemBuilder_.dispose(); + kilometerSystemBuilder_ = null; + kilometerSystem_ = other.kilometerSystem_; + bitField0_ = (bitField0_ & ~0x00000004); + kilometerSystemBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getKilometerSystemFieldBuilder() : null; + } else { + kilometerSystemBuilder_.addAllMessages(other.kilometerSystem_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + minKilometer_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + maxKilometer_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: { + club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem m = + input.readMessage( + club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.parser(), + extensionRegistry); + if (kilometerSystemBuilder_ == null) { + ensureKilometerSystemIsMutable(); + kilometerSystem_.add(m); + } else { + kilometerSystemBuilder_.addMessage(m); + } + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long minKilometer_ ; + /** + * int64 minKilometer = 1; + * @return The minKilometer. + */ + @java.lang.Override + public long getMinKilometer() { + return minKilometer_; + } + /** + * int64 minKilometer = 1; + * @param value The minKilometer to set. + * @return This builder for chaining. + */ + public Builder setMinKilometer(long value) { + + minKilometer_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 minKilometer = 1; + * @return This builder for chaining. + */ + public Builder clearMinKilometer() { + bitField0_ = (bitField0_ & ~0x00000001); + minKilometer_ = 0L; + onChanged(); + return this; + } + + private long maxKilometer_ ; + /** + * int64 maxKilometer = 2; + * @return The maxKilometer. + */ + @java.lang.Override + public long getMaxKilometer() { + return maxKilometer_; + } + /** + * int64 maxKilometer = 2; + * @param value The maxKilometer to set. + * @return This builder for chaining. + */ + public Builder setMaxKilometer(long value) { + + maxKilometer_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int64 maxKilometer = 2; + * @return This builder for chaining. + */ + public Builder clearMaxKilometer() { + bitField0_ = (bitField0_ & ~0x00000002); + maxKilometer_ = 0L; + onChanged(); + return this; + } + + private java.util.List kilometerSystem_ = + java.util.Collections.emptyList(); + private void ensureKilometerSystemIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + kilometerSystem_ = new java.util.ArrayList(kilometerSystem_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystemOrBuilder> kilometerSystemBuilder_; + + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + public java.util.List getKilometerSystemList() { + if (kilometerSystemBuilder_ == null) { + return java.util.Collections.unmodifiableList(kilometerSystem_); + } else { + return kilometerSystemBuilder_.getMessageList(); + } + } + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + public int getKilometerSystemCount() { + if (kilometerSystemBuilder_ == null) { + return kilometerSystem_.size(); + } else { + return kilometerSystemBuilder_.getCount(); + } + } + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + public club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem getKilometerSystem(int index) { + if (kilometerSystemBuilder_ == null) { + return kilometerSystem_.get(index); + } else { + return kilometerSystemBuilder_.getMessage(index); + } + } + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + public Builder setKilometerSystem( + int index, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem value) { + if (kilometerSystemBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKilometerSystemIsMutable(); + kilometerSystem_.set(index, value); + onChanged(); + } else { + kilometerSystemBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + public Builder setKilometerSystem( + int index, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder builderForValue) { + if (kilometerSystemBuilder_ == null) { + ensureKilometerSystemIsMutable(); + kilometerSystem_.set(index, builderForValue.build()); + onChanged(); + } else { + kilometerSystemBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + public Builder addKilometerSystem(club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem value) { + if (kilometerSystemBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKilometerSystemIsMutable(); + kilometerSystem_.add(value); + onChanged(); + } else { + kilometerSystemBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + public Builder addKilometerSystem( + int index, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem value) { + if (kilometerSystemBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKilometerSystemIsMutable(); + kilometerSystem_.add(index, value); + onChanged(); + } else { + kilometerSystemBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + public Builder addKilometerSystem( + club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder builderForValue) { + if (kilometerSystemBuilder_ == null) { + ensureKilometerSystemIsMutable(); + kilometerSystem_.add(builderForValue.build()); + onChanged(); + } else { + kilometerSystemBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + public Builder addKilometerSystem( + int index, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder builderForValue) { + if (kilometerSystemBuilder_ == null) { + ensureKilometerSystemIsMutable(); + kilometerSystem_.add(index, builderForValue.build()); + onChanged(); + } else { + kilometerSystemBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + public Builder addAllKilometerSystem( + java.lang.Iterable values) { + if (kilometerSystemBuilder_ == null) { + ensureKilometerSystemIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, kilometerSystem_); + onChanged(); + } else { + kilometerSystemBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + public Builder clearKilometerSystem() { + if (kilometerSystemBuilder_ == null) { + kilometerSystem_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + kilometerSystemBuilder_.clear(); + } + return this; + } + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + public Builder removeKilometerSystem(int index) { + if (kilometerSystemBuilder_ == null) { + ensureKilometerSystemIsMutable(); + kilometerSystem_.remove(index); + onChanged(); + } else { + kilometerSystemBuilder_.remove(index); + } + return this; + } + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + public club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder getKilometerSystemBuilder( + int index) { + return getKilometerSystemFieldBuilder().getBuilder(index); + } + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + public club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystemOrBuilder getKilometerSystemOrBuilder( + int index) { + if (kilometerSystemBuilder_ == null) { + return kilometerSystem_.get(index); } else { + return kilometerSystemBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + public java.util.List + getKilometerSystemOrBuilderList() { + if (kilometerSystemBuilder_ != null) { + return kilometerSystemBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(kilometerSystem_); + } + } + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + public club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder addKilometerSystemBuilder() { + return getKilometerSystemFieldBuilder().addBuilder( + club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.getDefaultInstance()); + } + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + public club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder addKilometerSystemBuilder( + int index) { + return getKilometerSystemFieldBuilder().addBuilder( + index, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.getDefaultInstance()); + } + /** + * repeated .graphicData.KilometerSystem kilometerSystem = 3; + */ + public java.util.List + getKilometerSystemBuilderList() { + return getKilometerSystemFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystemOrBuilder> + getKilometerSystemFieldBuilder() { + if (kilometerSystemBuilder_ == null) { + kilometerSystemBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem.Builder, club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystemOrBuilder>( + kilometerSystem_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + kilometerSystem_ = null; + } + return kilometerSystemBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:state.DeviceKilometer) + } + + // @@protoc_insertion_point(class_scope:state.DeviceKilometer) + private static final club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer(); + } + + public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeviceKilometer parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public club.joylink.xiannccda.dto.protos.DeviceInfoProto.DeviceKilometer getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + private static final com.google.protobuf.Descriptors.Descriptor internal_static_state_Section_descriptor; private static final @@ -3522,6 +3478,11 @@ public final class DeviceInfoProto { private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_state_Turnout_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_state_DeviceKilometer_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_state_DeviceKilometer_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -3532,16 +3493,17 @@ public final class DeviceInfoProto { static { java.lang.String[] descriptorData = { "\n\021device_info.proto\022\005state\032\033stationLayou" + - "tGraphics.proto\"\274\001\n\007Section\022\n\n\002id\030\001 \001(\t\022" + - "\014\n\004code\030\002 \001(\t\022\022\n\nchildrenId\030\003 \003(\t\0225\n\017kil" + - "ometerSystem\030\004 \003(\0132\034.graphicData.Kilomet" + - "erSystem\022\030\n\020convertKilometer\030\005 \003(\003\022\031\n\021ph" + - "ysicalSectionId\030\006 \001(\t\022\027\n\017destinationCode" + - "\030\007 \001(\t\"t\n\007Turnout\022\n\n\002id\030\001 \001(\t\022\014\n\004code\030\002 " + - "\001(\t\0225\n\017kilometerSystem\030\003 \003(\0132\034.graphicDa" + - "ta.KilometerSystem\022\030\n\020convertKilometer\030\004" + - " \003(\003B4\n!club.joylink.xiannccda.dto.proto" + - "sB\017DeviceInfoProtob\006proto3" + "tGraphics.proto\"\226\001\n\007Section\022\n\n\002id\030\001 \001(\t\022" + + "\014\n\004code\030\002 \001(\t\022\022\n\nchildrenId\030\003 \003(\t\022\031\n\021phy" + + "sicalSectionId\030\004 \001(\t\022\027\n\017destinationCode\030" + + "\005 \001(\t\022)\n\tkilometer\030\006 \001(\0132\026.state.DeviceK" + + "ilometer\"N\n\007Turnout\022\n\n\002id\030\001 \001(\t\022\014\n\004code\030" + + "\002 \001(\t\022)\n\tkilometer\030\003 \001(\0132\026.state.DeviceK" + + "ilometer\"t\n\017DeviceKilometer\022\024\n\014minKilome" + + "ter\030\001 \001(\003\022\024\n\014maxKilometer\030\002 \001(\003\0225\n\017kilom" + + "eterSystem\030\003 \003(\0132\034.graphicData.Kilometer" + + "SystemB4\n!club.joylink.xiannccda.dto.pro" + + "tosB\017DeviceInfoProtob\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -3553,13 +3515,19 @@ public final class DeviceInfoProto { internal_static_state_Section_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_state_Section_descriptor, - new java.lang.String[] { "Id", "Code", "ChildrenId", "KilometerSystem", "ConvertKilometer", "PhysicalSectionId", "DestinationCode", }); + new java.lang.String[] { "Id", "Code", "ChildrenId", "PhysicalSectionId", "DestinationCode", "Kilometer", }); internal_static_state_Turnout_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_state_Turnout_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_state_Turnout_descriptor, - new java.lang.String[] { "Id", "Code", "KilometerSystem", "ConvertKilometer", }); + new java.lang.String[] { "Id", "Code", "Kilometer", }); + internal_static_state_DeviceKilometer_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_state_DeviceKilometer_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_state_DeviceKilometer_descriptor, + new java.lang.String[] { "MinKilometer", "MaxKilometer", "KilometerSystem", }); club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.getDescriptor(); } diff --git a/src/main/java/club/joylink/xiannccda/dto/protos/LayoutGraphicsProto.java b/src/main/java/club/joylink/xiannccda/dto/protos/LayoutGraphicsProto.java index 68367d3..78a65b7 100644 --- a/src/main/java/club/joylink/xiannccda/dto/protos/LayoutGraphicsProto.java +++ b/src/main/java/club/joylink/xiannccda/dto/protos/LayoutGraphicsProto.java @@ -16926,27 +16926,7 @@ public final class LayoutGraphicsProto { /** *
-     *上下行--upLink表示上行,downLink表示下行
-     * 
- * - * string upAndDown = 5; - * @return The upAndDown. - */ - java.lang.String getUpAndDown(); - /** - *
-     *上下行--upLink表示上行,downLink表示下行
-     * 
- * - * string upAndDown = 5; - * @return The bytes for upAndDown. - */ - com.google.protobuf.ByteString - getUpAndDownBytes(); - - /** - *
-     *关联的车站
+     *string upAndDown =5; //上下行--upLink表示上行,downLink表示下行
      * 
* * string refStation = 6; @@ -16955,7 +16935,7 @@ public final class LayoutGraphicsProto { java.lang.String getRefStation(); /** *
-     *关联的车站
+     *string upAndDown =5; //上下行--upLink表示上行,downLink表示下行
      * 
* * string refStation = 6; @@ -16963,6 +16943,16 @@ public final class LayoutGraphicsProto { */ com.google.protobuf.ByteString getRefStationBytes(); + + /** + *
+     *上下行--true表示上行,false表示下行
+     * 
+ * + * bool up = 7; + * @return The up. + */ + boolean getUp(); } /** * Protobuf type {@code graphicData.Platform} @@ -16979,7 +16969,6 @@ public final class LayoutGraphicsProto { private Platform() { code_ = ""; direction_ = ""; - upAndDown_ = ""; refStation_ = ""; } @@ -17130,59 +17119,12 @@ public final class LayoutGraphicsProto { } } - public static final int UPANDDOWN_FIELD_NUMBER = 5; - @SuppressWarnings("serial") - private volatile java.lang.Object upAndDown_ = ""; - /** - *
-     *上下行--upLink表示上行,downLink表示下行
-     * 
- * - * string upAndDown = 5; - * @return The upAndDown. - */ - @java.lang.Override - public java.lang.String getUpAndDown() { - java.lang.Object ref = upAndDown_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - upAndDown_ = s; - return s; - } - } - /** - *
-     *上下行--upLink表示上行,downLink表示下行
-     * 
- * - * string upAndDown = 5; - * @return The bytes for upAndDown. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUpAndDownBytes() { - java.lang.Object ref = upAndDown_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - upAndDown_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - public static final int REFSTATION_FIELD_NUMBER = 6; @SuppressWarnings("serial") private volatile java.lang.Object refStation_ = ""; /** *
-     *关联的车站
+     *string upAndDown =5; //上下行--upLink表示上行,downLink表示下行
      * 
* * string refStation = 6; @@ -17203,7 +17145,7 @@ public final class LayoutGraphicsProto { } /** *
-     *关联的车站
+     *string upAndDown =5; //上下行--upLink表示上行,downLink表示下行
      * 
* * string refStation = 6; @@ -17224,6 +17166,21 @@ public final class LayoutGraphicsProto { } } + public static final int UP_FIELD_NUMBER = 7; + private boolean up_ = false; + /** + *
+     *上下行--true表示上行,false表示下行
+     * 
+ * + * bool up = 7; + * @return The up. + */ + @java.lang.Override + public boolean getUp() { + return up_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -17250,12 +17207,12 @@ public final class LayoutGraphicsProto { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(direction_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, direction_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(upAndDown_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, upAndDown_); - } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(refStation_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, refStation_); } + if (up_ != false) { + output.writeBool(7, up_); + } getUnknownFields().writeTo(output); } @@ -17279,12 +17236,13 @@ public final class LayoutGraphicsProto { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(direction_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, direction_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(upAndDown_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, upAndDown_); - } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(refStation_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, refStation_); } + if (up_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(7, up_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -17311,10 +17269,10 @@ public final class LayoutGraphicsProto { != other.getHasdoor()) return false; if (!getDirection() .equals(other.getDirection())) return false; - if (!getUpAndDown() - .equals(other.getUpAndDown())) return false; if (!getRefStation() .equals(other.getRefStation())) return false; + if (getUp() + != other.getUp()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -17337,10 +17295,11 @@ public final class LayoutGraphicsProto { getHasdoor()); hash = (37 * hash) + DIRECTION_FIELD_NUMBER; hash = (53 * hash) + getDirection().hashCode(); - hash = (37 * hash) + UPANDDOWN_FIELD_NUMBER; - hash = (53 * hash) + getUpAndDown().hashCode(); hash = (37 * hash) + REFSTATION_FIELD_NUMBER; hash = (53 * hash) + getRefStation().hashCode(); + hash = (37 * hash) + UP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getUp()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -17480,8 +17439,8 @@ public final class LayoutGraphicsProto { code_ = ""; hasdoor_ = false; direction_ = ""; - upAndDown_ = ""; refStation_ = ""; + up_ = false; return this; } @@ -17530,10 +17489,10 @@ public final class LayoutGraphicsProto { result.direction_ = direction_; } if (((from_bitField0_ & 0x00000010) != 0)) { - result.upAndDown_ = upAndDown_; + result.refStation_ = refStation_; } if (((from_bitField0_ & 0x00000020) != 0)) { - result.refStation_ = refStation_; + result.up_ = up_; } } @@ -17565,15 +17524,13 @@ public final class LayoutGraphicsProto { bitField0_ |= 0x00000008; onChanged(); } - if (!other.getUpAndDown().isEmpty()) { - upAndDown_ = other.upAndDown_; + if (!other.getRefStation().isEmpty()) { + refStation_ = other.refStation_; bitField0_ |= 0x00000010; onChanged(); } - if (!other.getRefStation().isEmpty()) { - refStation_ = other.refStation_; - bitField0_ |= 0x00000020; - onChanged(); + if (other.getUp() != false) { + setUp(other.getUp()); } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); @@ -17623,16 +17580,16 @@ public final class LayoutGraphicsProto { bitField0_ |= 0x00000008; break; } // case 34 - case 42: { - upAndDown_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000010; - break; - } // case 42 case 50: { refStation_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000010; break; } // case 50 + case 56: { + up_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 56 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -17977,102 +17934,10 @@ public final class LayoutGraphicsProto { return this; } - private java.lang.Object upAndDown_ = ""; - /** - *
-       *上下行--upLink表示上行,downLink表示下行
-       * 
- * - * string upAndDown = 5; - * @return The upAndDown. - */ - public java.lang.String getUpAndDown() { - java.lang.Object ref = upAndDown_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - upAndDown_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-       *上下行--upLink表示上行,downLink表示下行
-       * 
- * - * string upAndDown = 5; - * @return The bytes for upAndDown. - */ - public com.google.protobuf.ByteString - getUpAndDownBytes() { - java.lang.Object ref = upAndDown_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - upAndDown_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-       *上下行--upLink表示上行,downLink表示下行
-       * 
- * - * string upAndDown = 5; - * @param value The upAndDown to set. - * @return This builder for chaining. - */ - public Builder setUpAndDown( - java.lang.String value) { - if (value == null) { throw new NullPointerException(); } - upAndDown_ = value; - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - /** - *
-       *上下行--upLink表示上行,downLink表示下行
-       * 
- * - * string upAndDown = 5; - * @return This builder for chaining. - */ - public Builder clearUpAndDown() { - upAndDown_ = getDefaultInstance().getUpAndDown(); - bitField0_ = (bitField0_ & ~0x00000010); - onChanged(); - return this; - } - /** - *
-       *上下行--upLink表示上行,downLink表示下行
-       * 
- * - * string upAndDown = 5; - * @param value The bytes for upAndDown to set. - * @return This builder for chaining. - */ - public Builder setUpAndDownBytes( - com.google.protobuf.ByteString value) { - if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); - upAndDown_ = value; - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - private java.lang.Object refStation_ = ""; /** *
-       *关联的车站
+       *string upAndDown =5; //上下行--upLink表示上行,downLink表示下行
        * 
* * string refStation = 6; @@ -18092,7 +17957,7 @@ public final class LayoutGraphicsProto { } /** *
-       *关联的车站
+       *string upAndDown =5; //上下行--upLink表示上行,downLink表示下行
        * 
* * string refStation = 6; @@ -18113,7 +17978,7 @@ public final class LayoutGraphicsProto { } /** *
-       *关联的车站
+       *string upAndDown =5; //上下行--upLink表示上行,downLink表示下行
        * 
* * string refStation = 6; @@ -18124,13 +17989,13 @@ public final class LayoutGraphicsProto { java.lang.String value) { if (value == null) { throw new NullPointerException(); } refStation_ = value; - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000010; onChanged(); return this; } /** *
-       *关联的车站
+       *string upAndDown =5; //上下行--upLink表示上行,downLink表示下行
        * 
* * string refStation = 6; @@ -18138,13 +18003,13 @@ public final class LayoutGraphicsProto { */ public Builder clearRefStation() { refStation_ = getDefaultInstance().getRefStation(); - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } /** *
-       *关联的车站
+       *string upAndDown =5; //上下行--upLink表示上行,downLink表示下行
        * 
* * string refStation = 6; @@ -18156,10 +18021,54 @@ public final class LayoutGraphicsProto { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); refStation_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private boolean up_ ; + /** + *
+       *上下行--true表示上行,false表示下行
+       * 
+ * + * bool up = 7; + * @return The up. + */ + @java.lang.Override + public boolean getUp() { + return up_; + } + /** + *
+       *上下行--true表示上行,false表示下行
+       * 
+ * + * bool up = 7; + * @param value The up to set. + * @return This builder for chaining. + */ + public Builder setUp(boolean value) { + + up_ = value; bitField0_ |= 0x00000020; onChanged(); return this; } + /** + *
+       *上下行--true表示上行,false表示下行
+       * 
+ * + * bool up = 7; + * @return This builder for chaining. + */ + public Builder clearUp() { + bitField0_ = (bitField0_ & ~0x00000020); + up_ = false; + onChanged(); + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -40831,78 +40740,78 @@ public final class LayoutGraphicsProto { "\n\007Polygon\022\'\n\006common\030\001 \001(\0132\027.graphicData." + "CommonInfo\022\014\n\004code\030\002 \001(\t\022\021\n\tlineWidth\030\003 " + "\001(\005\022\021\n\tlineColor\030\004 \001(\t\022\"\n\006points\030\005 \003(\0132\022" + - ".graphicData.Point\"\214\001\n\010Platform\022\'\n\006commo" + + ".graphicData.Point\"\205\001\n\010Platform\022\'\n\006commo" + "n\030\001 \001(\0132\027.graphicData.CommonInfo\022\014\n\004code" + "\030\002 \001(\t\022\017\n\007hasdoor\030\003 \001(\010\022\021\n\tdirection\030\004 \001" + - "(\t\022\021\n\tupAndDown\030\005 \001(\t\022\022\n\nrefStation\030\006 \001(" + - "\t\"\270\001\n\007Station\022\'\n\006common\030\001 \001(\0132\027.graphicD" + - "ata.CommonInfo\022\014\n\004code\030\002 \001(\t\022\022\n\nhasContr" + - "ol\030\003 \001(\010\022\035\n\025concentrationStations\030\004 \001(\010\022" + - "5\n\017kilometerSystem\030\006 \001(\0132\034.graphicData.K" + - "ilometerSystem\022\014\n\004name\030\007 \001(\t\"k\n\013StationL" + - "ine\022\'\n\006common\030\001 \001(\0132\027.graphicData.Common" + - "Info\022\014\n\004code\030\002 \001(\t\022\023\n\013hasTransfer\030\003 \001(\010\022" + - "\020\n\010hideName\030\004 \001(\010\"Y\n\013TrainWindow\022\'\n\006comm" + - "on\030\001 \001(\0132\027.graphicData.CommonInfo\022\014\n\004cod" + - "e\030\002 \001(\t\022\023\n\013refDeviceId\030\003 \003(\t\"\256\001\n\014AxleCou" + - "nting\022\'\n\006common\030\001 \001(\0132\027.graphicData.Comm" + - "onInfo\022\014\n\004code\030\002 \001(\t\0225\n\017kilometerSystem\030" + - "\003 \001(\0132\034.graphicData.KilometerSystem\0220\n\017a" + - "xleCountingRef\030\004 \003(\0132\027.graphicData.Relat" + - "edRef\">\n\005Train\022\'\n\006common\030\001 \001(\0132\027.graphic" + - "Data.CommonInfo\022\014\n\004code\030\002 \001(\t\"B\n\tTrainLi" + - "ne\022\'\n\006common\030\001 \001(\0132\027.graphicData.CommonI" + - "nfo\022\014\n\004code\030\002 \001(\t\"@\n\007IscsFan\022\'\n\006common\030\001" + - " \001(\0132\027.graphicData.CommonInfo\022\014\n\004code\030\002 " + - "\001(\t\"\333\002\n\007Turnout\022\'\n\006common\030\001 \001(\0132\027.graphi" + - "cData.CommonInfo\022\014\n\004code\030\002 \001(\t\022\"\n\006pointA" + - "\030\006 \003(\0132\022.graphicData.Point\022\"\n\006pointB\030\007 \003" + - "(\0132\022.graphicData.Point\022\"\n\006pointC\030\010 \003(\0132\022" + - ".graphicData.Point\022&\n\005paRef\030\t \001(\0132\027.grap" + - "hicData.RelatedRef\022&\n\005pbRef\030\n \001(\0132\027.grap" + - "hicData.RelatedRef\022&\n\005pcRef\030\013 \001(\0132\027.grap" + - "hicData.RelatedRef\0225\n\017kilometerSystem\030\r " + - "\003(\0132\034.graphicData.KilometerSystem\">\n\017Kil" + - "ometerSystem\022\021\n\tkilometer\030\001 \001(\003\022\030\n\020coord" + - "inateSystem\030\002 \001(\t\"\206\001\n\006Signal\022\'\n\006common\030\001" + - " \001(\0132\027.graphicData.CommonInfo\022\014\n\004code\030\002 " + - "\001(\t\022\016\n\006mirror\030\003 \001(\010\0225\n\017kilometerSystem\030\006" + - " \001(\0132\034.graphicData.KilometerSystem\"\340\001\n\007R" + - "unLine\022\'\n\006common\030\001 \001(\0132\027.graphicData.Com" + - "monInfo\022\014\n\004code\030\002 \001(\t\022\"\n\006points\030\003 \003(\0132\022." + - "graphicData.Point\022\021\n\tnameColor\030\004 \001(\t\022\023\n\013" + - "nameBgColor\030\005 \001(\t\022\022\n\ncontainSta\030\010 \003(\t\022\025\n" + - "\rlinkPathLines\030\t \003(\t\022\016\n\006lineId\030\n \001(\t\022\027\n\017" + - "dashPointIndexs\030\013 \003(\005\"\337\002\n\007Section\022\'\n\006com" + - "mon\030\001 \001(\0132\027.graphicData.CommonInfo\022\014\n\004co" + - "de\030\002 \001(\t\022\"\n\006points\030\003 \003(\0132\022.graphicData.P" + - "oint\022&\n\005paRef\030\004 \001(\0132\027.graphicData.Relate" + - "dRef\022&\n\005pbRef\030\005 \001(\0132\027.graphicData.Relate" + - "dRef\0225\n\013sectionType\030\006 \001(\0162 .graphicData." + - "Section.SectionType\022\025\n\raxleCountings\030\007 \003" + - "(\t\022\020\n\010children\030\010 \003(\t\022\027\n\017destinationCode\030" + - "\t \001(\t\"0\n\013SectionType\022\014\n\010Physical\020\000\022\023\n\017Tu" + - "rnoutPhysical\020\002\"i\n\014LogicSection\022\'\n\006commo" + - "n\030\001 \001(\0132\027.graphicData.CommonInfo\022\014\n\004code" + - "\030\002 \001(\t\022\"\n\006points\030\003 \003(\0132\022.graphicData.Poi" + - "nt\"V\n\016KilometerPoint\022!\n\005point\030\001 \001(\0132\022.gr" + - "aphicData.Point\022\021\n\tkilometer\030\002 \001(\003\022\016\n\006st" + - "Name\030\003 \001(\t\"\277\001\n\010PathLine\022\'\n\006common\030\001 \001(\0132" + - "\027.graphicData.CommonInfo\022\014\n\004code\030\002 \001(\t\022\"" + - "\n\006points\030\003 \003(\0132\022.graphicData.Point\022\014\n\004is" + - "Up\030\004 \001(\010\0224\n\017kilometerPoints\030\005 \003(\0132\033.grap" + - "hicData.KilometerPoint\022\024\n\014isKmIncrease\030\006" + - " \001(\010\"\366\001\n\nRelatedRef\0226\n\ndeviceType\030\001 \001(\0162" + - "\".graphicData.RelatedRef.DeviceType\022\n\n\002i" + - "d\030\002 \001(\t\0226\n\ndevicePort\030\003 \001(\0162\".graphicDat" + - "a.RelatedRef.DevicePort\"I\n\nDeviceType\022\013\n" + - "\007Section\020\000\022\013\n\007Turnout\020\001\022\017\n\013TrainWindow\020\002" + - "\022\020\n\014AxleCounting\020\003\"!\n\nDevicePort\022\005\n\001A\020\000\022" + - "\005\n\001B\020\001\022\005\n\001C\020\002\"Y\n\tSeparator\022\'\n\006common\030\001 \001" + + "(\t\022\022\n\nrefStation\030\006 \001(\t\022\n\n\002up\030\007 \001(\010\"\270\001\n\007S" + + "tation\022\'\n\006common\030\001 \001(\0132\027.graphicData.Com" + + "monInfo\022\014\n\004code\030\002 \001(\t\022\022\n\nhasControl\030\003 \001(" + + "\010\022\035\n\025concentrationStations\030\004 \001(\010\0225\n\017kilo" + + "meterSystem\030\006 \001(\0132\034.graphicData.Kilomete" + + "rSystem\022\014\n\004name\030\007 \001(\t\"k\n\013StationLine\022\'\n\006" + + "common\030\001 \001(\0132\027.graphicData.CommonInfo\022\014\n" + + "\004code\030\002 \001(\t\022\023\n\013hasTransfer\030\003 \001(\010\022\020\n\010hide" + + "Name\030\004 \001(\010\"Y\n\013TrainWindow\022\'\n\006common\030\001 \001(" + + "\0132\027.graphicData.CommonInfo\022\014\n\004code\030\002 \001(\t" + + "\022\023\n\013refDeviceId\030\003 \003(\t\"\256\001\n\014AxleCounting\022\'" + + "\n\006common\030\001 \001(\0132\027.graphicData.CommonInfo\022" + + "\014\n\004code\030\002 \001(\t\0225\n\017kilometerSystem\030\003 \001(\0132\034" + + ".graphicData.KilometerSystem\0220\n\017axleCoun" + + "tingRef\030\004 \003(\0132\027.graphicData.RelatedRef\">" + + "\n\005Train\022\'\n\006common\030\001 \001(\0132\027.graphicData.Co" + + "mmonInfo\022\014\n\004code\030\002 \001(\t\"B\n\tTrainLine\022\'\n\006c" + + "ommon\030\001 \001(\0132\027.graphicData.CommonInfo\022\014\n\004" + + "code\030\002 \001(\t\"@\n\007IscsFan\022\'\n\006common\030\001 \001(\0132\027." + + "graphicData.CommonInfo\022\014\n\004code\030\002 \001(\t\"\333\002\n" + + "\007Turnout\022\'\n\006common\030\001 \001(\0132\027.graphicData.C" + + "ommonInfo\022\014\n\004code\030\002 \001(\t\022\"\n\006pointA\030\006 \003(\0132" + + "\022.graphicData.Point\022\"\n\006pointB\030\007 \003(\0132\022.gr" + + "aphicData.Point\022\"\n\006pointC\030\010 \003(\0132\022.graphi" + + "cData.Point\022&\n\005paRef\030\t \001(\0132\027.graphicData" + + ".RelatedRef\022&\n\005pbRef\030\n \001(\0132\027.graphicData" + + ".RelatedRef\022&\n\005pcRef\030\013 \001(\0132\027.graphicData" + + ".RelatedRef\0225\n\017kilometerSystem\030\r \003(\0132\034.g" + + "raphicData.KilometerSystem\">\n\017KilometerS" + + "ystem\022\021\n\tkilometer\030\001 \001(\003\022\030\n\020coordinateSy" + + "stem\030\002 \001(\t\"\206\001\n\006Signal\022\'\n\006common\030\001 \001(\0132\027." + + "graphicData.CommonInfo\022\014\n\004code\030\002 \001(\t\022\016\n\006" + + "mirror\030\003 \001(\010\0225\n\017kilometerSystem\030\006 \001(\0132\034." + + "graphicData.KilometerSystem\"\340\001\n\007RunLine\022" + + "\'\n\006common\030\001 \001(\0132\027.graphicData.CommonInfo" + + "\022\014\n\004code\030\002 \001(\t\022\"\n\006points\030\003 \003(\0132\022.graphic" + + "Data.Point\022\021\n\tnameColor\030\004 \001(\t\022\023\n\013nameBgC" + + "olor\030\005 \001(\t\022\022\n\ncontainSta\030\010 \003(\t\022\025\n\rlinkPa" + + "thLines\030\t \003(\t\022\016\n\006lineId\030\n \001(\t\022\027\n\017dashPoi" + + "ntIndexs\030\013 \003(\005\"\337\002\n\007Section\022\'\n\006common\030\001 \001" + "(\0132\027.graphicData.CommonInfo\022\014\n\004code\030\002 \001(" + - "\t\022\025\n\rseparatorType\030\003 \001(\tB8\n!club.joylink" + - ".xiannccda.dto.protosB\023LayoutGraphicsPro" + - "tob\006proto3" + "\t\022\"\n\006points\030\003 \003(\0132\022.graphicData.Point\022&\n" + + "\005paRef\030\004 \001(\0132\027.graphicData.RelatedRef\022&\n" + + "\005pbRef\030\005 \001(\0132\027.graphicData.RelatedRef\0225\n" + + "\013sectionType\030\006 \001(\0162 .graphicData.Section" + + ".SectionType\022\025\n\raxleCountings\030\007 \003(\t\022\020\n\010c" + + "hildren\030\010 \003(\t\022\027\n\017destinationCode\030\t \001(\t\"0" + + "\n\013SectionType\022\014\n\010Physical\020\000\022\023\n\017TurnoutPh" + + "ysical\020\002\"i\n\014LogicSection\022\'\n\006common\030\001 \001(\013" + + "2\027.graphicData.CommonInfo\022\014\n\004code\030\002 \001(\t\022" + + "\"\n\006points\030\003 \003(\0132\022.graphicData.Point\"V\n\016K" + + "ilometerPoint\022!\n\005point\030\001 \001(\0132\022.graphicDa" + + "ta.Point\022\021\n\tkilometer\030\002 \001(\003\022\016\n\006stName\030\003 " + + "\001(\t\"\277\001\n\010PathLine\022\'\n\006common\030\001 \001(\0132\027.graph" + + "icData.CommonInfo\022\014\n\004code\030\002 \001(\t\022\"\n\006point" + + "s\030\003 \003(\0132\022.graphicData.Point\022\014\n\004isUp\030\004 \001(" + + "\010\0224\n\017kilometerPoints\030\005 \003(\0132\033.graphicData" + + ".KilometerPoint\022\024\n\014isKmIncrease\030\006 \001(\010\"\366\001" + + "\n\nRelatedRef\0226\n\ndeviceType\030\001 \001(\0162\".graph" + + "icData.RelatedRef.DeviceType\022\n\n\002id\030\002 \001(\t" + + "\0226\n\ndevicePort\030\003 \001(\0162\".graphicData.Relat" + + "edRef.DevicePort\"I\n\nDeviceType\022\013\n\007Sectio" + + "n\020\000\022\013\n\007Turnout\020\001\022\017\n\013TrainWindow\020\002\022\020\n\014Axl" + + "eCounting\020\003\"!\n\nDevicePort\022\005\n\001A\020\000\022\005\n\001B\020\001\022" + + "\005\n\001C\020\002\"Y\n\tSeparator\022\'\n\006common\030\001 \001(\0132\027.gr" + + "aphicData.CommonInfo\022\014\n\004code\030\002 \001(\t\022\025\n\rse" + + "paratorType\030\003 \001(\tB8\n!club.joylink.xiannc" + + "cda.dto.protosB\023LayoutGraphicsProtob\006pro" + + "to3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -40967,7 +40876,7 @@ public final class LayoutGraphicsProto { internal_static_graphicData_Platform_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_graphicData_Platform_descriptor, - new java.lang.String[] { "Common", "Code", "Hasdoor", "Direction", "UpAndDown", "RefStation", }); + new java.lang.String[] { "Common", "Code", "Hasdoor", "Direction", "RefStation", "Up", }); internal_static_graphicData_Station_descriptor = getDescriptor().getMessageTypes().get(10); internal_static_graphicData_Station_fieldAccessorTable = new diff --git a/src/main/java/club/joylink/xiannccda/service/LineDeviceStatusService.java b/src/main/java/club/joylink/xiannccda/service/LineDeviceStatusService.java index 83e7a3e..231fe2f 100644 --- a/src/main/java/club/joylink/xiannccda/service/LineDeviceStatusService.java +++ b/src/main/java/club/joylink/xiannccda/service/LineDeviceStatusService.java @@ -1,10 +1,13 @@ package club.joylink.xiannccda.service; +import club.joylink.xiannccda.ats.message.MessageData; +import club.joylink.xiannccda.ats.message.MessageId; import club.joylink.xiannccda.ats.message.collect.DeviceStatusConvertorManager; import club.joylink.xiannccda.ats.message.collect.convertor.DeviceChangeStatusConvertor; import club.joylink.xiannccda.ats.message.collect.convertor.DeviceInitConvertor; import club.joylink.xiannccda.ats.message.collect.convertor.LineNetTrainInitConvertor; +import club.joylink.xiannccda.ats.message.collect.convertor.LineNetTrainRecordConvertor; import club.joylink.xiannccda.ats.message.collect.convertor.LineNetTrainRemoveConvertor; import club.joylink.xiannccda.ats.message.collect.convertor.LineNetTrainUpdateConvertor; import club.joylink.xiannccda.ats.message.collect.convertor.TrainInitConvertor; @@ -18,29 +21,31 @@ import club.joylink.xiannccda.ws.LineTrainMessageServer; import club.joylink.xiannccda.ws.WsMessageServerManager; import jakarta.annotation.PostConstruct; +import java.util.List; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; +import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; /** 线路设备信息更新 */ @Slf4j @Service +@RequiredArgsConstructor public class LineDeviceStatusService { private final WsMessageServerManager wsMessageServerManager; private final NccMockDataService nccMockDataService; - public LineDeviceStatusService( - WsMessageServerManager wsMessageServerManager, NccMockDataService nccMockDataService) { - this.wsMessageServerManager = wsMessageServerManager; - this.nccMockDataService = nccMockDataService; - } - @PostConstruct public void deviceStatusRefresh() { this.createDataConvertor(); // 添加初始化转换方法 DeviceStatusConvertorManager.addStatusConvertor(new LineNetTrainInitConvertor()); + // 列车报点信息转换方法 + DeviceStatusConvertorManager.addStatusConvertor(new LineNetTrainRecordConvertor()); // 列车更新转换方法 DeviceStatusConvertorManager.addStatusConvertor(new LineNetTrainUpdateConvertor()); // 列车删除转换方法 @@ -50,6 +55,9 @@ public class LineDeviceStatusService { wsMessageServerManager.registerMessageServer(new LineNetMessageServer()); wsMessageServerManager.registerMessageServer(new LineTrainMessageServer()); wsMessageServerManager.registerMessageServer(new LineDeviceMessageServer()); + + // 加载数据 + refreshTestData(); } private void createDataConvertor() { @@ -61,4 +69,34 @@ public class LineDeviceStatusService { DeviceStatusConvertorManager.addStatusConvertor(new TrainRecordConvertor()); DeviceStatusConvertorManager.addStatusConvertor(new TrainUpdateConvertor()); } + + public void refreshTestData() { + List allMockData = nccMockDataService.loadAllTrainInitData(); + DeviceStatusConvertorManager.doConvertor(allMockData); + int frequency = 1500, stopTime = 30000; + AtomicLong id = new AtomicLong(0); + AtomicLong resetTimes = new AtomicLong(stopTime); + Executors.newSingleThreadScheduledExecutor() + .scheduleWithFixedDelay( + () -> { + boolean isEmpty = true; + if (resetTimes.get() == stopTime) { // 代表还没有停顿,不相等说明已经进入空循环 + List updateMockData = + nccMockDataService.loadUpdateData(id, MessageId.TRAIN_RECORD.name(), 2); + DeviceStatusConvertorManager.doConvertor(updateMockData); + isEmpty = updateMockData.size() == 0; + } + if (isEmpty) { // 假数据已经用完了,开始重复使用,中间停顿30000ms + if (resetTimes.get() <= 0) { + id.set(0); + resetTimes.set(stopTime); + } else { + resetTimes.set(resetTimes.get() - frequency); + } + } + }, + frequency, + frequency, + TimeUnit.MILLISECONDS); + } } diff --git a/xian-ncc-da-message b/xian-ncc-da-message index edc9973..c9a07e7 160000 --- a/xian-ncc-da-message +++ b/xian-ncc-da-message @@ -1 +1 @@ -Subproject commit edc9973662bc4f02198f72919de9408fa9ea9043 +Subproject commit c9a07e75f06e8247d33f9e08c52d5045f1db2bc2