修改开放引导信号时的判断信号机接近区段占用逻辑

This commit is contained in:
joylink_zhangsai 2021-01-22 17:29:50 +08:00
parent 8cc9e9f3d2
commit 70b01e3f5f
4 changed files with 33 additions and 5 deletions

View File

@ -235,9 +235,8 @@ public class SwitchOperateHandler {
/**道岔计轴预复位*/
@OperateHandlerMapping(type = Operation.Type.Switch_Axle_Pre_Reset)
public void axlePreReset(Simulation simulation, String switchCode) {
// todo
throw new SimulationException(SimulationExceptionType.Operation_Handle_FAIL, "功能暂未实现");
// log.debug("仿真[{}] : 道岔[{}]计轴预复位",simulation.getGroup(),switchCode);
Switch aSwitch = simulation.getRepository().getByCode(switchCode, Switch.class);
ciApiService.axlePreReset(simulation, aSwitch.getA().getParent().getCode());
}
/**区故解*/

View File

@ -380,7 +380,10 @@ public class CiApiServiceImpl implements CiApiService {
}
}
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(signal.isClose(), String.format("信号机[%s]需处于关闭状态", signal.getCode()));
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(signal.isApproachOccupy(), String.format("对%s开放引导操作失败接近区段没有列车占用", signal.getName()));
boolean signalApproachOccupied = signal.getApproachPathList()
.stream().anyMatch(sectionPath -> sectionPath.getLogicList().stream().anyMatch(Section::isOccupied));
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(signalApproachOccupied,
String.format("对%s开放引导操作失败接近区段没有列车占用", signal.getName()));
//办理引导进路或开放引导信号
if (config.isGuideNeedRouteSettingFirst()) {
signalService.openGuideSignal(simulation, signal);

View File

@ -58,7 +58,9 @@ public class Section extends MayOutOfOrderDevice {
*/
private boolean physical;
/**是否岔心*/
/**
* 是否岔心
*/
private boolean cross;
/**
@ -395,6 +397,9 @@ public class Section extends MayOutOfOrderDevice {
if (!this.isInvalid()) {
this.trainRight = right;
this.nctOccupied = true;
// if (!CollectionUtils.isEmpty(logicList)) {
// logicList.forEach(logic -> logic.axleCounterOccupy(right));
// }
}
}
@ -444,6 +449,7 @@ public class Section extends MayOutOfOrderDevice {
!CollectionUtils.isEmpty(this.logicList) &&
this.logicList.get(0).isSwitchTrack();
}
/**
* 一般计轴区段
*
@ -461,6 +467,7 @@ public class Section extends MayOutOfOrderDevice {
public boolean isSectionOfCross() {
return this.physical && this.axleCounter && Objects.nonNull(parent) && parent.isCross();
}
/**
* 是否通信车占用
*

View File

@ -452,6 +452,25 @@ public class Switch extends MayOutOfOrderDevice {
VirtualRealitySwitch.Fault.SQUEEZE.fix(vrSwitch);
vrSwitch.startSetting(true);
}
},
/**
* 计轴故障
*/
AXLE_FAULT{
@Override
public boolean apply(MayOutOfOrderDevice device) {
Switch aSwitch = (Switch) device;
Section section = aSwitch.getA().getParent();
return Section.AxleFault.FAULT.apply(section);
}
@Override
public void fix(MayOutOfOrderDevice device) {
Switch aSwitch = (Switch) device;
Section section = aSwitch.getA().getParent();
Section.AxleFault.FAULT.fix(section);
}
}
}
}