diff --git a/src/main/java/club/joylink/xiannccda/ats/message/collect/datasource/TrainDataSource.java b/src/main/java/club/joylink/xiannccda/ats/message/collect/datasource/TrainDataSource.java index c28c229..a41a5a0 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/collect/datasource/TrainDataSource.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/collect/datasource/TrainDataSource.java @@ -3,7 +3,6 @@ package club.joylink.xiannccda.ats.message.collect.datasource; import club.joylink.xiannccda.ats.message.collect.DeviceStatusDataOperate; import club.joylink.xiannccda.dto.protos.TrainProto.TrainInfo; import club.joylink.xiannccda.dto.protos.TrainProto.TrainInfo.Builder; -import club.joylink.xiannccda.mock.message.Status.Train; import com.google.common.collect.BiMap; import com.google.common.collect.HashBasedTable; import com.google.common.collect.HashBiMap; @@ -14,12 +13,19 @@ import com.google.protobuf.Descriptors.FieldDescriptor; import com.google.protobuf.GeneratedMessageV3; import com.google.protobuf.Message; import com.google.protobuf.MessageOrBuilder; +import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; +import java.util.HashSet; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.TreeMap; +import java.util.TreeSet; import lombok.Getter; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; @Slf4j @@ -28,7 +34,7 @@ public class TrainDataSource extends AbstractData { /** * 所有设备状态信息 <列车类型 【这里用的message的类名:TrainInfo等】,<车组号,列车信息>> */ - private Map allTrainInfoMaper = Maps.newConcurrentMap(); + private Map allTrainInfoMaper = Maps.newConcurrentMap(); /** * 增量的设备更新信息 @@ -80,6 +86,7 @@ public class TrainDataSource extends AbstractData { } } + /** * 设置列车坐在设备的映射 * diff --git a/src/main/java/club/joylink/xiannccda/ats/message/line3/changer/TrackChanger.java b/src/main/java/club/joylink/xiannccda/ats/message/line3/changer/TrackChanger.java index fa8d4f0..d282ad1 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/line3/changer/TrackChanger.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/line3/changer/TrackChanger.java @@ -19,7 +19,7 @@ public class TrackChanger { @Override public String changeDeviceName(String sourceName) { - Pattern regex = Pattern.compile("^([A-Za-z]{1,2})([\\d]{1,2})3(.*?)([A-Z])$"); + Pattern regex = Pattern.compile("^([A-Za-z]{1,2})([\\d]{2})3(.*?)([A-Z])$"); // Pattern regex = Pattern.compile("^([A-Za-z]{1,2})([\\d]{2})3(.*?)([A-Z])$"); Matcher matcher = regex.matcher(sourceName); if (matcher.find()) { @@ -49,7 +49,7 @@ public class TrackChanger { @Override public String changeDeviceName(String sourceName) { - Pattern regex = Pattern.compile("^[A-Za-z]{1,2}([\\d]{1,2})3(.*?)$"); + Pattern regex = Pattern.compile("^[A-Za-z]{1,2}([\\d]{2})3(.*?)$"); Matcher matcher = regex.matcher(sourceName); if (matcher.find()) { String head = matcher.group(1);