From 26e9ee8cb342c5f3e10555c23dd957e0449a2165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=87=A4=E5=90=89?= Date: Thu, 20 Feb 2025 15:36:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=B0=83=E6=95=B4=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../qyft/gd/device/service/DeviceStepService.java | 27 +++++++++++++++------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/qyft/gd/device/service/DeviceStepService.java b/src/main/java/com/qyft/gd/device/service/DeviceStepService.java index 6260d51..28dcbb6 100644 --- a/src/main/java/com/qyft/gd/device/service/DeviceStepService.java +++ b/src/main/java/com/qyft/gd/device/service/DeviceStepService.java @@ -6,7 +6,6 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; -import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.function.Supplier; @@ -19,7 +18,6 @@ import java.util.function.Supplier; @RequiredArgsConstructor public class DeviceStepService { - DeviceService deviceService; CMDService cmdService; /** @@ -55,7 +53,7 @@ public class DeviceStepService { Map params = Map.of("tubeNum", tubeSol.getTubeNum(), "solutionId", addLiquid.getSolId(), "volume", addLiquid.getVolume()); List> cmdList = cmdService.downTray(params); boolean result = cmdList.stream().allMatch(Supplier::get); - if(!result){ + if (!result) { return false; } } @@ -76,6 +74,7 @@ public class DeviceStepService { /** * 移至加热 + * * @param heaterId 加热区id */ public boolean moveToHeater(String heaterId) { @@ -86,13 +85,14 @@ public class DeviceStepService { /** * 摇匀 + * * @param second 摇匀时间 */ public boolean shaking(int second) { Map params = Map.of(); List> cmdList = cmdService.startShakeUp(params); boolean result = cmdList.stream().allMatch(Supplier::get); - if(result){ + if (result) { this.delay(second); cmdList = cmdService.stopShakeUp(params); result = cmdList.stream().allMatch(Supplier::get); @@ -101,21 +101,32 @@ public class DeviceStepService { return false; } - //开始加热 + /** + * 开始加热 + * + * @param heaterId 加热区id + * @param temperature 目标温度 + */ public boolean startHeating(String heaterId, double temperature) { - Map params = Map.of("areaId", heaterId,"temperature", temperature); + Map params = Map.of("areaId", heaterId, "temperature", temperature); List> cmdList = cmdService.startHeat(params); return cmdList.stream().allMatch(Supplier::get); } - //停止加热 + /** + * 停止加热 + * + * @param heaterId 加热区id + */ public boolean stopHeating(String heaterId) { Map params = Map.of("areaId", heaterId); List> cmdList = cmdService.stopHeat(params); return cmdList.stream().allMatch(Supplier::get); } - //拍照 + /** + * 停止加热 + */ public boolean takePhoto() { Map params = Map.of(); List> cmdList = cmdService.takePhoto(params);