|
|
@ -45,7 +45,7 @@ public class MoveToAnnealAreaCommand extends BaseCommandHandler { |
|
|
|
HeatModuleCode targetHeatModuleCode = HeatModuleCode.heat_module_04; |
|
|
|
if (heatModuleCodeStr != null) {//目标加热模块非必填,如果没有传递目标加热模块则尝试获取上料区是否有托盘 |
|
|
|
heatModuleCode = HeatModuleCode.valueOf(heatModuleCodeStr);//目标加热模块 |
|
|
|
Assert.isTrue(heatModuleCode.equals(targetHeatModuleCode), () -> new AppException(ResultCode.HAVE_IN_ANNEAL_MODULE)); |
|
|
|
Assert.isTrue(!heatModuleCode.equals(targetHeatModuleCode), () -> new AppException(ResultCode.HAVE_IN_ANNEAL_MODULE)); |
|
|
|
} else { |
|
|
|
heatModuleCode = null; |
|
|
|
} |
|
|
@ -54,13 +54,14 @@ public class MoveToAnnealAreaCommand extends BaseCommandHandler { |
|
|
|
Double transferModuleXPickTrayMoveDistance = devicePositionService.getPosition(DevicePositionCode.transferModuleXPickTrayMoveDistance).getDistance();//获取转运模块X轴拿取托盘进出卡槽移动距离 |
|
|
|
Point3D liquidAreaTrayPoint = devicePositionService.getPosition(DevicePositionCode.liquidAreaTrayPoint).getPoint3D(); //获取加液区上方点位 |
|
|
|
return runAsync(() -> { |
|
|
|
boolean annealTrayExist = deviceSensorService.getSensorStatus(DeviceSensorCode.HEATER_TRAY_4_EXIST);//获取传感器状态 |
|
|
|
Assert.isTrue(annealTrayExist, () -> new AppException(ResultCode.ANNEAL_MODULE_EXIST_TRAY));//加热位是否有托盘 |
|
|
|
if (heatModuleCode != null) { |
|
|
|
//boolean annealTrayExist = deviceSensorService.getSensorStatus(DeviceSensorCode.HEATER_TRAY_4_EXIST);//获取传感器状态 |
|
|
|
//Assert.isTrue(!annealTrayExist, () -> new AppException(ResultCode.ANNEAL_MODULE_EXIST_TRAY));//加热位是否有托盘 |
|
|
|
if (heatModuleCode == null) { |
|
|
|
solutionModuleService.solutionMotorMoveZero(cmdDTO.getCommandId(), cmdDTO.getCommand());//加液机械臂上升 |
|
|
|
transferModuleService.transferMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), liquidAreaTrayPoint);//移动至加液位置 |
|
|
|
boolean liquidTrayExist = deviceSensorService.getSensorStatus(DeviceSensorCode.LIQUID_TRAY_EXIST);//获取传感器状态 |
|
|
|
Assert.isTrue(liquidTrayExist, () -> new AppException(ResultCode.OPERATION_NOT_ALLOWED));//判断机械臂是否有托盘 |
|
|
|
}else{ |
|
|
|
transferModuleService.transferXMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleTrayClawPoint3D.getX() + transferModuleXPickTrayMoveDistance);//将X轴移动至加热区托盘夹取点 + 进出卡槽移动距离 |
|
|
|
transferModuleService.transferZMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleTrayClawPoint3D.getZ());//Z轴下降至夹取点,使托盘落入石墨加热盘 |
|
|
|
transferModuleService.transferXMoveBy(cmdDTO.getCommandId(), cmdDTO.getCommand(), -transferModuleXPickTrayMoveDistance);//X轴进入卡槽 |
|
|
@ -69,7 +70,7 @@ public class MoveToAnnealAreaCommand extends BaseCommandHandler { |
|
|
|
transferModuleService.transferXMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), targetHeatModuleTrayClawPoint3D.getX());//将X轴移动至目标加热模块托盘夹取点 |
|
|
|
transferModuleService.transferZMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), targetHeatModuleTrayClawPoint3D.getZ());//Z轴下降至夹取点,使托盘落入石墨加热盘 |
|
|
|
transferModuleService.transferXMoveBy(cmdDTO.getCommandId(), cmdDTO.getCommand(), transferModuleXPickTrayMoveDistance);//X轴移出卡槽 |
|
|
|
transferModuleService.transferZMoveZero(cmdDTO.getCommandId(), cmdDTO.getCommand());//Z轴抬升至最高 |
|
|
|
transferModuleService.transferZMoveZero(cmdDTO.getCommandId(), cmdDTO.getCommand());//Z轴抬升至最高 todo 不执行 |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(targetHeatModuleCode).setTrayStatus(true);//设置目标加热区有托盘 |
|
|
|
}); |
|
|
|
} |
|
|
|