修改:IBP盘循环逻辑增加try-catch

This commit is contained in:
joylink_zhangsai 2021-06-17 18:01:45 +08:00
parent a6c43d601d
commit 8deff874d7

View File

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