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);