Browse Source

测试问题

master
白凤吉 2 months ago
parent
commit
1145fb32ab
  1. 6
      src/main/java/com/iflytop/sgs/app/cmd/control/CleanStartCommand.java
  2. 10
      src/main/java/com/iflytop/sgs/app/cmd/control/LiquidReduceCommand.java

6
src/main/java/com/iflytop/sgs/app/cmd/control/CleanStartCommand.java

@ -43,7 +43,7 @@ public class CleanStartCommand extends BaseCommandHandler {
@Override
public CompletableFuture<Void> handle(CmdDTO cmdDTO) {
Assert.isTrue(deviceStateService.getDeviceState().getTransferModule().isTrayStatus(), () -> new AppException(ResultCode.TRANSFER_MODULE_NO_TRAY));//判断转运模块托盘状态
//Assert.isTrue(deviceStateService.getDeviceState().getTransferModule().isTrayStatus(), () -> new AppException(ResultCode.TRANSFER_MODULE_NO_TRAY));//判断转运模块托盘状态
double cleanWaterVolume = systemConfigService.getSystemConfigDoubleByCode(SystemConfigCode.volume_clean);//清洁时加水的量
double waterScale = systemConfigService.getSystemConfigDoubleByCode(SystemConfigCode.scale_water);//水转换系数
double pumpPosition = systemConfigService.getSystemConfigDoubleByCode(SystemConfigCode.number_reduce);//抽液时蠕动泵移动
@ -58,11 +58,11 @@ public class CleanStartCommand extends BaseCommandHandler {
return runAsync(() -> {
transferModuleService.transferXMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), liquidAreaTrayPoint3D.getX());//将X轴移动至加液时托盘位置点
boolean LIQUID_TRAY_EXIST=deviceSensorService.getSensorStatus(DeviceSensorCode.LIQUID_TRAY_EXIST);//监测加液位是否有托盘
Assert.isTrue(LIQUID_TRAY_EXIST, () -> new AppException(ResultCode.TARGET_HEAT_MODULE_NO_TRAY));//机械臂是否有托盘
// Assert.isTrue(LIQUID_TRAY_EXIST, () -> new AppException(ResultCode.TARGET_HEAT_MODULE_NO_TRAY));//机械臂是否有托盘
solutionModuleService.liquidValveSwitch(cmdDTO.getCommandId(), cmdDTO.getCommand(), ValveStateCode.waste);//电磁阀对应通道打开
solutionModuleService.solutionMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), solutionModuleMotorDownInTubeExtPositon);//加液模块下降进入试管抽取位置
solutionModuleService.liquidPumpMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), pumpPosition);
solutionModuleService.solutionMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 0.0);//加液模块上升
solutionModuleService.solutionMotorMoveZero(cmdDTO.getCommandId(), cmdDTO.getCommand());//加液模块上升
solutionModuleService.liquidValveSwitch(cmdDTO.getCommandId(), cmdDTO.getCommand(), ValveStateCode.water);//电磁阀对应通道打开
for (int i = 0; i < cycle; i++) {
for (TubeState tubeState : trayState.getTubes()) {

10
src/main/java/com/iflytop/sgs/app/cmd/control/LiquidReduceCommand.java

@ -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());//加液模块上升
}
}

Loading…
Cancel
Save