Browse Source

调整工艺逻辑

master
白凤吉 2 months ago
parent
commit
ce3aa548f8
  1. 2
      src/main/java/com/iflytop/gd/app/controller/CraftsController.java
  2. 14
      src/main/java/com/iflytop/gd/app/core/CraftsContext.java
  3. 3
      src/main/java/com/iflytop/gd/app/model/dto/StartCraftsDTO.java
  4. 90
      src/main/java/com/iflytop/gd/app/service/api/CraftsService.java
  5. 83
      src/main/java/com/iflytop/gd/app/service/crafts/CraftsStepService.java
  6. 6
      src/main/java/com/iflytop/gd/common/result/ResultCode.java

2
src/main/java/com/iflytop/gd/app/controller/CraftsController.java

@ -86,7 +86,7 @@ public class CraftsController {
@Operation(summary = "开始执行工艺")
@PostMapping("/start")
public Result<SetCraftsVO> startCrafts(@Valid @RequestBody StartCraftsDTO startCraftsDTO) {
return Result.success(craftsService.startCrafts(startCraftsDTO));
return Result.success(craftsService.startCrafts(startCraftsDTO.getCraftId(), startCraftsDTO.getHeatId()));
}
@Operation(summary = "暂停执行工艺")

14
src/main/java/com/iflytop/gd/app/core/CraftsContext.java

@ -2,12 +2,9 @@ package com.iflytop.gd.app.core;
import cn.hutool.json.JSONUtil;
import com.iflytop.gd.app.model.bo.CraftsStep;
import com.iflytop.gd.app.model.bo.status.device.CraftsState;
import com.iflytop.gd.app.model.bo.status.device.TrayState;
import com.iflytop.gd.app.model.entity.Crafts;
import com.iflytop.gd.app.model.entity.Ores;
import com.iflytop.gd.app.service.crafts.CraftsStepService;
import com.iflytop.gd.app.service.device.DeviceStateService;
import com.iflytop.gd.app.ws.server.WebSocketSender;
import com.iflytop.gd.common.constant.WebSocketMessageType;
import com.iflytop.gd.common.enums.HeatModuleCode;
@ -37,7 +34,6 @@ public class CraftsContext implements Runnable {
private final StateMachine<CraftStates, CraftEvents> sm;
private final WebSocketSender webSocketService;
private final CraftsStepService craftsStepService;
private final DeviceStateService deviceStateService;
private int currentIndex = 0;
/**
@ -47,30 +43,23 @@ public class CraftsContext implements Runnable {
Crafts craft,
StateMachineFactory<CraftStates, CraftEvents> factory,
WebSocketSender webSocketService,
CraftsStepService craftsStepService,
DeviceStateService deviceStateService) {
CraftsStepService craftsStepService) {
this.heatModuleCode = heatModuleCode;
this.ores = ores;
this.craft = craft;
this.craftsStepList = JSONUtil.parseArray(craft.getSteps()).toList(CraftsStep.class);
this.webSocketService = webSocketService;
this.craftsStepService = craftsStepService;
this.deviceStateService = deviceStateService;
this.sm = factory.getStateMachine(heatModuleCode.toString());
sm.addStateListener(new StateMachineListenerAdapter<>() {
@Override
public void stateEntered(State<CraftStates, CraftEvents> state) {
CraftsState craftsState = deviceStateService.getDeviceState().getTrayStateByHeatModuleCode(heatModuleCode).getCrafts();
craftsState.setState(state.getId());
craftsState.setCurrentIndex(currentIndex);
Map<String, Object> dataMap = new HashMap<>();
dataMap.put("heatId", heatModuleCode);
dataMap.put("state", state.getId());
dataMap.put("index", currentIndex);
webSocketService.push(WebSocketMessageType.CRAFTS_STATE, dataMap);
}
});
Mono.from(sm.startReactively()).block();
@ -105,7 +94,6 @@ public class CraftsContext implements Runnable {
}
}
if (sm.getState().getId() == CraftStates.RUNNING) {
craftsStepService.finish(heatModuleCode);//工艺执行完毕将托盘移动至加液模块
Message<CraftEvents> finishMsg = MessageBuilder.withPayload(CraftEvents.FINISH).build();
Mono.from(sm.sendEvent(Mono.just(finishMsg))).block();
}

3
src/main/java/com/iflytop/gd/app/model/dto/StartCraftsDTO.java

@ -16,7 +16,4 @@ public class StartCraftsDTO {
@Schema(description = "加热区id,非必填,如果不传递则自动分配加热区")
private HeatModuleCode heatId;
@Schema(description = "需要加液的试管")
private int[] tubes;
}

90
src/main/java/com/iflytop/gd/app/service/api/CraftsService.java

@ -4,17 +4,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.iflytop.gd.app.core.CraftsContext;
import com.iflytop.gd.app.mapper.CraftsMapper;
import com.iflytop.gd.app.model.bo.status.device.CraftsState;
import com.iflytop.gd.app.model.bo.status.device.HeatModuleState;
import com.iflytop.gd.app.model.bo.status.device.TrayState;
import com.iflytop.gd.app.model.bo.status.device.TubeState;
import com.iflytop.gd.app.model.dto.StartCraftsDTO;
import com.iflytop.gd.app.model.entity.Crafts;
import com.iflytop.gd.app.model.entity.Ores;
import com.iflytop.gd.app.model.vo.CraftStatusVO;
import com.iflytop.gd.app.model.vo.SetCraftsVO;
import com.iflytop.gd.app.service.crafts.CraftsStepService;
import com.iflytop.gd.app.service.device.DeviceStateService;
import com.iflytop.gd.app.service.device.module.HeatModuleService;
import com.iflytop.gd.app.ws.server.WebSocketSender;
import com.iflytop.gd.common.enums.HeatModuleCode;
@ -24,8 +19,6 @@ import com.iflytop.gd.common.exception.AppException;
import com.iflytop.gd.common.result.ResultCode;
import jakarta.annotation.PostConstruct;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.statemachine.config.StateMachineFactory;
import org.springframework.stereotype.Service;
@ -40,7 +33,6 @@ import java.util.stream.Collectors;
/**
* 工艺接口服务
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class CraftsService extends ServiceImpl<CraftsMapper, Crafts> {
@ -49,14 +41,10 @@ public class CraftsService extends ServiceImpl<CraftsMapper, Crafts> {
private final WebSocketSender webSocketService;
private final CraftsStepService craftsStepService;
private final OresService oresService;
private final DeviceStateService deviceStateService;
private final ObjectProvider<CraftsState> craftsStateObjectProvider;
private final ConcurrentHashMap<HeatModuleCode, CraftsContext> contextMap = new ConcurrentHashMap<>();
private final ConcurrentHashMap<HeatModuleCode, Future<?>> futureMap = new ConcurrentHashMap<>();
private ExecutorService executor;
@PostConstruct
public void init() {
this.executor = Executors.newCachedThreadPool();
@ -98,48 +86,40 @@ public class CraftsService extends ServiceImpl<CraftsMapper, Crafts> {
/**
* 启动执行工艺
*/
public synchronized SetCraftsVO startCrafts(StartCraftsDTO startCraftsDTO) {
long craftId = startCraftsDTO.getCraftId();
HeatModuleCode heatModuleCode = startCraftsDTO.getHeatId();
public synchronized SetCraftsVO startCrafts(Long craftId, HeatModuleCode heatModuleCode) {
Crafts craft = this.getById(craftId);
if (craft == null) {
if(craft == null) {
throw new AppException(ResultCode.INVALID_PARAMETER);
}
Ores ores = oresService.getById(craft.getOresId());
if (ores == null) {
if(ores == null) {
throw new AppException(ResultCode.INVALID_PARAMETER);
}
if (deviceStateService.getDeviceState().getSolutionModule().getTrayStatus() == 0) {
throw new AppException(ResultCode.SOLUTION_MODULE_NO_TRAY);
}
//判断是否指定加热区id
if (heatModuleCode == null) {
//如果没有指定加热区id则自动获取一个
HeatModuleState heatModuleState = heatModuleService.getIdleHeatModule();
if (heatModuleState == null) {
log.error("自动分配工艺失败,无空闲加热模块。");
if(heatModuleState == null){
throw new AppException(ResultCode.HEAT_MODULE_NO_IDLE);
} else {
}else{
heatModuleCode = heatModuleState.getModuleCode();
}
} else {
// if (futureMap.containsKey(heatModuleCode)) {//校验指定加热模块是否正在执行工艺
// log.error("工艺正在执行中,不可重复开始执行。");
// throw new AppException(ResultCode.CRAFT_RUNNING);
// }
}else{
if (futureMap.containsKey(heatModuleCode)) {//校验指定加热模块是否正在执行工艺
throw new AppException(ResultCode.CRAFT_RUNNING);
}
}
log.info("准备开始工艺,加热模块{},工艺{}", heatModuleCode, craft.getName());
//TODO 传感器校验heatModuleCode是否被占用
// 校验已有上下文状态仅允许在 READYSTOPPED FINISHED 状态下重置
// CraftsContext existing = contextMap.get(heatModuleCode);
// if (existing != null) {
// CraftStates state = existing.getSm().getState().getId();
// if (state == CraftStates.RUNNING || state == CraftStates.PAUSED) {
// throw new AppException(ResultCode.CRAFT_RUNNING);
// }
// clearCraftContext(heatModuleCode);
// }
CraftsContext existing = contextMap.get(heatModuleCode);
if (existing != null) {
CraftStates state = existing.getSm().getState().getId();
if (state == CraftStates.RUNNING || state == CraftStates.PAUSED) {
throw new AppException(ResultCode.CRAFT_RUNNING);
}
clearCraftContext(heatModuleCode);
}
CraftsContext ctx = new CraftsContext(
heatModuleCode,
@ -147,33 +127,12 @@ public class CraftsService extends ServiceImpl<CraftsMapper, Crafts> {
craft,
stateMachineFactory,
webSocketService,
craftsStepService,
deviceStateService
craftsStepService
);
contextMap.put(heatModuleCode, ctx);
Future<?> future = executor.submit(ctx);
futureMap.put(heatModuleCode, future);
TrayState trayState = deviceStateService.getDeviceState().getTrayInSolutionModule();
//配置可操作试管
TubeState[] tubeStateArr = trayState.getTubes();
List<Integer> needTubeNumArr = Arrays.stream(startCraftsDTO.getTubes()).boxed() .toList();
for (TubeState tubeState : tubeStateArr) {
if(!needTubeNumArr.contains(tubeState.getTubeNum())){
tubeState.setNeedAddSolution(false);
}
}
//配置状态
CraftsState craftsState = craftsStateObjectProvider.getObject();
craftsState.setCraft(craft);
craftsState.setOres(ores);
craftsState.setState(CraftStates.READY);
craftsState.setCurrentIndex(0);
trayState.setHeatModuleId(heatModuleCode);
trayState.setCrafts(craftsState);
//组装返回值
SetCraftsVO setCraftsVO = new SetCraftsVO();
setCraftsVO.setHeatId(heatModuleCode);
setCraftsVO.setCraftsName(craft.getName());
@ -219,19 +178,6 @@ public class CraftsService extends ServiceImpl<CraftsMapper, Crafts> {
}
/**
* 停止执行所有工艺不清除上下文
*/
public synchronized void stopAllCrafts() {
contextMap.forEach((key, ctx) -> {
Future<?> future = futureMap.remove(key);
if (ctx != null && future != null) {
ctx.stop();
future.cancel(true);
}
});
}
/**
* 清理指定 heatId 的执行上下文和 Future
*/
public synchronized void clearCraftContext(HeatModuleCode heatModuleCode) {

83
src/main/java/com/iflytop/gd/app/service/crafts/CraftsStepService.java

@ -5,21 +5,20 @@ import cn.hutool.json.JSONObject;
import com.iflytop.gd.app.core.CraftsDebugGenerator;
import com.iflytop.gd.app.model.bo.CraftsStep;
import com.iflytop.gd.app.model.bo.Point3D;
import com.iflytop.gd.app.model.entity.Container;
import com.iflytop.gd.app.service.api.ContainerService;
import com.iflytop.gd.app.service.api.DevicePositionService;
import com.iflytop.gd.app.service.device.DeviceCommandTempUtilService;
import com.iflytop.gd.app.service.device.DeviceStateService;
import com.iflytop.gd.app.service.device.module.*;
import com.iflytop.gd.app.service.device.module.CapModuleService;
import com.iflytop.gd.app.service.device.module.GantryModuleService;
import com.iflytop.gd.app.service.device.module.HeatModuleService;
import com.iflytop.gd.app.service.device.module.SolutionModuleService;
import com.iflytop.gd.app.ws.server.WebSocketSender;
import com.iflytop.gd.common.command.CommandFuture;
import com.iflytop.gd.common.enums.AcidPumpDeviceCode;
import com.iflytop.gd.common.enums.HeatModuleCode;
import com.iflytop.gd.common.enums.HeatingType;
import com.iflytop.gd.common.enums.data.DevicePositionCode;
import com.iflytop.gd.common.exception.AppException;
import com.iflytop.gd.common.result.ResultCode;
import com.iflytop.gd.common.utils.CommandUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@ -41,13 +40,12 @@ public class CraftsStepService {
private final DevicePositionService devicePositionService;
private final DeviceStateService deviceStateService;
private final DeviceCommandTempUtilService deviceCommandTempUtilService;
private final OtherModuleService otherModuleService;
/**
* 执行单个工艺步骤
*
* @param heatModuleCode 加热区 ID
* @param step 工艺步骤包括 method params
* @param step 工艺步骤包括 method params
* @return true 表示执行成功false 表示失败
*/
public boolean executeStep(HeatModuleCode heatModuleCode, CraftsStep step) throws Exception {
@ -67,23 +65,7 @@ public class CraftsStepService {
*/
private boolean addLiquid(HeatModuleCode heatModuleCode, JSONObject params) throws Exception {
//TODO 判断加液区是否有托盘如果没有托盘的话判断加热区是否有托盘然后将其移动至加液区
if((deviceStateService.getDeviceState().getSolutionModule().getTrayStatus() == 0 )
&& deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).getTrayStatus() == 0) {
throw new AppException(ResultCode.CRAFT_NO_TRAY);
}
if((deviceStateService.getDeviceState().getSolutionModule().getTrayStatus() == 0 )
&& deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).getTrayStatus() == 1) {
moveToSolutionModule(heatModuleCode);
}
JSONArray tubeNums = params.getJSONArray("tubeNums");
for (int i = 0; i < tubeNums.size(); i++) {
JSONObject tubeSol = tubeNums.getJSONObject(i);
Integer tubeNum = tubeSol.getInt("tubeNum");
}
moveToSolutionModule(heatModuleCode);
JSONArray tubeSolList = params.getJSONArray("tubeSolList");
for (int i = 0; i < tubeSolList.size(); i++) {
JSONObject tubeSol = tubeSolList.getJSONObject(i);
@ -93,15 +75,14 @@ public class CraftsStepService {
JSONObject addLiquid = addLiquidList.getJSONObject(j);
Long solId = addLiquid.getLong("solId");
Double volume = addLiquid.getDouble("volume");
Container container = containerService.getContainerBySolutionId(solId);
if (container == null) {
throw new AppException(ResultCode.CONTAINER_NOT_FOUND);//未找到对应溶液容器
AcidPumpDeviceCode acidPumpDevice = containerService.getPumpBySolutionId(solId);
if (acidPumpDevice == null) {
throw new AppException(ResultCode.CRAFT_CONTAINER_NOT_FOUND);
}
AcidPumpDeviceCode acidPumpDevice = AcidPumpDeviceCode.valueOf(container.getPumpId());//
int scale = container.getScale() == null ? 120 : container.getScale();//系数
webSocketService.pushCraftsDebug(CraftsDebugGenerator.generateJson(heatModuleCode.toString(), "移动加液机械臂到指定试管", tubeNum));
solutionModuleService.dualRobotMovePoint(tubeNum);//移动加液机械臂到指定试管
CommandFuture deviceCommandFuture = solutionModuleService.acidPumpMoveBy(acidPumpDevice, volume * ((double) scale /100));//添加溶液
CommandUtil.wait(deviceCommandFuture);
webSocketService.pushCraftsDebug(CraftsDebugGenerator.generateJson(heatModuleCode.toString(), "添加溶液", addLiquid));
solutionModuleService.acidPumpMoveBy(acidPumpDevice, volume);//添加溶液
}
}
solutionModuleService.dualRobotOrigin();
@ -133,15 +114,8 @@ public class CraftsStepService {
Double temperature = params.getDouble("temperature");
Integer second = params.getInt("second");
heatModuleService.heatRodOpen(heatModuleCode, temperature);//开始加热
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setHeatingType(HeatingType.thermostatic);
//达到目标温度后才算开始加热
while (deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).getTemperature() + 1 < temperature) {
delay(1);
}
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setHeatingType(HeatingType.constant);
delay(second);
heatModuleService.heatRodClose(heatModuleCode);//停止加热
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setHeatingType(HeatingType.finish);
heatModuleService.heaterMotorMove(heatModuleCode, trayLift);//抬升加热位托盘
return true;
}
@ -175,15 +149,6 @@ public class CraftsStepService {
}
/**
* 工艺执行完毕
*/
public void finish(HeatModuleCode heatModuleCode) throws Exception {
moveToSolutionModule(heatModuleCode);
//蜂鸣器提示
// otherModuleService.craftsFinishBeepRemind();
}
/**
* 将托盘移至加热
*/
private void moveToHeatModule(HeatModuleCode heatModuleCode) throws Exception {
@ -204,30 +169,29 @@ public class CraftsStepService {
Point3D heatAreaCapClawPointPoint3D = heatModuleService.getHeatAreaCapClawPointPoint3D(heatModuleCode);//获取指定加热模块拍子上方点位
Point3D capStorageCapClawPoint3D = devicePositionService.getPosition(DevicePositionCode.capStorageCapClawPoint).getPoint3D();//获取拍子存放区上方点位;
capModuleService.capUpBalanceNoWait();//提升拍子存放区至拍子夹取的高度
gantryModuleService.gantryMove(liquidAreaTrayPoint3D); //将机械臂移动至加液模块上方
gantryModuleService.clawMove(clawTrayPick);//将夹爪打开准备夹取托盘
gantryModuleService.gantryZMove(solutionModuleTrayMoveHeight);//下降z轴,使夹爪落入托盘孔位
gantryModuleService.clawMove(clawTrayGrip);//将夹爪收紧夹住托盘
gantryModuleService.gantryZMove(0);//抬升z轴
deviceStateService.getDeviceState().getSolutionModule().setTrayStatus(0);//加液模块是否有托盘
// deviceCommandTempUtilService.moveTrayHeatModuleAvoidDown(null);//TODO 结构有问题临时避让 开始移动托盘之前先降下所有加热模块
deviceCommandTempUtilService.moveTrayHeatModuleAvoidDown(null);//TODO 结构有问题临时避让 开始移动托盘之前先降下所有加热模块
gantryModuleService.gantryMove(heatArea4TrayClawPoint3D);//将携带托盘的机械臂移动至4号加热模块上方
gantryModuleService.gantryMove(heatAreaTrayClawPoint3D);//将携带托盘的机械臂移动至加热模块上方
// deviceCommandUtilService.heaterMotorMove( heatModuleId, trayLift);//抬升加热位托盘 TODO 结构有问题临时避让 屏蔽
deviceCommandTempUtilService.moveTrayHeatModuleAvoidUpNoWait(heatModuleCode);Thread.sleep(3200);//TODO 结构有问题临时避让 完毕可以升起了顺带提升目标加热模块
deviceCommandTempUtilService.moveTrayHeatModuleAvoidUp(heatModuleCode);//TODO 结构有问题临时避让 完毕可以升起了顺带提升目标加热模块
gantryModuleService.gantryZMove(heatModuleTrayMoveHeight);//下降z轴,使托盘落入加热模块
gantryModuleService.clawMove(clawTrayPick);//将夹爪打开释放托盘
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setTrayStatus(1);//加热模块是否存在托盘
gantryModuleService.gantryZMove(0);//抬升z轴
capModuleService.capUpBalance();//提升拍子存放区至拍子夹取的高度
gantryModuleService.gantryMove(capStorageCapClawPoint3D);//移动机械臂至拍子存放区上方
gantryModuleService.clawMove(clawCapPick);//将夹爪打开准备夹取拍子
gantryModuleService.gantryZMove(capModuleCapMoveHeight);//下降z轴,使夹爪落入拍子升降模块拍子孔位
gantryModuleService.clawMove(clawCapGrip);//将夹爪收紧夹住拍子
gantryModuleService.gantryZMove(0);//抬升z轴
gantryModuleService.gantryMove(heatAreaCapClawPointPoint3D);//将携带拍子的机械臂移动至加热模块拍子上方
capModuleService.capUpBalanceNoWait(); //提升拍子存放区
gantryModuleService.gantryZMove(heatModuleCapMoveHeight);//下降z轴,使夹拍子落入加热模块
gantryModuleService.clawMove(clawCapPick);//将夹爪打开释放拍子
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setCapExist(true);//加热模块是否存在拍子
@ -236,8 +200,11 @@ public class CraftsStepService {
// trayState.setInHeatModule(true);
heatModuleService.heaterMotorMove(heatModuleCode, trayLower);//下降加热模块托盘
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setTrayUp(0);//加热模块托盘升降状态
capModuleService.capUpBalance(); //提升拍子存放区
gantryModuleService.gantryMove(capStorageCapClawPoint3D);//移动机械臂至拍子存放区上方
heatModuleService.heaterMotorMove(heatModuleCode, trayLower);//下降加热位托盘
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setTrayStatus(1);
solutionModuleService.releaseSolutionModule();//释放加液区
}
@ -265,15 +232,15 @@ public class CraftsStepService {
// TrayState trayState = deviceStateService.getTrayInSolutionModule();
solutionModuleService.requestSolutionModule();//申请使用加液区并等待
capModuleService.capUpBalanceNoWait(); //提升拍子存放区至拍子夹取的高度
capModuleService.capUpBalance(); //提升拍子存放区至拍子夹取的高度
gantryModuleService.gantryMove(heatAreaCapClawPointPoint3D);//将机械臂移动至加热模块拍子上方
heatModuleService.heaterMotorMove(heatModuleCode, trayLift);//抬升指定加热位托盘
gantryModuleService.clawMove(clawCapPick);//将夹爪打开准备夹取拍子
gantryModuleService.gantryZMove(heatModuleCapMoveHeight);//下降z轴,使夹爪落入加热模块拍子孔位
gantryModuleService.clawMove(clawCapGrip);//将夹爪收紧夹住拍子
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setCapExist(false);//加热模块是否存在拍子
capModuleService.capMotorMoveByNumNoWait(-1);//拍子存放模块下降1个拍子位置
gantryModuleService.gantryZMove(0); Thread.sleep(2000);//抬升z轴
gantryModuleService.gantryZMove(0);//抬升z轴
capModuleService.capMotorMoveByNum(-1);//拍子存放模块下降1个拍子位置
gantryModuleService.gantryMove(capStorageCapClawPoint3D);//将携带拍子的机械臂移动至存放区上方
gantryModuleService.gantryZMove(capModuleCapMoveHeight);//下降z轴,使夹拍子落入存放区
gantryModuleService.clawMove(clawCapPick);//将夹爪打开释放夹取的拍子
@ -286,16 +253,16 @@ public class CraftsStepService {
gantryModuleService.clawMove(clawTrayGrip);//将夹爪收紧夹住托盘
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setTrayStatus(0);//加热模块是否存在托盘
// trayState.setInHeatModule(false);//托盘是否在加热模块中
deviceCommandTempUtilService.moveTrayHeatModuleAvoidDownNoWait(heatModuleCode);//TODO 临时避让下降
gantryModuleService.gantryZMove(0);Thread.sleep(2500);//抬升z轴
gantryModuleService.gantryZMove(0);//抬升z轴
// deviceCommandUtilService.heaterMotorMove( heatModuleId, trayLower);//下降加热模块托盘
// deviceStateService.setHeatModuleStateTrayUp(heatModuleId, 0);//加热模块托盘升降状态
deviceCommandTempUtilService.moveTrayHeatModuleAvoidDown(heatModuleCode);//TODO 临时避让下降
gantryModuleService.gantryMove(heatArea4TrayClawPoint3D);//将携带托盘的机械臂移动至4号加热模块上方
gantryModuleService.gantryMove(liquidAreaTrayPoint3D); //将携带托盘的机械臂移动至加液模块上方
deviceCommandTempUtilService.moveTrayHeatModuleAvoidUp(null, heatModuleCode);//TODO 临时避 恢复抬起状态
deviceCommandTempUtilService.moveTrayHeatModuleAvoidDown(null);//TODO 临时避 恢复抬起状态
gantryModuleService.gantryZMove(solutionModuleTrayMoveHeight);//下降z轴,使托盘落入加液模块
// trayState.setInSolutionModule(true);//托盘是否在加液模块中
deviceStateService.getDeviceState().getSolutionModule().setTrayStatus(1);//加液模块是否存在托盘
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setTrayStatus(1);//加液模块是否存在托盘
gantryModuleService.clawMove(clawTrayPick);//将夹爪打开释放托盘
gantryModuleService.gantryZMove(0);//抬升z轴
gantryModuleService.gantryMove(capStorageCapClawPoint3D);//移动机械臂至拍子存放区上方

6
src/main/java/com/iflytop/gd/common/result/ResultCode.java

@ -37,11 +37,9 @@ public enum ResultCode implements IResultCode, Serializable {
OPERATION_NOT_ALLOWED("4003", "业务操作不允许"),
DATA_ALREADY_EXISTS("4004", "数据已存在"),
CONTAINER_NOT_FOUND("4005", "未找到对应溶液容器"),
CRAFT_RUNNING("4101", "工艺正在执行"),
CRAFT_CONTEXT_NULL("4102", "请先配置该加热区工艺"),
CRAFT_NO_TRAY("4005", "工艺未找到托盘"),
CRAFT_CONTAINER_NOT_FOUND("4005", "工艺未找到对应溶液容器"),
//============================ 5xxx系统 & 第三方 ============================
SYSTEM_ERROR("5000", "系统内部错误"),
SERVICE_UNAVAILABLE("5001", "服务暂不可用"),
@ -59,8 +57,6 @@ public enum ResultCode implements IResultCode, Serializable {
CAP_LIFT_ERROR("6024", "拍子升降错误"),
CMD_BUSY("6025", "设备忙,请稍后"),
HEAT_MODULE_NO_IDLE("6026", "加热模块无空闲"),
CAP_MODULE_NO_CAP("6027", "拍子存放区未检测到拍子"),
SOLUTION_MODULE_OCCUPIED("6028", "加液模块被占用"),
;
/** 状态码 */
private final String code;

Loading…
Cancel
Save