|
@ -33,7 +33,8 @@ public class CMDService { |
|
|
commandMap.put(Commands.DOWN_TRAY, this::downTray); |
|
|
commandMap.put(Commands.DOWN_TRAY, this::downTray); |
|
|
commandMap.put(Commands.INJECT_FLUID, this::injectFluid); |
|
|
commandMap.put(Commands.INJECT_FLUID, this::injectFluid); |
|
|
commandMap.put(Commands.MOVE_TO_ACTION_AREA, this::moveToActionArea); |
|
|
commandMap.put(Commands.MOVE_TO_ACTION_AREA, this::moveToActionArea); |
|
|
commandMap.put(Commands.SHAKE_UP, this::shakeUp); |
|
|
|
|
|
|
|
|
commandMap.put(Commands.START_SHAKE_UP, this::startShakeUp); |
|
|
|
|
|
commandMap.put(Commands.STOP_SHAKE_UP, this::stopShakeUp); |
|
|
commandMap.put(Commands.START_HEAT, this::startHeat); |
|
|
commandMap.put(Commands.START_HEAT, this::startHeat); |
|
|
commandMap.put(Commands.STOP_HEAT, this::stopHeat); |
|
|
commandMap.put(Commands.STOP_HEAT, this::stopHeat); |
|
|
commandMap.put(Commands.TAKE_PHOTO, this::takePhoto); |
|
|
commandMap.put(Commands.TAKE_PHOTO, this::takePhoto); |
|
@ -89,8 +90,8 @@ public class CMDService { |
|
|
cmdList.add(() -> deviceService.startHeating((String) cmdForm.getParams().get("areaId"),(Double) cmdForm.getParams().get("temperature"))); |
|
|
cmdList.add(() -> deviceService.startHeating((String) cmdForm.getParams().get("areaId"),(Double) cmdForm.getParams().get("temperature"))); |
|
|
return run(cmdList); |
|
|
return run(cmdList); |
|
|
} |
|
|
} |
|
|
// 摇匀 |
|
|
|
|
|
private Boolean shakeUp(CMDForm cmdForm) { |
|
|
|
|
|
|
|
|
// 开始摇匀 |
|
|
|
|
|
private Boolean startShakeUp(CMDForm cmdForm) { |
|
|
// deviceService.startShaking(); |
|
|
// deviceService.startShaking(); |
|
|
// Timer timer = new Timer(); |
|
|
// Timer timer = new Timer(); |
|
|
// TimerTask task = new TimerTask() { |
|
|
// TimerTask task = new TimerTask() { |
|
@ -106,6 +107,12 @@ public class CMDService { |
|
|
cmdList.add(() -> deviceService.setShakingSpeed((Integer) cmdForm.getParams().get("speed"))); |
|
|
cmdList.add(() -> deviceService.setShakingSpeed((Integer) cmdForm.getParams().get("speed"))); |
|
|
return run(cmdList); |
|
|
return run(cmdList); |
|
|
} |
|
|
} |
|
|
|
|
|
// 结束摇匀 |
|
|
|
|
|
private Boolean stopShakeUp(CMDForm cmdForm) { |
|
|
|
|
|
List<Supplier<Boolean>> cmdList = new ArrayList<>(); |
|
|
|
|
|
cmdList.add(() -> deviceService.stopShaking()); |
|
|
|
|
|
return run(cmdList); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 移至加液 |
|
|
// 移至加液 |
|
|
private Boolean moveToActionArea(CMDForm cmdForm) { |
|
|
private Boolean moveToActionArea(CMDForm cmdForm) { |
|
|