传输信号机不构建地图数据
This commit is contained in:
parent
e00262ceb9
commit
a4e4884721
@ -930,38 +930,6 @@ public class MapDeviceBuilder {
|
|||||||
deviceMap.put(virtualRealitySignal.getCode(), virtualRealitySignal);
|
deviceMap.put(virtualRealitySignal.getCode(), virtualRealitySignal);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
signalList.stream().filter(signalVO -> Signal.SignalType.TRANSMISSION.equals(signalVO.getType())).forEach(signalVO->{
|
|
||||||
Signal signal = new Signal(signalVO.getCode(), signalVO.getUniqueName());
|
|
||||||
if (Objects.nonNull(elementMap.get(signal.getCode()))) {
|
|
||||||
errMsgList.add(String.format("编码为[%s]的信号机不唯一", signal.getCode()));
|
|
||||||
}
|
|
||||||
elementMap.put(signal.getCode(), signal);
|
|
||||||
// 检查关联信号机
|
|
||||||
if (signalVO.getLinkSignalCode() == null) {
|
|
||||||
errMsgList.add(String.format("传输信号机[%s(%s)]未关联信号机", signal.getName(), signal.getCode()));
|
|
||||||
} else {
|
|
||||||
Signal linkSignal = (Signal) elementMap.get(signalVO.getLinkSignalCode());
|
|
||||||
if (linkSignal == null) {
|
|
||||||
errMsgList.add(String.format("传输信号机[%s(%s)]关联的信号机不存在", signal.getName(), signal.getCode()));
|
|
||||||
} else {
|
|
||||||
signal.setLinkSignal(linkSignal);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 检查关联区段及偏移量
|
|
||||||
Section section = (Section) elementMap.get(signalVO.getSectionCode());
|
|
||||||
if (Objects.isNull(section)) {
|
|
||||||
errMsgList.add(String.format("信号机[%s(%s)]未关联区段或关联区段不存在", signal.getName(), signal.getCode()));
|
|
||||||
} else {
|
|
||||||
if (Objects.isNull(signalVO.getSectionOffset()) ||
|
|
||||||
(Objects.nonNull(section) && Objects.nonNull(section.getLen()) &&
|
|
||||||
(signalVO.getSectionOffset() < 0 || signalVO.getSectionOffset() > section.getLen()))) {
|
|
||||||
errMsgList.add(String.format("信号机[%s(%s)]的区段偏移量未设置或数据异常[%s]",
|
|
||||||
signal.getName(), signal.getCode(), signalVO.getSectionOffset()));
|
|
||||||
} else {
|
|
||||||
signal.setOffset(signalVO.getSectionOffset());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user