Browse Source

fix:调整注释

master
白凤吉 6 months ago
parent
commit
26e9ee8cb3
  1. 27
      src/main/java/com/qyft/gd/device/service/DeviceStepService.java

27
src/main/java/com/qyft/gd/device/service/DeviceStepService.java

@ -6,7 +6,6 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.function.Supplier; import java.util.function.Supplier;
@ -19,7 +18,6 @@ import java.util.function.Supplier;
@RequiredArgsConstructor @RequiredArgsConstructor
public class DeviceStepService { public class DeviceStepService {
DeviceService deviceService;
CMDService cmdService; CMDService cmdService;
/** /**
@ -55,7 +53,7 @@ public class DeviceStepService {
Map<String, Object> params = Map.of("tubeNum", tubeSol.getTubeNum(), "solutionId", addLiquid.getSolId(), "volume", addLiquid.getVolume()); Map<String, Object> params = Map.of("tubeNum", tubeSol.getTubeNum(), "solutionId", addLiquid.getSolId(), "volume", addLiquid.getVolume());
List<Supplier<Boolean>> cmdList = cmdService.downTray(params); List<Supplier<Boolean>> cmdList = cmdService.downTray(params);
boolean result = cmdList.stream().allMatch(Supplier::get); boolean result = cmdList.stream().allMatch(Supplier::get);
if(!result){
if (!result) {
return false; return false;
} }
} }
@ -76,6 +74,7 @@ public class DeviceStepService {
/** /**
* 移至加热 * 移至加热
*
* @param heaterId 加热区id * @param heaterId 加热区id
*/ */
public boolean moveToHeater(String heaterId) { public boolean moveToHeater(String heaterId) {
@ -86,13 +85,14 @@ public class DeviceStepService {
/** /**
* 摇匀 * 摇匀
*
* @param second 摇匀时间 * @param second 摇匀时间
*/ */
public boolean shaking(int second) { public boolean shaking(int second) {
Map<String, Object> params = Map.of(); Map<String, Object> params = Map.of();
List<Supplier<Boolean>> cmdList = cmdService.startShakeUp(params); List<Supplier<Boolean>> cmdList = cmdService.startShakeUp(params);
boolean result = cmdList.stream().allMatch(Supplier::get); boolean result = cmdList.stream().allMatch(Supplier::get);
if(result){
if (result) {
this.delay(second); this.delay(second);
cmdList = cmdService.stopShakeUp(params); cmdList = cmdService.stopShakeUp(params);
result = cmdList.stream().allMatch(Supplier::get); result = cmdList.stream().allMatch(Supplier::get);
@ -101,21 +101,32 @@ public class DeviceStepService {
return false; return false;
} }
//开始加热
/**
* 开始加热
*
* @param heaterId 加热区id
* @param temperature 目标温度
*/
public boolean startHeating(String heaterId, double temperature) { public boolean startHeating(String heaterId, double temperature) {
Map<String, Object> params = Map.of("areaId", heaterId,"temperature", temperature);
Map<String, Object> params = Map.of("areaId", heaterId, "temperature", temperature);
List<Supplier<Boolean>> cmdList = cmdService.startHeat(params); List<Supplier<Boolean>> cmdList = cmdService.startHeat(params);
return cmdList.stream().allMatch(Supplier::get); return cmdList.stream().allMatch(Supplier::get);
} }
//停止加热
/**
* 停止加热
*
* @param heaterId 加热区id
*/
public boolean stopHeating(String heaterId) { public boolean stopHeating(String heaterId) {
Map<String, Object> params = Map.of("areaId", heaterId); Map<String, Object> params = Map.of("areaId", heaterId);
List<Supplier<Boolean>> cmdList = cmdService.stopHeat(params); List<Supplier<Boolean>> cmdList = cmdService.stopHeat(params);
return cmdList.stream().allMatch(Supplier::get); return cmdList.stream().allMatch(Supplier::get);
} }
//拍照
/**
* 停止加热
*/
public boolean takePhoto() { public boolean takePhoto() {
Map<String, Object> params = Map.of(); Map<String, Object> params = Map.of();
List<Supplier<Boolean>> cmdList = cmdService.takePhoto(params); List<Supplier<Boolean>> cmdList = cmdService.takePhoto(params);

Loading…
Cancel
Save