Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/rtss-server into test
This commit is contained in:
commit
f74b5822ba
@ -1074,9 +1074,40 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
|
|||||||
|
|
||||||
private RouteFls buildNpFls(Switch aSwitch) {
|
private RouteFls buildNpFls(Switch aSwitch) {
|
||||||
RouteFls fls = new RouteFls(new SwitchElement(aSwitch, true));
|
RouteFls fls = new RouteFls(new SwitchElement(aSwitch, true));
|
||||||
|
// 暂时只生成一级侧防
|
||||||
Switch linkedSwitch = aSwitch.queryLinkedSwitch();
|
Switch linkedSwitch = aSwitch.queryLinkedSwitch();
|
||||||
if (Objects.nonNull(linkedSwitch)) {
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,9 @@ package club.joylink.rtss.simulation;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public class SimulationUser {
|
public class SimulationUser {
|
||||||
|
/**
|
||||||
|
* 仿真用户唯一标识,并且是发布订阅消息时的用户唯一标识
|
||||||
|
*/
|
||||||
private String id;
|
private String id;
|
||||||
/**
|
/**
|
||||||
* 用户仿真消息订阅
|
* 用户仿真消息订阅
|
||||||
|
@ -3,6 +3,7 @@ package club.joylink.rtss.simulation.cbtc.data.map;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -26,6 +27,13 @@ public class RouteFls {
|
|||||||
this.base = base;
|
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;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user