diff --git a/src/main/java/com/iflytop/gd/app/cmd/MoveToHeatAreaCommand.java b/src/main/java/com/iflytop/gd/app/cmd/MoveToHeatAreaCommand.java index 4b1ec35..0cc4740 100644 --- a/src/main/java/com/iflytop/gd/app/cmd/MoveToHeatAreaCommand.java +++ b/src/main/java/com/iflytop/gd/app/cmd/MoveToHeatAreaCommand.java @@ -41,6 +41,7 @@ public class MoveToHeatAreaCommand extends BaseCommandHandler { if (isExecuting.get()) { throw new AppException(ResultCode.COMMAND_ALREADY_EXECUTING); } + deviceStateService.setGantryArmStateIdle(true); isExecuting.set(true); String heatId = cmdDTO.getStringParam("heatId"); HeatModuleCode heatModuleId = HeatModuleCode.valueOf(heatId); @@ -51,6 +52,7 @@ public class MoveToHeatAreaCommand extends BaseCommandHandler { throw new AppException(ResultCode.TARGET_HEAT_MODULE_NO_TRAY); } }finally { + deviceStateService.setGantryArmStateIdle(false); isExecuting.set(false); } return runAsync(() -> { @@ -98,6 +100,7 @@ public class MoveToHeatAreaCommand extends BaseCommandHandler { deviceCommandUtilService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleId, trayLower);//下降加热位托盘 deviceStateService.setHeatModuleStateTrayStatus(heatModuleId, 1); } finally { + deviceStateService.setGantryArmStateIdle(false); isExecuting.set(false); } }); diff --git a/src/main/java/com/iflytop/gd/app/cmd/MoveToSolutionAreaCommand.java b/src/main/java/com/iflytop/gd/app/cmd/MoveToSolutionAreaCommand.java index bc6c688..d3eb455 100644 --- a/src/main/java/com/iflytop/gd/app/cmd/MoveToSolutionAreaCommand.java +++ b/src/main/java/com/iflytop/gd/app/cmd/MoveToSolutionAreaCommand.java @@ -40,6 +40,7 @@ public class MoveToSolutionAreaCommand extends BaseCommandHandler { if (isExecuting.get()) { throw new AppException(ResultCode.COMMAND_ALREADY_EXECUTING); } + deviceStateService.setGantryArmStateIdle(true); isExecuting.set(true); String heatId = cmdDTO.getStringParam("heatId"); HeatModuleCode heatModuleId = HeatModuleCode.valueOf(heatId); @@ -50,6 +51,7 @@ public class MoveToSolutionAreaCommand extends BaseCommandHandler { throw new AppException(ResultCode.TARGET_HEAT_MODULE_OCCUPIED); } }finally { + deviceStateService.setGantryArmStateIdle(false); isExecuting.set(false); } return runAsync(() -> { @@ -100,6 +102,7 @@ public class MoveToSolutionAreaCommand extends BaseCommandHandler { trayState.setInSolutionModule(true); deviceCommandUtilService.gantryZMoveBy(cmdDTO.getCommandId(), cmdDTO.getCommand(), -clawDescend);//抬升机械臂至托盘上方 }finally { + deviceStateService.setGantryArmStateIdle(false); isExecuting.set(false); } });