Merge remote-tracking branch 'origin/test' into dev
This commit is contained in:
commit
a7acb9929d
@ -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:
|
||||||
|
@ -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:
|
||||||
|
@ -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)) {
|
||||||
|
@ -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,25 +843,42 @@ 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();
|
||||||
for (Switch aSwitch : relSwitchList) {
|
if (relSwitchList.size() == 2 && simulation.getRepository().getConfig().isSwitchSingleHandle()) {
|
||||||
aSwitch.getA().setNctOccupied(true);
|
// 道岔计轴区段两个道岔有一个反位
|
||||||
if (aSwitch.isPosN()) {
|
if (!relSwitchList.stream().allMatch(Switch::isPosN)) {
|
||||||
aSwitch.getB().setNctOccupied(true);
|
for (Switch aSwitch : relSwitchList) {
|
||||||
aSwitch.getC().setNctOccupied(false);
|
if (aSwitch.isPosN()) {
|
||||||
} else if (aSwitch.isPosR()) {
|
continue;
|
||||||
aSwitch.getC().setNctOccupied(true);
|
}
|
||||||
aSwitch.getB().setNctOccupied(false);
|
setSwitchNctOccupied(aSwitch);
|
||||||
} else {
|
}
|
||||||
aSwitch.getB().setNctOccupied(true);
|
Section cross = queryCross();
|
||||||
aSwitch.getC().setNctOccupied(true);
|
if (cross != null) {
|
||||||
|
cross.crossJudgeOccupied();
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Section cross = queryCross();
|
for (Switch aSwitch : relSwitchList) {
|
||||||
if (cross != null) {
|
setSwitchNctOccupied(aSwitch);
|
||||||
cross.crossJudgeOccupied();
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user