This commit is contained in:
DU 2020-12-02 09:39:13 +08:00
commit f74b5822ba
3 changed files with 55 additions and 1 deletions

View File

@ -1074,9 +1074,40 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
private RouteFls buildNpFls(Switch aSwitch) {
RouteFls fls = new RouteFls(new SwitchElement(aSwitch, true));
// 暂时只生成一级侧防
Switch linkedSwitch = aSwitch.queryLinkedSwitch();
if (Objects.nonNull(linkedSwitch)) {
// 联动道岔存在联动道岔定位即为一级侧防
RouteFls.FlsElement flsElement = new RouteFls.FlsElement(new SwitchElement(linkedSwitch, true));
fls.addLevel1(flsElement);
} else {
// 无联动道岔则从道岔B区段向外查询第一个反向信号机和经过的路径道岔位置构成一级侧防
Section c = aSwitch.getC();
if (c.getLeftSection() == null && c.getRightSection() == null) {
// 尽头区段不需构成侧防
return null;
}
BusinessExceptionAssertEnum.DATA_ERROR.assertNotTrue(c.getLeftSection() != null && c.getRightSection() != null,
String.format("道岔区段[%s]关联区段关系异常,只能最多一边关联,实际两边都关联了区段", c.debugStr()));
boolean right = true;
Section section = c.getRightSection();
if (c.getLeftSection() != null) { // 左向区段存在方向向左
right = false;
section = c.getLeftSection();
}
while (Objects.nonNull(section)) {
Signal oppositeSignal = section.getSignalOf(!right);
if (Objects.nonNull(oppositeSignal)) {
Section firstSection = oppositeSignal.getSection().getSectionOf(oppositeSignal.isRight());
RouteFls.FlsElement flsElement;
if (firstSection.isSwitchTrack()) {
flsElement = new RouteFls.FlsElement(oppositeSignal, new SwitchElement(firstSection.getRelSwitch(), true));
} else {
flsElement = new RouteFls.FlsElement(oppositeSignal);
}
fls.addLevel1(flsElement);
}
}
}
return null;
}

View File

@ -3,6 +3,9 @@ package club.joylink.rtss.simulation;
import java.util.Set;
public class SimulationUser {
/**
* 仿真用户唯一标识并且是发布订阅消息时的用户唯一标识
*/
private String id;
/**
* 用户仿真消息订阅

View File

@ -3,6 +3,7 @@ package club.joylink.rtss.simulation.cbtc.data.map;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
import java.util.List;
/**
@ -26,6 +27,13 @@ public class RouteFls {
this.base = base;
}
public void addLevel1(FlsElement flsElement) {
if (level1List == null) {
level1List = new ArrayList<>();
}
level1List.add(flsElement);
}
/**
* 侧防元件
*/
@ -48,6 +56,18 @@ public class RouteFls {
*/
private SwitchElement fpae;
public FlsElement(SwitchElement switchElement) {
this.pSwitch = switchElement;
}
public FlsElement(Signal pSignal) {
this.pSignal = pSignal;
}
public FlsElement(Signal pSignal, SwitchElement fpae) {
this.pSignal = pSignal;
this.fpae = fpae;
}
}
}