Merge remote-tracking branch 'origin/test' into dev

This commit is contained in:
joylink_zhangsai 2021-12-01 18:29:49 +08:00
commit a7acb9929d
4 changed files with 40 additions and 21 deletions

View File

@ -118,9 +118,9 @@ public class SectionGeneratorNew implements GeneratorNew {
case Section_Confirm_Axis_Valid: case Section_Confirm_Axis_Valid:
// 设置计轴失效ARB // 设置计轴失效ARB
if (Objects.nonNull(section.getParent())) { if (Objects.nonNull(section.getParent())) {
section.getParent().judgeAsNctOccupied(); section.getParent().judgeAsNctOccupied(simulation);
} else { } else {
section.judgeAsNctOccupied(); section.judgeAsNctOccupied(simulation);
} }
break; break;
case Section_Fault_Unlock: case Section_Fault_Unlock:

View File

@ -115,7 +115,7 @@ public class SwitchGeneratorNew implements GeneratorNew {
} }
case Switch_Confirm_Axis_Valid:{ case Switch_Confirm_Axis_Valid:{
// 背景为道岔计轴失效 // 背景为道岔计轴失效
aSwitch.getA().getParent().judgeAsNctOccupied(); aSwitch.getA().getParent().judgeAsNctOccupied(simulation);
break; break;
} }
case Switch_Squeeze_Recovery: case Switch_Squeeze_Recovery:

View File

@ -141,7 +141,7 @@ public class AtpSectionService {
section.setFault(Section.AxleFault.FAULT); section.setFault(Section.AxleFault.FAULT);
} }
} else if (Section.AxleFault.FAULT.equals(section.getFault()) && section.getVirtualAxleCounter().isOccupy()) { } else if (Section.AxleFault.FAULT.equals(section.getFault()) && section.getVirtualAxleCounter().isOccupy()) {
section.judgeAsNctOccupied(); section.judgeAsNctOccupied(simulation);
} }
// if (/*!section.isInvalid() &&*/ section.isNctOccupied()) { // if (/*!section.isInvalid() &&*/ section.isNctOccupied()) {
// if (!sectionList.contains(section)) { // if (!sectionList.contains(section)) {

View File

@ -1,6 +1,7 @@
package club.joylink.rtss.simulation.cbtc.data.map; package club.joylink.rtss.simulation.cbtc.data.map;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum; import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository; import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
import club.joylink.rtss.simulation.cbtc.data.support.RoutePath; import club.joylink.rtss.simulation.cbtc.data.support.RoutePath;
import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition; import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition;
@ -824,14 +825,15 @@ public class Section extends DelayUnlockDevice {
/** /**
* 判定为非通信车占用 * 判定为非通信车占用
* @param simulation
*/ */
public void judgeAsNctOccupied() { public void judgeAsNctOccupied(Simulation simulation) {
if (!this.isAxleCounter()) { if (!this.isAxleCounter()) {
return; return;
} }
this.setNctOccupied(true); this.setNctOccupied(true);
if (this.isSwitchAxleCounterSection()) { // 道岔计轴区段 if (this.isSwitchAxleCounterSection()) { // 道岔计轴区段
nctOccupiedBySwitchPosition(); nctOccupiedBySwitchPosition(simulation);
} else if (!CollectionUtils.isEmpty(this.logicList)) { } else if (!CollectionUtils.isEmpty(this.logicList)) {
for (Section logic : this.logicList) { for (Section logic : this.logicList) {
logic.setNctOccupied(true); logic.setNctOccupied(true);
@ -841,10 +843,32 @@ public class Section extends DelayUnlockDevice {
/** /**
* 根据道岔位置设置非通信车占用 * 根据道岔位置设置非通信车占用
* @param simulation
*/ */
private void nctOccupiedBySwitchPosition() { private void nctOccupiedBySwitchPosition(Simulation simulation) {
List<Switch> relSwitchList = this.getRelSwitchList(); List<Switch> relSwitchList = this.getRelSwitchList();
if (relSwitchList.size() == 2 && simulation.getRepository().getConfig().isSwitchSingleHandle()) {
// 道岔计轴区段两个道岔有一个反位
if (!relSwitchList.stream().allMatch(Switch::isPosN)) {
for (Switch aSwitch : relSwitchList) { for (Switch aSwitch : relSwitchList) {
if (aSwitch.isPosN()) {
continue;
}
setSwitchNctOccupied(aSwitch);
}
Section cross = queryCross();
if (cross != null) {
cross.crossJudgeOccupied();
}
return;
}
}
for (Switch aSwitch : relSwitchList) {
setSwitchNctOccupied(aSwitch);
}
}
private void setSwitchNctOccupied(Switch aSwitch) {
aSwitch.getA().setNctOccupied(true); aSwitch.getA().setNctOccupied(true);
if (aSwitch.isPosN()) { if (aSwitch.isPosN()) {
aSwitch.getB().setNctOccupied(true); aSwitch.getB().setNctOccupied(true);
@ -857,11 +881,6 @@ public class Section extends DelayUnlockDevice {
aSwitch.getC().setNctOccupied(true); aSwitch.getC().setNctOccupied(true);
} }
} }
Section cross = queryCross();
if (cross != null) {
cross.crossJudgeOccupied();
}
}
/** /**
* 岔心判断占用 * 岔心判断占用