修改:IBP盘bug

This commit is contained in:
joylink_zhangsai 2021-06-17 17:53:17 +08:00
parent e51130b690
commit 737edb9889
2 changed files with 11 additions and 4 deletions

View File

@ -1,5 +1,6 @@
package club.joylink.rtss.services;
import club.joylink.rtss.exception.BaseException;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.services.publishData.IbpService;
import club.joylink.rtss.simulation.cbtc.ATS.operation.handler.StandOperateHandler;
@ -143,7 +144,7 @@ public class VirtualRealityIbpService implements IVirtualRealityIbpService {
ibp.queryByType(VirtualRealityIbp.Mean.SXYS).forEach(ele -> ele.setOn(!ele.isOn()));
break;
case AXLE_RESET:
ciApiService.axleReset(simulation, buttonCode);
ciApiService.axleReset(simulation, button.getSectionCode());
element.setOn(true);
break;
case AXLE_PRE_RESET:
@ -224,7 +225,11 @@ public class VirtualRealityIbpService implements IVirtualRealityIbpService {
if (!button.isPressed())
continue;
if (!now.isBefore(button.getPressTime().plusSeconds(3))) { //按下按钮三秒时/
ciApiService.axlePreReset(simulation, button.getSectionCode());
try {
ciApiService.axlePreReset(simulation, button.getSectionCode());
} catch (BaseException e) {
e.printStackTrace();
}
}
}
}

View File

@ -567,7 +567,8 @@ public class CiApiServiceImpl implements CiApiService {
@Override
public void axlePreReset(Simulation simulation, String sectionCode) {
VirtualRealitySectionAxleCounter virtualAxleCounter = getAxleCounterAndCheck4Reset(simulation, sectionCode);
if (!virtualAxleCounter.isOccupy())
return;
virtualAxleCounter.preReset();
}
@ -624,6 +625,8 @@ public class CiApiServiceImpl implements CiApiService {
@Override
public void axleReset(Simulation simulation, String sectionCode) {
VirtualRealitySectionAxleCounter axle = getAxleCounterAndCheck4Reset(simulation, sectionCode);
if (!axle.isOccupy())
return;
axle.axleReset();
}
@ -645,7 +648,6 @@ public class CiApiServiceImpl implements CiApiService {
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(axleSection != null && axleSection.isAxleCounter(),
section.debugStr() + "不是计轴区段也不归属于任何计轴区段");
VirtualRealitySectionAxleCounter virtualAxleCounter = axleSection.getVirtualAxleCounter();
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(virtualAxleCounter.isOccupy(), section.debugStr() + "计轴未占用,无需预复位");
if (simulation.getRepository().getConfig().isStationPreResetBeforeAxlePreReset()) {
Station deviceStation = axleSection.getDeviceStation();
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertNotNull(deviceStation, section.debugStr() + "没有所属集中站");