|
|
@ -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<String, Object> params = Map.of("tubeNum", tubeSol.getTubeNum(), "solutionId", addLiquid.getSolId(), "volume", addLiquid.getVolume()); |
|
|
|
List<Supplier<Boolean>> 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<String, Object> params = Map.of(); |
|
|
|
List<Supplier<Boolean>> 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<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); |
|
|
|
return cmdList.stream().allMatch(Supplier::get); |
|
|
|
} |
|
|
|
|
|
|
|
//停止加热 |
|
|
|
/** |
|
|
|
* 停止加热 |
|
|
|
* |
|
|
|
* @param heaterId 加热区id |
|
|
|
*/ |
|
|
|
public boolean stopHeating(String heaterId) { |
|
|
|
Map<String, Object> params = Map.of("areaId", heaterId); |
|
|
|
List<Supplier<Boolean>> cmdList = cmdService.stopHeat(params); |
|
|
|
return cmdList.stream().allMatch(Supplier::get); |
|
|
|
} |
|
|
|
|
|
|
|
//拍照 |
|
|
|
/** |
|
|
|
* 停止加热 |
|
|
|
*/ |
|
|
|
public boolean takePhoto() { |
|
|
|
Map<String, Object> params = Map.of(); |
|
|
|
List<Supplier<Boolean>> cmdList = cmdService.takePhoto(params); |
|
|
|