【公里标转换】
This commit is contained in:
parent
e5ff8453c6
commit
f0a5b00f3a
@ -9,14 +9,15 @@ import club.joylink.xiannccda.entity.PublishedGi;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.google.protobuf.GeneratedMessageV3.Builder;
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/** 发布时缓存在内存中的线路数据 */
|
||||
@Slf4j
|
||||
@ -26,6 +27,10 @@ public class LineGraphicDataRepository {
|
||||
private static final Map<Integer, Map<String, Map<String, ? extends Builder>>> lineGraphMap =
|
||||
new ConcurrentHashMap<>();
|
||||
|
||||
/** 线路各坐标系转换关系 */
|
||||
private static final Map<Integer, Map<String, CoordinateConvertor>> lineCoordinateMain =
|
||||
new HashMap<>();
|
||||
|
||||
/**
|
||||
* 线路信息是否存在
|
||||
*
|
||||
@ -48,11 +53,11 @@ public class LineGraphicDataRepository {
|
||||
LayoutGraphicsProto.RtssGraphicStorage.parseFrom(publishGi.getProto());
|
||||
Map<String, Map<String, ? extends Builder>> lineDataMap = new HashMap<>();
|
||||
// 构建区段
|
||||
sectionInitLineGraph(lineDataMap, storage);
|
||||
sectionInitLineGraph(publishGi.getLineId(), lineDataMap, storage);
|
||||
// 构建道岔
|
||||
switchInitLineGraph(lineDataMap, storage);
|
||||
switchInitLineGraph(publishGi.getLineId(), lineDataMap, storage);
|
||||
// 设置公里标
|
||||
setUpKilometerCode(lineDataMap, storage);
|
||||
setUpKilometerCode(publishGi.getLineId(), lineDataMap, storage);
|
||||
lineGraphMap.put(publishGi.getLineId(), lineDataMap);
|
||||
}
|
||||
} catch (InvalidProtocolBufferException e) {
|
||||
@ -84,10 +89,12 @@ public class LineGraphicDataRepository {
|
||||
/**
|
||||
* 构建程序中的区段信息
|
||||
*
|
||||
* @param lineId 线路ID
|
||||
* @param dataMap 缓存数据
|
||||
* @param storage 地图构建数据
|
||||
*/
|
||||
private static void sectionInitLineGraph(
|
||||
Integer lineId,
|
||||
Map<String, Map<String, ? extends Builder>> dataMap,
|
||||
LayoutGraphicsProto.RtssGraphicStorage storage) {
|
||||
// 地图
|
||||
@ -107,8 +114,8 @@ public class LineGraphicDataRepository {
|
||||
childList.forEach(
|
||||
id -> {
|
||||
DeviceInfoProto.Section.Builder cb =
|
||||
cacheSectionMap.getOrDefault(
|
||||
id, DeviceInfoProto.Section.newBuilder().setId(id));
|
||||
cacheSectionMap.getOrDefault(id, DeviceInfoProto.Section.newBuilder());
|
||||
cb.setId(id);
|
||||
sectionBuilder.addChildren(cb);
|
||||
cacheSectionMap.put(id, cb);
|
||||
});
|
||||
@ -121,38 +128,43 @@ public class LineGraphicDataRepository {
|
||||
/**
|
||||
* 构建道岔信息
|
||||
*
|
||||
* @param lineId 线路ID
|
||||
* @param dataMap 缓存数据
|
||||
* @param storage 地图构建数据
|
||||
*/
|
||||
private static void switchInitLineGraph(
|
||||
Integer lineId,
|
||||
Map<String, Map<String, ? extends Builder>> dataMap,
|
||||
LayoutGraphicsProto.RtssGraphicStorage storage) {
|
||||
Map<String, DeviceInfoProto.Switch.Builder> cacheSwitchMap =
|
||||
Map<String, DeviceInfoProto.Turnout.Builder> cacheSwitchMap =
|
||||
storage.getTurnoutsList().stream()
|
||||
.collect(
|
||||
Collectors.toMap(
|
||||
t -> t.getCommon().getId(),
|
||||
t -> {
|
||||
DeviceInfoProto.Switch.Builder switchBuilder =
|
||||
DeviceInfoProto.Switch.newBuilder();
|
||||
DeviceInfoProto.Turnout.Builder switchBuilder =
|
||||
DeviceInfoProto.Turnout.newBuilder();
|
||||
switchBuilder.setId(t.getCommon().getId());
|
||||
switchBuilder.setCode(t.getCode());
|
||||
switchBuilder.addAllKilometerSystem(t.getKilometerSystemList());
|
||||
return switchBuilder;
|
||||
}));
|
||||
|
||||
dataMap.put(DeviceType.Turnout.name(), cacheSwitchMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置公里标
|
||||
*
|
||||
* @param lineId 线路ID
|
||||
* @param dataMap 缓存数据
|
||||
* @param storage 地图构建数据
|
||||
*/
|
||||
private static void setUpKilometerCode(
|
||||
Integer lineId,
|
||||
Map<String, Map<String, ? extends Builder>> dataMap,
|
||||
LayoutGraphicsProto.RtssGraphicStorage storage) {
|
||||
// 初始化转换信息
|
||||
initConvertorCoordinate(lineId, dataMap, storage);
|
||||
Map<String, ? extends Builder> sectionMap =
|
||||
dataMap.getOrDefault(DeviceType.Section.name(), Map.of());
|
||||
storage
|
||||
@ -173,14 +185,216 @@ public class LineGraphicDataRepository {
|
||||
}
|
||||
|
||||
/**
|
||||
* 将出入库公里标转换为正线标
|
||||
* 初始化坐标转换对象
|
||||
*
|
||||
* @param basisKilometer 出入库基准公里标
|
||||
* @param system 传入的公里标
|
||||
* @return 正线公里标数字
|
||||
* @param lineId 线路ID
|
||||
* @param dataMap 设备集合
|
||||
* @param storage 地图信息
|
||||
*/
|
||||
private static long convertorKilometer(KilometerSystem basisKilometer, KilometerSystem system) {
|
||||
private static void initConvertorCoordinate(
|
||||
Integer lineId,
|
||||
Map<String, Map<String, ? extends Builder>> dataMap,
|
||||
LayoutGraphicsProto.RtssGraphicStorage storage) {
|
||||
Map<String, ? extends Builder> turnoutMap =
|
||||
dataMap.getOrDefault(DeviceType.Turnout.name(), Map.of());
|
||||
storage
|
||||
.getAxleCountingsList()
|
||||
.forEach(
|
||||
axle -> {
|
||||
// 筛选出道岔的公里标坐标系
|
||||
List<KilometerSystem> kilometerSystemList =
|
||||
axle.getAxleCountingRefList().stream()
|
||||
.filter(
|
||||
ref ->
|
||||
DeviceType.Turnout.equals(ref.getDeviceType())
|
||||
&& turnoutMap.containsKey(ref.getId()))
|
||||
.map(ref -> (DeviceInfoProto.Turnout.Builder) turnoutMap.get(ref.getId()))
|
||||
.filter(turnout -> turnout.getKilometerSystemList().size() != 0)
|
||||
.map(turnout -> turnout.getKilometerSystemList().get(0))
|
||||
.toList();
|
||||
// 如果关联多个道岔
|
||||
if (kilometerSystemList.size() > 1) {
|
||||
KilometerSystem axleSystem = axle.getKilometerSystem();
|
||||
KilometerSystem sameSystem =
|
||||
kilometerSystemList.stream()
|
||||
.filter(
|
||||
k ->
|
||||
Objects.equals(
|
||||
k.getCoordinateSystem(), axleSystem.getCoordinateSystem()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
KilometerSystem diffSystem =
|
||||
kilometerSystemList.stream()
|
||||
.filter(
|
||||
k ->
|
||||
!Objects.equals(
|
||||
k.getCoordinateSystem(), axleSystem.getCoordinateSystem()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
// 存在不同的坐标系再做处理
|
||||
if (sameSystem != null && diffSystem != null) {
|
||||
String convertorKey =
|
||||
CoordinateConvertor.generateConvertorKey(
|
||||
axleSystem.getCoordinateSystem(), diffSystem.getCoordinateSystem());
|
||||
Map<String, CoordinateConvertor> convertorMap =
|
||||
lineCoordinateMain.computeIfAbsent(lineId, id -> new HashMap<>());
|
||||
if (!convertorMap.containsKey(convertorKey)) {
|
||||
// 计轴与相同坐标系岔心之间差值
|
||||
long diffValue = axleSystem.getKilometer() - sameSystem.getKilometer();
|
||||
// 俩岔心到计轴的距离相同,所以另一坐标系的公里标相减差值就是计轴在另一个坐标系的位置
|
||||
// a - x = y - b (x,y为计轴在两坐标系上的坐标)
|
||||
long convertKilometer = diffSystem.getKilometer() - diffValue;
|
||||
// 求出坐标系0点位置
|
||||
CoordinateConvertor convertor =
|
||||
CoordinateConvertor.generate(
|
||||
axleSystem, diffSystem.getCoordinateSystem(), convertKilometer);
|
||||
convertorMap.put(convertorKey, convertor);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return 0L;
|
||||
/** 坐标系枚举 */
|
||||
@Getter
|
||||
private enum CoordinateEnum {
|
||||
MAIN_LINE("正线", List.of("YDK", "ZDK", "XDK", "SDK")),
|
||||
PARK_LINE("停车场", List.of("CDK", "RDK")),
|
||||
DEPOT_LINE("车辆段", List.of("CDK", "RDK")),
|
||||
CHANGE_LINE("换线", List.of("L")),
|
||||
UN_KNOW("未知", List.of());
|
||||
|
||||
private final String title;
|
||||
|
||||
private final List<String> typeList;
|
||||
|
||||
CoordinateEnum(String title, List<String> typeList) {
|
||||
this.title = title;
|
||||
this.typeList = typeList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 匹配坐标系
|
||||
*
|
||||
* @param str 传入参数
|
||||
* @return 坐标系
|
||||
*/
|
||||
public boolean matchEnum(String str) {
|
||||
return Objects.equals(this.getTitle(), str)
|
||||
|| (StringUtils.isNotEmpty(str) && this.getTypeList().stream().anyMatch(str::startsWith));
|
||||
}
|
||||
|
||||
/**
|
||||
* 匹配
|
||||
*
|
||||
* @param str 参数
|
||||
* @return 坐标系
|
||||
*/
|
||||
public static CoordinateEnum match(String str) {
|
||||
for (CoordinateEnum e : CoordinateEnum.values()) {
|
||||
if (e.matchEnum(str)) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("未知坐标系,请联系开发人员:" + str);
|
||||
}
|
||||
}
|
||||
|
||||
/** 坐标转换对象 */
|
||||
@Getter
|
||||
private static class CoordinateConvertor {
|
||||
|
||||
private CoordinateEnum configType;
|
||||
|
||||
private long configCoordinate;
|
||||
|
||||
private CoordinateEnum convertorType;
|
||||
|
||||
private long convertorCoordinate;
|
||||
|
||||
/**
|
||||
* 生成坐标转换对象
|
||||
*
|
||||
* @param configSystem 原配置坐标系信息
|
||||
* @param convertorSystem 转换坐标系类型
|
||||
* @param convertorCoordinate 转换坐标
|
||||
* @return 转换对象
|
||||
*/
|
||||
public static CoordinateConvertor generate(
|
||||
KilometerSystem configSystem, String convertorSystem, long convertorCoordinate) {
|
||||
CoordinateConvertor convertor = new CoordinateConvertor();
|
||||
convertor.configType = CoordinateEnum.match(configSystem.getCoordinateSystem());
|
||||
convertor.configCoordinate = configSystem.getKilometer();
|
||||
convertor.convertorType = CoordinateEnum.match(convertorSystem);
|
||||
convertor.convertorCoordinate = convertorCoordinate;
|
||||
return convertor;
|
||||
}
|
||||
|
||||
/**
|
||||
* 在匹配时做判断是否已经存在转换关系,若存在则不再做处理
|
||||
*
|
||||
* @param type1 类型1
|
||||
* @param type2 类型2
|
||||
* @return 字符串
|
||||
*/
|
||||
public static String generateConvertorKey(String type1, String type2) {
|
||||
return generateConvertorKey(CoordinateEnum.match(type1), CoordinateEnum.match(type2));
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否可以转换这个坐标系
|
||||
*
|
||||
* @param s1 原坐标系
|
||||
* @param s2 目标坐标系
|
||||
* @return 是否转换结果
|
||||
*/
|
||||
public boolean canConvertor(String s1, CoordinateEnum s2) {
|
||||
return (Objects.equals(configType.getTitle(), s1) && Objects.equals(convertorType, s2))
|
||||
|| (Objects.equals(convertorType.getTitle(), s1) && Objects.equals(configType, s2));
|
||||
}
|
||||
|
||||
/**
|
||||
* 将出入库公里标转换为正线标
|
||||
*
|
||||
* @param basisKilometer 出入库基准公里标
|
||||
* @param targetType 目标坐标系
|
||||
* @return 正线公里标数字
|
||||
*/
|
||||
public long convertorKilometer(KilometerSystem basisKilometer, CoordinateEnum targetType) {
|
||||
if (canConvertor(basisKilometer.getCoordinateSystem(), targetType)) {
|
||||
throw new IllegalArgumentException(
|
||||
String.format(
|
||||
"非【%s<>%s】转换方法", basisKilometer.getCoordinateSystem(), targetType.getTitle()));
|
||||
}
|
||||
// x-y = w-z => w = x - y + z, yz代表原点位置,x代表传入坐标
|
||||
if (targetType.equals(configType)) {
|
||||
return basisKilometer.getKilometer() - configCoordinate + convertorCoordinate;
|
||||
} else {
|
||||
return basisKilometer.getKilometer() - convertorCoordinate + configCoordinate;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换类型,这里根据两个坐标系来定
|
||||
*
|
||||
* @return 类型字符串
|
||||
*/
|
||||
private String getConvertorKey() {
|
||||
return generateConvertorKey(configType, convertorType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成转换Key
|
||||
*
|
||||
* @param type1 坐标类型1
|
||||
* @param type2 坐标类型2
|
||||
* @return 转换key
|
||||
*/
|
||||
private static String generateConvertorKey(CoordinateEnum type1, CoordinateEnum type2) {
|
||||
int oneIndex = type1.ordinal(), twoIndex = type2.ordinal();
|
||||
return oneIndex < twoIndex
|
||||
? type1.getTitle() + "_" + type2.getTitle()
|
||||
: type2.getTitle() + "_" + type1.getTitle();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2083,8 +2083,8 @@ public final class DeviceInfoProto {
|
||||
|
||||
}
|
||||
|
||||
public interface SwitchOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:state.Switch)
|
||||
public interface TurnoutOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:state.Turnout)
|
||||
com.google.protobuf.MessageOrBuilder {
|
||||
|
||||
/**
|
||||
@ -2189,18 +2189,18 @@ public final class DeviceInfoProto {
|
||||
* 道岔
|
||||
* </pre>
|
||||
*
|
||||
* Protobuf type {@code state.Switch}
|
||||
* Protobuf type {@code state.Turnout}
|
||||
*/
|
||||
public static final class Switch extends
|
||||
public static final class Turnout extends
|
||||
com.google.protobuf.GeneratedMessageV3 implements
|
||||
// @@protoc_insertion_point(message_implements:state.Switch)
|
||||
SwitchOrBuilder {
|
||||
// @@protoc_insertion_point(message_implements:state.Turnout)
|
||||
TurnoutOrBuilder {
|
||||
private static final long serialVersionUID = 0L;
|
||||
// Use Switch.newBuilder() to construct.
|
||||
private Switch(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
|
||||
// Use Turnout.newBuilder() to construct.
|
||||
private Turnout(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
|
||||
super(builder);
|
||||
}
|
||||
private Switch() {
|
||||
private Turnout() {
|
||||
id_ = "";
|
||||
code_ = "";
|
||||
kilometerSystem_ = java.util.Collections.emptyList();
|
||||
@ -2211,20 +2211,20 @@ public final class DeviceInfoProto {
|
||||
@SuppressWarnings({"unused"})
|
||||
protected java.lang.Object newInstance(
|
||||
UnusedPrivateParameter unused) {
|
||||
return new Switch();
|
||||
return new Turnout();
|
||||
}
|
||||
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return club.joylink.xiannccda.dto.protos.DeviceInfoProto.internal_static_state_Switch_descriptor;
|
||||
return club.joylink.xiannccda.dto.protos.DeviceInfoProto.internal_static_state_Turnout_descriptor;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return club.joylink.xiannccda.dto.protos.DeviceInfoProto.internal_static_state_Switch_fieldAccessorTable
|
||||
return club.joylink.xiannccda.dto.protos.DeviceInfoProto.internal_static_state_Turnout_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch.class, club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch.Builder.class);
|
||||
club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout.class, club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout.Builder.class);
|
||||
}
|
||||
|
||||
public static final int ID_FIELD_NUMBER = 1;
|
||||
@ -2481,10 +2481,10 @@ public final class DeviceInfoProto {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch)) {
|
||||
if (!(obj instanceof club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout)) {
|
||||
return super.equals(obj);
|
||||
}
|
||||
club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch other = (club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch) obj;
|
||||
club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout other = (club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout) obj;
|
||||
|
||||
if (!getId()
|
||||
.equals(other.getId())) return false;
|
||||
@ -2522,44 +2522,44 @@ public final class DeviceInfoProto {
|
||||
return hash;
|
||||
}
|
||||
|
||||
public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch parseFrom(
|
||||
public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout parseFrom(
|
||||
java.nio.ByteBuffer data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch parseFrom(
|
||||
public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout 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.Switch parseFrom(
|
||||
public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout parseFrom(
|
||||
com.google.protobuf.ByteString data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch parseFrom(
|
||||
public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout 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.Switch parseFrom(byte[] data)
|
||||
public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout parseFrom(byte[] data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch parseFrom(
|
||||
public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout 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.Switch parseFrom(java.io.InputStream input)
|
||||
public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout 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.Switch parseFrom(
|
||||
public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout parseFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
@ -2567,26 +2567,26 @@ public final class DeviceInfoProto {
|
||||
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||
}
|
||||
|
||||
public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch parseDelimitedFrom(java.io.InputStream input)
|
||||
public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout 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.Switch parseDelimitedFrom(
|
||||
public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout 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.Switch parseFrom(
|
||||
public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout 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.Switch parseFrom(
|
||||
public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout parseFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
@ -2599,7 +2599,7 @@ public final class DeviceInfoProto {
|
||||
public static Builder newBuilder() {
|
||||
return DEFAULT_INSTANCE.toBuilder();
|
||||
}
|
||||
public static Builder newBuilder(club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch prototype) {
|
||||
public static Builder newBuilder(club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout prototype) {
|
||||
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
|
||||
}
|
||||
@java.lang.Override
|
||||
@ -2619,26 +2619,26 @@ public final class DeviceInfoProto {
|
||||
* 道岔
|
||||
* </pre>
|
||||
*
|
||||
* Protobuf type {@code state.Switch}
|
||||
* Protobuf type {@code state.Turnout}
|
||||
*/
|
||||
public static final class Builder extends
|
||||
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
|
||||
// @@protoc_insertion_point(builder_implements:state.Switch)
|
||||
club.joylink.xiannccda.dto.protos.DeviceInfoProto.SwitchOrBuilder {
|
||||
// @@protoc_insertion_point(builder_implements:state.Turnout)
|
||||
club.joylink.xiannccda.dto.protos.DeviceInfoProto.TurnoutOrBuilder {
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return club.joylink.xiannccda.dto.protos.DeviceInfoProto.internal_static_state_Switch_descriptor;
|
||||
return club.joylink.xiannccda.dto.protos.DeviceInfoProto.internal_static_state_Turnout_descriptor;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return club.joylink.xiannccda.dto.protos.DeviceInfoProto.internal_static_state_Switch_fieldAccessorTable
|
||||
return club.joylink.xiannccda.dto.protos.DeviceInfoProto.internal_static_state_Turnout_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch.class, club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch.Builder.class);
|
||||
club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout.class, club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout.Builder.class);
|
||||
}
|
||||
|
||||
// Construct using club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch.newBuilder()
|
||||
// Construct using club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout.newBuilder()
|
||||
private Builder() {
|
||||
|
||||
}
|
||||
@ -2668,17 +2668,17 @@ public final class DeviceInfoProto {
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptorForType() {
|
||||
return club.joylink.xiannccda.dto.protos.DeviceInfoProto.internal_static_state_Switch_descriptor;
|
||||
return club.joylink.xiannccda.dto.protos.DeviceInfoProto.internal_static_state_Turnout_descriptor;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch getDefaultInstanceForType() {
|
||||
return club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch.getDefaultInstance();
|
||||
public club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout getDefaultInstanceForType() {
|
||||
return club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout.getDefaultInstance();
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch build() {
|
||||
club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch result = buildPartial();
|
||||
public club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout build() {
|
||||
club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout result = buildPartial();
|
||||
if (!result.isInitialized()) {
|
||||
throw newUninitializedMessageException(result);
|
||||
}
|
||||
@ -2686,15 +2686,15 @@ public final class DeviceInfoProto {
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch buildPartial() {
|
||||
club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch result = new club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch(this);
|
||||
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.Switch 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_);
|
||||
@ -2711,7 +2711,7 @@ public final class DeviceInfoProto {
|
||||
result.convertKilometer_ = convertKilometer_;
|
||||
}
|
||||
|
||||
private void buildPartial0(club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch result) {
|
||||
private void buildPartial0(club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout result) {
|
||||
int from_bitField0_ = bitField0_;
|
||||
if (((from_bitField0_ & 0x00000001) != 0)) {
|
||||
result.id_ = id_;
|
||||
@ -2723,16 +2723,16 @@ public final class DeviceInfoProto {
|
||||
|
||||
@java.lang.Override
|
||||
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||
if (other instanceof club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch) {
|
||||
return mergeFrom((club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch)other);
|
||||
if (other instanceof club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout) {
|
||||
return mergeFrom((club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout)other);
|
||||
} else {
|
||||
super.mergeFrom(other);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public Builder mergeFrom(club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch other) {
|
||||
if (other == club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch.getDefaultInstance()) return this;
|
||||
public Builder mergeFrom(club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout other) {
|
||||
if (other == club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout.getDefaultInstance()) return this;
|
||||
if (!other.getId().isEmpty()) {
|
||||
id_ = other.id_;
|
||||
bitField0_ |= 0x00000001;
|
||||
@ -3438,23 +3438,23 @@ public final class DeviceInfoProto {
|
||||
}
|
||||
|
||||
|
||||
// @@protoc_insertion_point(builder_scope:state.Switch)
|
||||
// @@protoc_insertion_point(builder_scope:state.Turnout)
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(class_scope:state.Switch)
|
||||
private static final club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch DEFAULT_INSTANCE;
|
||||
// @@protoc_insertion_point(class_scope:state.Turnout)
|
||||
private static final club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout DEFAULT_INSTANCE;
|
||||
static {
|
||||
DEFAULT_INSTANCE = new club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch();
|
||||
DEFAULT_INSTANCE = new club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout();
|
||||
}
|
||||
|
||||
public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch getDefaultInstance() {
|
||||
public static club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout getDefaultInstance() {
|
||||
return DEFAULT_INSTANCE;
|
||||
}
|
||||
|
||||
private static final com.google.protobuf.Parser<Switch>
|
||||
PARSER = new com.google.protobuf.AbstractParser<Switch>() {
|
||||
private static final com.google.protobuf.Parser<Turnout>
|
||||
PARSER = new com.google.protobuf.AbstractParser<Turnout>() {
|
||||
@java.lang.Override
|
||||
public Switch parsePartialFrom(
|
||||
public Turnout parsePartialFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
@ -3473,17 +3473,17 @@ public final class DeviceInfoProto {
|
||||
}
|
||||
};
|
||||
|
||||
public static com.google.protobuf.Parser<Switch> parser() {
|
||||
public static com.google.protobuf.Parser<Turnout> parser() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Parser<Switch> getParserForType() {
|
||||
public com.google.protobuf.Parser<Turnout> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public club.joylink.xiannccda.dto.protos.DeviceInfoProto.Switch getDefaultInstanceForType() {
|
||||
public club.joylink.xiannccda.dto.protos.DeviceInfoProto.Turnout getDefaultInstanceForType() {
|
||||
return DEFAULT_INSTANCE;
|
||||
}
|
||||
|
||||
@ -3495,10 +3495,10 @@ public final class DeviceInfoProto {
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_state_Section_fieldAccessorTable;
|
||||
private static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_state_Switch_descriptor;
|
||||
internal_static_state_Turnout_descriptor;
|
||||
private static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_state_Switch_fieldAccessorTable;
|
||||
internal_static_state_Turnout_fieldAccessorTable;
|
||||
|
||||
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||
getDescriptor() {
|
||||
@ -3514,11 +3514,11 @@ public final class DeviceInfoProto {
|
||||
"a.Section.SectionType\022 \n\010children\030\004 \003(\0132" +
|
||||
"\016.state.Section\0225\n\017kilometerSystem\030\005 \003(\013" +
|
||||
"2\034.graphicData.KilometerSystem\022\030\n\020conver" +
|
||||
"tKilometer\030\007 \003(\003\"s\n\006Switch\022\n\n\002id\030\001 \001(\t\022\014" +
|
||||
"\n\004code\030\002 \001(\t\0225\n\017kilometerSystem\030\003 \003(\0132\034." +
|
||||
"graphicData.KilometerSystem\022\030\n\020convertKi" +
|
||||
"lometer\030\004 \003(\003B4\n!club.joylink.xiannccda." +
|
||||
"dto.protosB\017DeviceInfoProtob\006proto3"
|
||||
"tKilometer\030\007 \003(\003\"t\n\007Turnout\022\n\n\002id\030\001 \001(\t\022" +
|
||||
"\014\n\004code\030\002 \001(\t\0225\n\017kilometerSystem\030\003 \003(\0132\034" +
|
||||
".graphicData.KilometerSystem\022\030\n\020convertK" +
|
||||
"ilometer\030\004 \003(\003B4\n!club.joylink.xiannccda" +
|
||||
".dto.protosB\017DeviceInfoProtob\006proto3"
|
||||
};
|
||||
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||
.internalBuildGeneratedFileFrom(descriptorData,
|
||||
@ -3531,11 +3531,11 @@ public final class DeviceInfoProto {
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_state_Section_descriptor,
|
||||
new java.lang.String[] { "Id", "Code", "Type", "Children", "KilometerSystem", "ConvertKilometer", });
|
||||
internal_static_state_Switch_descriptor =
|
||||
internal_static_state_Turnout_descriptor =
|
||||
getDescriptor().getMessageTypes().get(1);
|
||||
internal_static_state_Switch_fieldAccessorTable = new
|
||||
internal_static_state_Turnout_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_state_Switch_descriptor,
|
||||
internal_static_state_Turnout_descriptor,
|
||||
new java.lang.String[] { "Id", "Code", "KilometerSystem", "ConvertKilometer", });
|
||||
club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.getDescriptor();
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1 +1 @@
|
||||
Subproject commit 269d2b054f463bec5abf0330dfdb5cd48f66a8f2
|
||||
Subproject commit 8fd000d45907f94410786c3bd6c1ab37edbe91e8
|
Loading…
Reference in New Issue
Block a user