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:
// 设置计轴失效ARB
if (Objects.nonNull(section.getParent())) {
section.getParent().judgeAsNctOccupied();
section.getParent().judgeAsNctOccupied(simulation);
} else {
section.judgeAsNctOccupied();
section.judgeAsNctOccupied(simulation);
}
break;
case Section_Fault_Unlock:

View File

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

View File

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

View File

@ -1,6 +1,7 @@
package club.joylink.rtss.simulation.cbtc.data.map;
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.support.RoutePath;
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()) {
return;
}
this.setNctOccupied(true);
if (this.isSwitchAxleCounterSection()) { // 道岔计轴区段
nctOccupiedBySwitchPosition();
nctOccupiedBySwitchPosition(simulation);
} else if (!CollectionUtils.isEmpty(this.logicList)) {
for (Section logic : this.logicList) {
logic.setNctOccupied(true);
@ -841,25 +843,42 @@ public class Section extends DelayUnlockDevice {
/**
* 根据道岔位置设置非通信车占用
* @param simulation
*/
private void nctOccupiedBySwitchPosition() {
private void nctOccupiedBySwitchPosition(Simulation simulation) {
List<Switch> relSwitchList = this.getRelSwitchList();
for (Switch aSwitch : relSwitchList) {
aSwitch.getA().setNctOccupied(true);
if (aSwitch.isPosN()) {
aSwitch.getB().setNctOccupied(true);
aSwitch.getC().setNctOccupied(false);
} else if (aSwitch.isPosR()) {
aSwitch.getC().setNctOccupied(true);
aSwitch.getB().setNctOccupied(false);
} else {
aSwitch.getB().setNctOccupied(true);
aSwitch.getC().setNctOccupied(true);
if (relSwitchList.size() == 2 && simulation.getRepository().getConfig().isSwitchSingleHandle()) {
// 道岔计轴区段两个道岔有一个反位
if (!relSwitchList.stream().allMatch(Switch::isPosN)) {
for (Switch aSwitch : relSwitchList) {
if (aSwitch.isPosN()) {
continue;
}
setSwitchNctOccupied(aSwitch);
}
Section cross = queryCross();
if (cross != null) {
cross.crossJudgeOccupied();
}
return;
}
}
Section cross = queryCross();
if (cross != null) {
cross.crossJudgeOccupied();
for (Switch aSwitch : relSwitchList) {
setSwitchNctOccupied(aSwitch);
}
}
private void setSwitchNctOccupied(Switch aSwitch) {
aSwitch.getA().setNctOccupied(true);
if (aSwitch.isPosN()) {
aSwitch.getB().setNctOccupied(true);
aSwitch.getC().setNctOccupied(false);
} else if (aSwitch.isPosR()) {
aSwitch.getC().setNctOccupied(true);
aSwitch.getB().setNctOccupied(false);
} else {
aSwitch.getB().setNctOccupied(true);
aSwitch.getC().setNctOccupied(true);
}
}