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 147a158..740337d 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.CommonInfo; import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.KilometerSystem; @@ -26,34 +28,25 @@ import lombok.Getter; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -/** - * 发布时缓存在内存中的线路数据 - */ +/** 发布时缓存在内存中的线路数据 */ @Slf4j public class LineGraphicDataRepository { - /** - * 线路数据信息 - */ + /** 线路数据信息 */ private static final Map>> lineGraphMap = new ConcurrentHashMap<>(); - /** - * 线路各坐标系转换关系 - */ + /** 线路各坐标系转换关系 */ private static final Map> lineCoordinateMain = new HashMap<>(); - /** - * 线路-设备code-设备 - */ - private static final HashBasedTable line_code_table = + /** 线路-设备code-设备 */ + private static final HashBasedTable line_code_table = HashBasedTable.create(); - /** - * 线路-设备id-设备 - */ - private static final HashBasedTable line_id_table = HashBasedTable.create(); + /** 线路-设备id-设备 */ + private static final HashBasedTable line_id_table = + HashBasedTable.create(); /** * 缓存线路数据信息 @@ -68,13 +61,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 @@ -88,18 +85,18 @@ public class LineGraphicDataRepository { /** * 获取线路上区段名为【sectionName】的公里标 * - * @param lineId 线路ID + * @param lineId 线路ID * @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(); } } @@ -107,16 +104,14 @@ 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; } - /** - * 删除线路绘图数据 - */ + /** 删除线路绘图数据 */ public static void removeLineGraph(Integer id) { lineGraphMap.remove(id); } @@ -165,55 +160,59 @@ public class LineGraphicDataRepository { }); } + /** + * 获取线路的区段集合 + * + * @param lineId 线路ID + * @return 区段集合 + */ + public static Map getLineSectionBuild(int lineId) { + Map> lineDataMap = lineGraphMap.get(lineId); + if (CollectionUtils.isNotEmpty(lineDataMap)) { + return lineDataMap.get(DeviceType.Section.name()); + } + return Map.of(); + } + /** * 构建程序中的区段信息 * * @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) { sectionBuilder.addAllChildrenId(section.getChildrenList()); // 初始化逻辑区段信息,建立逻辑区段与物理区段之间的关系 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); } /** * 构建道岔信息 * - * @param lineId 线路ID + * @param lineId 线路ID * @param dataMap 缓存数据 * @param storage 地图构建数据 */ @@ -234,37 +233,56 @@ 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); + } + /** * 设置公里标 * - * @param lineId 线路ID + * @param lineId 线路ID * @param dataMap 缓存数据 * @param storage 地图构建数据 */ @@ -285,27 +303,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); } } }); @@ -315,7 +329,7 @@ public class LineGraphicDataRepository { /** * 初始化坐标转换对象 * - * @param lineId 线路ID + * @param lineId 线路ID * @param dataMap 设备集合 * @param storage 地图信息 */ @@ -343,8 +357,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) { @@ -387,6 +401,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())); + } + } + } + } + } + /** * 公里标转换 * @@ -426,32 +483,134 @@ 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); // 最大公里标 } } }); } /** - * 坐标系枚举 + * <<<<<<< HEAD 生成默认的公里标对象 + * + * @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 { MAIN_LINE("MAIN_LINE", List.of("YDK", "ZDK", "XDK", "SDK")), @@ -496,9 +655,7 @@ public class LineGraphicDataRepository { } } - /** - * 坐标转换对象 - */ + /** 坐标转换对象 */ @Getter private static class CoordinateConvertor { @@ -513,8 +670,8 @@ public class LineGraphicDataRepository { /** * 生成坐标转换对象 * - * @param configSystem 原配置坐标系信息 - * @param convertorSystem 转换坐标系类型 + * @param configSystem 原配置坐标系信息 + * @param convertorSystem 转换坐标系类型 * @param convertorCoordinate 转换坐标 * @return 转换对象 */ @@ -566,7 +723,7 @@ public class LineGraphicDataRepository { * 将出入库公里标转换为正线标 * * @param basisKilometer 出入库基准公里标 - * @param targetType 目标坐标系 + * @param targetType 目标坐标系 * @return 正线公里标数字 */ public long convertorKilometer(KilometerSystem basisKilometer, CoordinateEnum targetType) { diff --git a/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainComMethod.java b/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainComMethod.java index 13368e3..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 @@ -6,11 +6,14 @@ import club.joylink.xiannccda.ats.message.collect.DeviceStatusDataRepository; import club.joylink.xiannccda.ats.message.collect.datasource.DeviceStatusData; import club.joylink.xiannccda.ats.message.line3.changer.DeviceNameChangerManage; import club.joylink.xiannccda.ats.message.line3.device.DeviceType; +import club.joylink.xiannccda.dto.protos.DeviceInfoProto; +import club.joylink.xiannccda.dto.protos.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; +import lombok.Getter; import lombok.extern.slf4j.Slf4j; /** 线网的列车数据,一些公共方法 */ @@ -51,27 +54,116 @@ public abstract class LineNetTrainComMethod { */ public static void setUpKilometerCode( WsMessageProto.WsLineNetTrainOffsetMessage.Builder obj, DeviceType type, String deviceName) { - // 非区段、道岔直接返回 - if (!DeviceType.DEVICE_TYPE_TRACK.equals(type) && !DeviceType.DEVICE_TYPE_SWITCH.equals(type)) { + // 获取到当前区段公里标 + DeviceKilometer.Builder km = getDeviceKM(obj.getLineId(), type, deviceName); + if (km != null) { + obj.setKilometerCode(selectDeviceKilometerCode(obj.getDir(), km)); + } else { + log.warn(String.format("设备%s没有公里标信息", deviceName)); + } + } + + /** + * 根据目的码确定方向,并确定公里标 + * + * @param obj 要设置的对象 + * @param destinationCode 目的码 + * @param type 设备类型 + * @param name 设备名称 + */ + public static void setTrainDirectionAndKilometerCode( + WsMessageProto.WsLineNetTrainOffsetMessage.Builder obj, + String destinationCode, + DeviceType type, + String name) { + DeviceKilometer.Builder deviceKm = getDeviceKM(obj.getLineId(), type, name); + if (deviceKm == null) { return; } - // 转换成程序中的名称 - String convertName = DeviceNameChangerManage.findMatch(type, deviceName); - // 获取到当前区段公里标 - List kmList = - LineGraphicDataRepository.getKilometerCodeList(obj.getLineId(), convertName); - if (CollectionUtils.isNotEmpty(kmList)) { - long kilometer; - if (obj.getDir() == 1) { // 下行取大值 - kilometer = kmList.stream().min(Long::compareTo).get(); - } else if (obj.getDir() == 2) { // 上行取小值 - kilometer = kmList.stream().max(Long::compareTo).get(); - } else { // 无方向获取第一个 - kilometer = kmList.get(0); - } - obj.setKilometerCode(kilometer); + DeviceKilometer.Builder destinationKm = getDirectionCodeKM(obj.getLineId(), destinationCode); + if (destinationKm == null) { + return; + } + // 确定方向 + if (destinationKm.getMaxKilometer() > deviceKm.getMaxKilometer()) { // 目的地最大公里标大于设备最大公里标,上行 + obj.setDir(TrainRunDirection.UP.getDir()); } else { - log.warn(String.format("设备%s没有公里标信息", convertName)); + obj.setDir(TrainRunDirection.DOWN.getDir()); + } + // 赋值公里标 + obj.setKilometerCode(selectDeviceKilometerCode(obj.getDir(), deviceKm)); + } + + /** + * 获取设备的公里标 + * + * @param lineId 线路ID + * @param type 设备类型 + * @param name 设备名称 + * @return 公里标列表 + */ + 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 null; + } + // 转换成程序中的名称 + String convertName = DeviceNameChangerManage.findMatch(type, name); + // 获取到当前区段公里标 + return LineGraphicDataRepository.getKilometerCodeList(lineId, convertName); + } + + /** + * 获取目的地码的公里标信息 + * + * @param lineId 线路ID + * @param code 目的地码 + * @return 公里标列表 + */ + private static DeviceKilometer.Builder getDirectionCodeKM(int lineId, String code) { + Map map = LineGraphicDataRepository.getLineSectionBuild(lineId); + Optional destination = + map.values().stream() + .filter( + s -> { + DeviceInfoProto.Section.Builder b = (DeviceInfoProto.Section.Builder) s; + return Objects.equals(b.getDestinationCode(), code); + }) + .findFirst(); + if (destination.isPresent()) { + DeviceInfoProto.Section.Builder b = (DeviceInfoProto.Section.Builder) destination.get(); + return b.getKilometerBuilder(); + } else { + return null; + } + } + + /** + * 选择对应的公里标信息 + * + * @param dir 运行方向 + * @param km 公里标信息 + * @return 公里标 + */ + private static long selectDeviceKilometerCode(int dir, DeviceKilometer.Builder km) { + // 下行(1)取小值 \ 上行(2)取大值 + return TrainRunDirection.UP.isMatch(dir) ? km.getMaxKilometer() : km.getMinKilometer(); + } + + @Getter + public static enum TrainRunDirection { + UP(2), + DOWN(1), + NO(0); + + private int dir; + + 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/LineNetTrainInitConvertor.java b/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainInitConvertor.java index d40a405..5fad374 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainInitConvertor.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainInitConvertor.java @@ -35,9 +35,8 @@ public class LineNetTrainInitConvertor extends DeviceStatusConvertor { offset.setLineId(response.getLineId()); // 线路id offset.setTrainIndex(trainCell.getTrainIndex()); // 列车标示号,全线唯一 offset.setGroupId(trainCell.getGroupId()); // 车组号 - offset.setDir(0); // 初始设置无运行方向 - LineNetTrainComMethod.setUpKilometerCode( - offset, trainCell.getDevType(), trainCell.getDevName()); + LineNetTrainComMethod.setTrainDirectionAndKilometerCode( + offset, trainCell.getDestinationId(), trainCell.getDevType(), trainCell.getDevName()); offset.setShow(offset.getKilometerCode() != 0); buildList.add(offset); } diff --git a/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainUpdateConvertor.java b/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainUpdateConvertor.java index b8f03ef..1a58744 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainUpdateConvertor.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/collect/convertor/LineNetTrainUpdateConvertor.java @@ -35,8 +35,8 @@ public class LineNetTrainUpdateConvertor extends DeviceStatusConvertor { offset.setTrainIndex(response.getTrainIndex()); // 列车标示号,全线唯一 offset.setGroupId(response.getGroupId()); // 车组号 LineNetTrainComMethod.getDeviceStatusById(offset); // 合并老旧数据 - LineNetTrainComMethod.setUpKilometerCode( - offset, response.getDevType(), response.getDevName()); + LineNetTrainComMethod.setTrainDirectionAndKilometerCode( + offset, response.getDestinationId(), response.getDevType(), response.getDevName()); offset.setShow(offset.getKilometerCode() != 0); buildList.add(offset); } diff --git a/src/main/java/club/joylink/xiannccda/dto/protos/DeviceInfoProto.java b/src/main/java/club/joylink/xiannccda/dto/protos/DeviceInfoProto.java index 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/service/LineDeviceStatusService.java b/src/main/java/club/joylink/xiannccda/service/LineDeviceStatusService.java index 986f967..231fe2f 100644 --- a/src/main/java/club/joylink/xiannccda/service/LineDeviceStatusService.java +++ b/src/main/java/club/joylink/xiannccda/service/LineDeviceStatusService.java @@ -20,28 +20,25 @@ import club.joylink.xiannccda.ws.LineNetMessageServer; import club.joylink.xiannccda.ws.LineTrainMessageServer; import club.joylink.xiannccda.ws.WsMessageServerManager; import jakarta.annotation.PostConstruct; + import java.util.List; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; +import lombok.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(); diff --git a/xian-ncc-da-message b/xian-ncc-da-message index e9ebd34..b3b9885 160000 --- a/xian-ncc-da-message +++ b/xian-ncc-da-message @@ -1 +1 @@ -Subproject commit e9ebd34921652f48c2d84ac531e392ce32d17bb5 +Subproject commit b3b9885e2784cdad86901303e0bb9abf28c35e10