|
|
@ -43,7 +43,7 @@ public class LiquidReduceCommand extends BaseCommandHandler { |
|
|
|
public CompletableFuture<Void> handle(CmdDTO cmdDTO) { |
|
|
|
|
|
|
|
JSONArray jsonArray = cmdDTO.getJSONArrayParam("columns");//获取参数 |
|
|
|
Assert.isTrue(jsonArray.isEmpty(),()->new AppException(ResultCode.INVALID_PARAMETER));//参数校验 |
|
|
|
Assert.isTrue(!jsonArray.isEmpty(),()->new AppException(ResultCode.INVALID_PARAMETER));//参数校验 |
|
|
|
Point3D liquidAreaTrayPoint3D = devicePositionService.getPosition(DevicePositionCode.liquidAreaTrayPoint).getPoint3D();//获取加液时托盘位置点 |
|
|
|
Double trayTubeHorizontalSpacingDistance = devicePositionService.getPosition(DevicePositionCode.trayTubeHorizontalSpacingDistance).getDistance();//获取托盘试管水平间距 |
|
|
|
Double solutionModuleMotorDownInTubeExtPositon = devicePositionService.getPosition(DevicePositionCode.solutionModuleMotorDownInTubeExtPositon).getPositon();//加液模块电机下降进入试管抽取位置 |
|
|
@ -52,8 +52,8 @@ public class LiquidReduceCommand extends BaseCommandHandler { |
|
|
|
solutionModuleService.solutionMotorMoveZero(cmdDTO.getCommandId(), cmdDTO.getCommand());//加液模块上升 |
|
|
|
transferModuleService.transferMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), liquidAreaTrayPoint3D);//将X轴移动至加液时托盘位置点 |
|
|
|
boolean liquidTrayExist = deviceSensorService.getSensorStatus(DeviceSensorCode.LIQUID_TRAY_EXIST);//获取传感器状态 |
|
|
|
Assert.isTrue(liquidTrayExist, () -> new AppException(ResultCode.SOLUTION_MODULE_NO_TRAY));//判断机械臂是否有托盘 |
|
|
|
deviceStateService.getDeviceState().getSolutionModule().setIdle(true);//设置占用 |
|
|
|
//Assert.isTrue(liquidTrayExist, () -> new AppException(ResultCode.SOLUTION_MODULE_NO_TRAY));//判断机械臂是否有托盘 |
|
|
|
deviceStateService.getDeviceState().getSolutionModule().setIdle(false);//设置占用 |
|
|
|
deviceStateService.getDeviceState().getSolutionModule().setPumping(true);//设置正在加液 |
|
|
|
solutionModuleService.liquidValveSwitch(cmdDTO.getCommandId(), cmdDTO.getCommand(), ValveStateCode.waste);//电磁阀对应通道打开 |
|
|
|
for (int i = 0; i < jsonArray.size(); i++) { |
|
|
@ -61,8 +61,8 @@ public class LiquidReduceCommand extends BaseCommandHandler { |
|
|
|
if (column > 0 && column < 6) { |
|
|
|
double distance = (jsonArray.getInt(i) - 1) * trayTubeHorizontalSpacingDistance; |
|
|
|
transferModuleService.transferXMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), liquidAreaTrayPoint3D.getX()+distance);//机械臂移动到试管位置 |
|
|
|
solutionModuleService.solutionMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), solutionModuleMotorDownInTubeExtPositon);//加液模块下降进入试管 |
|
|
|
solutionModuleService.liquidPumpMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), -reduceNumber);//抽液 |
|
|
|
solutionModuleService.solutionMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 10);//加液模块下降进入试管 solutionModuleMotorDownInTubeExtPositon todo |
|
|
|
solutionModuleService.liquidPumpMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 0.1);//抽液 reduceNumber0.1 |
|
|
|
solutionModuleService.solutionMotorMoveZero(cmdDTO.getCommandId(), cmdDTO.getCommand());//加液模块上升 |
|
|
|
} |
|
|
|
} |
|
|
|