修改开放引导信号时的判断信号机接近区段占用逻辑
This commit is contained in:
parent
8cc9e9f3d2
commit
70b01e3f5f
@ -235,9 +235,8 @@ public class SwitchOperateHandler {
|
|||||||
/**道岔计轴预复位*/
|
/**道岔计轴预复位*/
|
||||||
@OperateHandlerMapping(type = Operation.Type.Switch_Axle_Pre_Reset)
|
@OperateHandlerMapping(type = Operation.Type.Switch_Axle_Pre_Reset)
|
||||||
public void axlePreReset(Simulation simulation, String switchCode) {
|
public void axlePreReset(Simulation simulation, String switchCode) {
|
||||||
// todo
|
Switch aSwitch = simulation.getRepository().getByCode(switchCode, Switch.class);
|
||||||
throw new SimulationException(SimulationExceptionType.Operation_Handle_FAIL, "功能暂未实现");
|
ciApiService.axlePreReset(simulation, aSwitch.getA().getParent().getCode());
|
||||||
// log.debug("仿真[{}] : 道岔[{}]计轴预复位",simulation.getGroup(),switchCode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**区故解*/
|
/**区故解*/
|
||||||
|
@ -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.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()) {
|
if (config.isGuideNeedRouteSettingFirst()) {
|
||||||
signalService.openGuideSignal(simulation, signal);
|
signalService.openGuideSignal(simulation, signal);
|
||||||
|
@ -58,7 +58,9 @@ public class Section extends MayOutOfOrderDevice {
|
|||||||
*/
|
*/
|
||||||
private boolean physical;
|
private boolean physical;
|
||||||
|
|
||||||
/**是否岔心*/
|
/**
|
||||||
|
* 是否岔心
|
||||||
|
*/
|
||||||
private boolean cross;
|
private boolean cross;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -395,6 +397,9 @@ public class Section extends MayOutOfOrderDevice {
|
|||||||
if (!this.isInvalid()) {
|
if (!this.isInvalid()) {
|
||||||
this.trainRight = right;
|
this.trainRight = right;
|
||||||
this.nctOccupied = true;
|
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) &&
|
!CollectionUtils.isEmpty(this.logicList) &&
|
||||||
this.logicList.get(0).isSwitchTrack();
|
this.logicList.get(0).isSwitchTrack();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 一般计轴区段
|
* 一般计轴区段
|
||||||
*
|
*
|
||||||
@ -461,6 +467,7 @@ public class Section extends MayOutOfOrderDevice {
|
|||||||
public boolean isSectionOfCross() {
|
public boolean isSectionOfCross() {
|
||||||
return this.physical && this.axleCounter && Objects.nonNull(parent) && parent.isCross();
|
return this.physical && this.axleCounter && Objects.nonNull(parent) && parent.isCross();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否通信车占用
|
* 是否通信车占用
|
||||||
*
|
*
|
||||||
|
@ -452,6 +452,25 @@ public class Switch extends MayOutOfOrderDevice {
|
|||||||
VirtualRealitySwitch.Fault.SQUEEZE.fix(vrSwitch);
|
VirtualRealitySwitch.Fault.SQUEEZE.fix(vrSwitch);
|
||||||
vrSwitch.startSetting(true);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user