Browse Source

预充增加传感器的判断

master
王梦远 2 months ago
parent
commit
122fe8fb8b
  1. 14
      src/main/java/com/iflytop/sgs/app/cmd/selftest/LiquidPreFillCommand.java

14
src/main/java/com/iflytop/sgs/app/cmd/selftest/LiquidPreFillCommand.java

@ -1,14 +1,17 @@
package com.iflytop.sgs.app.cmd.selftest;
import com.iflytop.sgs.app.core.BaseCommandHandler;
import com.iflytop.sgs.app.core.SelfMoveTestGenerator;
import com.iflytop.sgs.app.model.bo.Point3D;
import com.iflytop.sgs.app.model.dto.CmdDTO;
import com.iflytop.sgs.app.service.api.DevicePositionService;
import com.iflytop.sgs.app.service.api.SystemConfigService;
import com.iflytop.sgs.app.service.device.DeviceSensorService;
import com.iflytop.sgs.app.service.device.DeviceStateService;
import com.iflytop.sgs.app.service.device.module.SolutionModuleService;
import com.iflytop.sgs.app.service.device.module.TransferModuleService;
import com.iflytop.sgs.common.annotation.CommandMapping;
import com.iflytop.sgs.common.enums.DeviceSensorCode;
import com.iflytop.sgs.common.enums.SolutionCode;
import com.iflytop.sgs.common.enums.SystemConfigCode;
import com.iflytop.sgs.common.enums.data.DevicePositionCode;
@ -26,13 +29,14 @@ import java.util.concurrent.CompletableFuture;
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("liquid_pre_fill_when_launch ")//业务指令注解
@CommandMapping("liquid_pre_fill_when_launch")//业务指令注解
public class LiquidPreFillCommand extends BaseCommandHandler {
private final SolutionModuleService solutionModuleService;
private final TransferModuleService transferModuleService;
private final DevicePositionService devicePositionService;
private final DeviceStateService deviceStateService;
private final SystemConfigService systemConfigService;
private final DeviceSensorService deviceSensorService;
@Override
public CompletableFuture<Void> handle(CmdDTO cmdDTO) {
@ -42,6 +46,14 @@ public class LiquidPreFillCommand extends BaseCommandHandler {
deviceStateService.getCommandMutexState().get().setMoveTest(true);
return runAsync(() -> {
try {
boolean clawTrayExist = deviceSensorService.getSensorStatus(DeviceSensorCode.CLAW_TRAY_EXIST);
if (clawTrayExist) {
throw new AppException(ResultCode.TRANSFER_MODULE_YES_TRAY);//夹爪存在托盘
}
boolean feedTrayExist = deviceSensorService.getSensorStatus(DeviceSensorCode.LIQUID_TRAY_EXIST);
if (feedTrayExist) {
throw new AppException(ResultCode.FEED_AREA_EXIST_TRAY);//上料区存在托盘
}
Point3D heatArea1TrayClawPoint = devicePositionService.getPosition(DevicePositionCode.heatArea1TrayClawPoint).getPoint3D();//加热位1坐标
Double liquidAreaPreFillPoint = devicePositionService.getPosition(DevicePositionCode.liquidAreaPreFillPoint).getPositon(); //预充时加液臂下降位置
Double preFillDistance = systemConfigService.getSystemConfigDoubleByCode(SystemConfigCode.pre_fill_distance_when_open_service);//预充距离

Loading…
Cancel
Save