From d23a55bd418b04a7f6fd0b70147ebd02533bd383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=87=A4=E5=90=89?= Date: Thu, 15 May 2025 19:23:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=B0=E5=9C=BA=E4=BB=A3=E7=A0=81=E5=90=8C?= =?UTF-8?q?=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/iflytop/gd/app/cmd/MoveToHeatAreaCommand.java | 3 +++ src/main/java/com/iflytop/gd/app/cmd/MoveToSolutionAreaCommand.java | 3 +++ 2 files changed, 6 insertions(+) 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); } });