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