From 5ebcb9608304e5008f1290ee509377aa247bc987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B?= <1063331231@qq.com> Date: Fri, 13 Jun 2025 18:08:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E6=A3=80=E5=90=8E=E6=8A=8A=E9=A3=8E?= =?UTF-8?q?=E6=89=87=E5=92=8C=E5=8A=A0=E7=83=AD=E5=85=B3=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sgs/app/cmd/selftest/MoveTestCommand.java | 28 +++++++--------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/iflytop/sgs/app/cmd/selftest/MoveTestCommand.java b/src/main/java/com/iflytop/sgs/app/cmd/selftest/MoveTestCommand.java index db36fa2..84d17bb 100644 --- a/src/main/java/com/iflytop/sgs/app/cmd/selftest/MoveTestCommand.java +++ b/src/main/java/com/iflytop/sgs/app/cmd/selftest/MoveTestCommand.java @@ -24,6 +24,9 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import java.util.concurrent.CompletableFuture; /** @@ -41,7 +44,6 @@ public class MoveTestCommand extends BaseCommandHandler { private final DeviceStateService deviceStateService; private final WebSocketSender webSocketService; private final DeviceSensorService deviceSensorService; - private final SystemConfigService systemConfigService; @Override public CompletableFuture handle(CmdDTO cmdDTO) { @@ -77,27 +79,13 @@ public class MoveTestCommand extends BaseCommandHandler { transferModuleService.transferZMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), feedAreaTrayPoint3D.getZ());//Z轴下降至夹取点,使托盘落入上料区 transferModuleService.transferZMoveZero(cmdDTO.getCommandId(), cmdDTO.getCommand());//Z轴抬升至最高 webSocketService.pushSelfMoveTest(SelfMoveTestGenerator.generateJson(cmdDTO.getCommandId(), cmdDTO.getCommand(), "4、z轴电机检测完毕", 100, "success")); - CompletableFuture.runAsync(() -> { + HeatModuleCode[] heatModuleCodes = HeatModuleCode.values(); + Arrays.stream(heatModuleCodes).toList().forEach(heatModuleCode -> {//关闭所有的加热和风扇 try { - boolean preFillFlag = systemConfigService.getSystemConfigBooleanByCode(SystemConfigCode.pre_fill_when_open_service); - Point3D heatArea1TrayClawPoint = devicePositionService.getPosition(DevicePositionCode.heatArea1TrayClawPoint).getPoint3D();//加热位1坐标 - Double liquidAreaPreFillPoint = devicePositionService.getPosition(DevicePositionCode.liquidAreaPreFillPoint).getPositon(); //预充时加液臂下降位置 - Double preFillDistance = systemConfigService.getSystemConfigDoubleByCode(SystemConfigCode.pre_fill_distance_when_open_service);//预充距离 - if (preFillFlag) { - transferModuleService.transferXMove(heatArea1TrayClawPoint.getX());//转运模块移动至加热位1 - solutionModuleService.solutionMotorMove(liquidAreaPreFillPoint);//加液机械臂下降至至预充点位 - solutionModuleService.liquidValveSwitch(SolutionCode.waste);//电磁阀对应通道打开 - solutionModuleService.liquidPumpMove(-preFillDistance);//排空 - solutionModuleService.liquidValveSwitch(SolutionCode.thin);//电磁阀对应通道打开 - solutionModuleService.liquidPumpMove(preFillDistance);//预充 - solutionModuleService.liquidValveSwitch(SolutionCode.thick);//电磁阀对应通道打开 - solutionModuleService.liquidPumpMove(preFillDistance);//预充 - solutionModuleService.liquidValveSwitch(SolutionCode.water);//电磁阀对应通道打开 - solutionModuleService.liquidPumpMove(preFillDistance);//预充 - solutionModuleService.solutionMotorMoveZero();//回原点 - } + heatModuleService.fanClose(heatModuleCode);//关闭风扇 + heatModuleService.heatRodClose(heatModuleCode);//打开加热棒 } catch (Exception e) { - log.error("设备开机预充失败"); + log.error("自检关闭风扇和加热棒{},{}", heatModuleCode, e.getMessage()); } });