调整设备名称转换的问题
This commit is contained in:
parent
660dee541b
commit
244a926fca
@ -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<String, Builder> allTrainInfoMaper = Maps.newConcurrentMap();
|
||||
private Map<String, TrainInfo.Builder> allTrainInfoMaper = Maps.newConcurrentMap();
|
||||
|
||||
/**
|
||||
* 增量的设备更新信息
|
||||
@ -80,6 +86,7 @@ public class TrainDataSource extends AbstractData {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置列车坐在设备的映射
|
||||
*
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user