|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.iflytop.sgs.app.cmd.control; |
|
|
|
|
|
|
|
import cn.hutool.core.lang.Assert; |
|
|
|
import com.iflytop.sgs.app.core.BaseCommandHandler; |
|
|
|
import com.iflytop.sgs.app.model.bo.Point3D; |
|
|
|
import com.iflytop.sgs.app.model.dto.CmdDTO; |
|
|
@ -10,6 +11,8 @@ 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.data.DevicePositionCode; |
|
|
|
import com.iflytop.sgs.common.exception.AppException; |
|
|
|
import com.iflytop.sgs.common.result.ResultCode; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
@ -36,9 +39,9 @@ public class MoveToLiquidAreaCommand extends BaseCommandHandler { |
|
|
|
HeatModuleCode targetHeatModuleCode;//目标加热模块 |
|
|
|
if (targetHeatModuleCodeStr != null) {//目标加热模块非必填,如果没有传递目标加热模块则尝试获取上料区是否有托盘 |
|
|
|
targetHeatModuleCode = HeatModuleCode.valueOf(targetHeatModuleCodeStr); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
targetHeatModuleCode = null; |
|
|
|
//TODO 尝试获取上料区是否有托盘,如果没有托盘则提示错误 |
|
|
|
Assert.isTrue(deviceStateService.getDeviceState().getSolutionModule().isFeedAreaTrayStatus(), () -> new AppException(ResultCode.FEED_AREA_NO_TRAY));//上料区无托盘 |
|
|
|
} |
|
|
|
|
|
|
|
Point3D targetHeatModuleTrayClawPoint3D = heatModuleService.getHeatModuleTrayClawPoint3D(targetHeatModuleCode);//获取目标加热模块托盘夹取点 |
|
|
@ -48,7 +51,7 @@ public class MoveToLiquidAreaCommand extends BaseCommandHandler { |
|
|
|
Point3D liquidAreaTrayPoint3D = devicePositionService.getPosition(DevicePositionCode.liquidAreaTrayPoint).getPoint3D();//获取加液时托盘位置点 |
|
|
|
|
|
|
|
return runAsync(() -> { |
|
|
|
if(targetHeatModuleCode == null){ |
|
|
|
if (targetHeatModuleCode == null) { |
|
|
|
//获取上料区托盘 |
|
|
|
transferModuleService.transferXMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), feedAreaTrayPoint3D.getX() + transferModuleXPickTrayMoveDistance);//将X轴移动至上料区托盘夹取点 + 进出卡槽移动距离 |
|
|
|
transferModuleService.transferZMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), transferModuleZPickTrayDownPositon);//Z轴下降至夹取点,使托盘落入石墨加热盘 |
|
|
@ -56,7 +59,7 @@ public class MoveToLiquidAreaCommand extends BaseCommandHandler { |
|
|
|
transferModuleService.transferZMoveZero(cmdDTO.getCommandId(), cmdDTO.getCommand());//Z轴抬升至最高 |
|
|
|
deviceStateService.getDeviceState().getSolutionModule().setFeedAreaTrayStatus(false);//设定上料区托盘状态 |
|
|
|
deviceStateService.getDeviceState().getTrayByHeatModuleCode(targetHeatModuleCode).setInFeedArea(false);//设定托盘不在上料区中 |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
//获取目标加热模块托盘 |
|
|
|
transferModuleService.transferXMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), targetHeatModuleTrayClawPoint3D.getX() + transferModuleXPickTrayMoveDistance);//将X轴移动至目标加热模块托盘夹取点 + 进出卡槽移动距离 |
|
|
|
transferModuleService.transferZMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), transferModuleZPickTrayDownPositon);//Z轴下降至夹取点,使托盘落入石墨加热盘 |
|
|
|