Browse Source

fix:优化业务指令

master
王梦远 2 months ago
parent
commit
bffee10d48
  1. 4
      src/main/java/com/iflytop/sgs/app/cmd/control/AnnealStartCommand.java
  2. 2
      src/main/java/com/iflytop/sgs/app/cmd/control/DoorCloseCommand.java
  3. 2
      src/main/java/com/iflytop/sgs/app/cmd/control/DoorOpenCommand.java
  4. 2
      src/main/java/com/iflytop/sgs/app/cmd/control/FanStartCommand.java
  5. 2
      src/main/java/com/iflytop/sgs/app/cmd/control/LiquidAddCommand.java
  6. 5
      src/main/java/com/iflytop/sgs/app/cmd/control/LiquidPreFillStartCommand.java

4
src/main/java/com/iflytop/sgs/app/cmd/control/AnnealStartCommand.java

@ -3,10 +3,8 @@ package com.iflytop.sgs.app.cmd.control;
import com.iflytop.sgs.app.core.BaseCommandHandler;
import com.iflytop.sgs.app.model.bo.status.device.HeatModuleState;
import com.iflytop.sgs.app.model.dto.CmdDTO;
import com.iflytop.sgs.app.service.api.DevicePositionService;
import com.iflytop.sgs.app.service.device.DeviceStateService;
import com.iflytop.sgs.app.service.device.module.HeatModuleService;
import com.iflytop.sgs.app.service.device.module.TransferModuleService;
import com.iflytop.sgs.common.annotation.CommandMapping;
import com.iflytop.sgs.common.enums.HeatModuleCode;
import com.iflytop.sgs.common.enums.HeatingType;
@ -26,10 +24,8 @@ import java.util.concurrent.CompletableFuture;
@RequiredArgsConstructor
@CommandMapping("anneal_start")//业务指令注解
public class AnnealStartCommand extends BaseCommandHandler {
private final TransferModuleService transferModuleService;
private final HeatModuleService heatModuleService;
private final DeviceStateService deviceStateService;
private final DevicePositionService devicePositionService;
@Override
public CompletableFuture<Void> handle(CmdDTO cmdDTO) {

2
src/main/java/com/iflytop/sgs/app/cmd/control/DoorCloseCommand.java

@ -25,8 +25,8 @@ public class DoorCloseCommand extends BaseCommandHandler {
@Override
public CompletableFuture<Void> handle(CmdDTO cmdDTO) {
return runAsync(() -> {
deviceStateService.getDeviceState().getDoorModule().setOpen(false); //将门状态设置为false
doorModuleService.doorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(),0);
deviceStateService.getDeviceState().getDoorModule().setOpen(false); //将门状态设置为false
});
}
}

2
src/main/java/com/iflytop/sgs/app/cmd/control/DoorOpenCommand.java

@ -31,8 +31,8 @@ public class DoorOpenCommand extends BaseCommandHandler {
Double doorOpenPosition = devicePositionService.getPosition(DevicePositionCode.doorOpenPosition).getDistance();//获取开门位置
return runAsync(() -> {
deviceStateService.getDeviceState().getDoorModule().setOpen(true);//将门状态设置为true
doorModuleService.doorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), doorOpenPosition);
deviceStateService.getDeviceState().getDoorModule().setOpen(true);//将门状态设置为true
});
}
}

2
src/main/java/com/iflytop/sgs/app/cmd/control/FanStartCommand.java

@ -33,7 +33,7 @@ public class FanStartCommand extends BaseCommandHandler {
HeatModuleState heatModuleState = deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode);
return runAsync(() -> {
if (!heatModuleState.getHeatingType().equals(HeatingType.stop)) {//加热棒不是停止加热状态
if (!heatModuleState.getHeatingType().equals(HeatingType.stop)) {//加热棒加热状态
heatModuleService.heatRodClose(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleCode);//关闭加热棒
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setHeatingType(HeatingType.stop);//同步状态
}

2
src/main/java/com/iflytop/sgs/app/cmd/control/LiquidAddCommand.java

@ -56,7 +56,7 @@ public class LiquidAddCommand extends BaseCommandHandler {
Assert.isTrue(!jsonArray.isEmpty(), () -> new AppException(ResultCode.INVALID_PARAMETER));//确定选中了列
TransferModuleState transferModuleState = deviceStateService.getDeviceState().getTransferModule();//获取机械臂状态
Assert.isTrue(transferModuleState.isTrayStatus(), () -> new AppException(ResultCode.OPERATION_NOT_ALLOWED));//判断机械臂是否有托盘
Point3D liquidAreaTrayPoint = devicePositionService.getPosition(DevicePositionCode.liquidAreaTrayPoint).getPoint3D(); //获取加液区上方点位
Point3D liquidAreaTrayPoint = devicePositionService.getPosition(DevicePositionCode.liquidAreaTrayPoint).getPoint3D(); //获取加液区上方托盘点位
Double solutionModuleMotorDownInTubeAddPositon = devicePositionService.getPosition(DevicePositionCode.solutionModuleMotorDownInTubeAddPositon).getPositon(); //加液模块电机下降进入试管加液位置
Double trayTubeHorizontalSpacingDistance = devicePositionService.getPosition(DevicePositionCode.trayTubeHorizontalSpacingDistance).getDistance(); //托盘试管水平间距
solutionModuleService.solutionMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 0);//加液机械臂上升

5
src/main/java/com/iflytop/sgs/app/cmd/control/LiquidPreFillStartCommand.java

@ -46,7 +46,7 @@ public class LiquidPreFillStartCommand extends BaseCommandHandler {
Assert.notNull(solutions, () -> new AppException(ResultCode.OPERATION_NOT_ALLOWED));//检验参数
ValveStateCode valveStateCode = ValveStateCode.valueOf(solutions.getCode());//获取对应的电磁阀通道
Point3D liquidAreaTrayPoint = devicePositionService.getPosition(DevicePositionCode.liquidAreaTrayPoint).getPoint3D(); //获取加液区上方点位
double position=devicePositionService.getPosition(DevicePositionCode.solutionPreFillDistance).getDistance();
double position=devicePositionService.getPosition(DevicePositionCode.solutionPreFillDistance).getDistance();//溶液首次预充距离
return runAsync(() -> {
deviceStateService.getDeviceState().getSolutionModule().setIdle(true);//设置占用
deviceStateService.getDeviceState().getSolutionModule().setPumping(true);//设置正在加液
@ -54,9 +54,6 @@ public class LiquidPreFillStartCommand extends BaseCommandHandler {
solutionModuleService.solutionMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 0);//加液机械臂上升
transferModuleService.transferMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), liquidAreaTrayPoint);//移动至加液位置
solutionModuleService.liquidPumpMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), position);//预充开始
SolutionContainerState solutionContainerState=deviceStateService.getDeviceState().getSolutionModule().getContainerStateByCode(valveStateCode.getContainerCode());//设置容器预充状态
solutionContainerState.setFull(true);//容器状态满
});
}
}

Loading…
Cancel
Save