Browse Source

fix:

1、设备开机后不再自动加热、关闭所有真空阀门
2、工艺降温的时候停止加热,正确赋予状态
3、工艺移动拍子不再下降托盘,但是5号位置要从2号位绕行一下
master
白凤吉 1 month ago
parent
commit
3eaa4ac83c
  1. 5
      src/main/java/com/iflytop/gd/app/service/crafts/CraftsStepService.java
  2. 15
      src/main/java/com/iflytop/gd/app/service/device/ActionCommandService.java
  3. 19
      src/main/java/com/iflytop/gd/app/service/device/DeviceCommandTempUtilService.java
  4. 27
      src/main/java/com/iflytop/gd/app/service/device/DeviceInitService.java

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

@ -223,7 +223,9 @@ public class CraftsStepService {
if (temperature > targetTemperature) { if (temperature > targetTemperature) {
log.info("工艺{},开启风扇降温中", heatModuleCode); log.info("工艺{},开启风扇降温中", heatModuleCode);
if (HeatingType.constant.equals(heatModuleState.getHeatingType())) {
heatModuleService.heatRodClose(heatModuleCode);
}
heatModuleService.fanStart(heatModuleCode); heatModuleService.fanStart(heatModuleCode);
heatModuleState.setHeatingType(HeatingType.cooling); heatModuleState.setHeatingType(HeatingType.cooling);
heatModuleState.setFanOpen(true); heatModuleState.setFanOpen(true);
@ -241,6 +243,7 @@ public class CraftsStepService {
heatModuleState.setFanOpen(false); heatModuleState.setFanOpen(false);
log.info("工艺{},开始加热至目标温度", heatModuleCode); log.info("工艺{},开始加热至目标温度", heatModuleCode);
heatModuleService.heatRodOpen(heatModuleCode, targetTemperature); heatModuleService.heatRodOpen(heatModuleCode, targetTemperature);
heatModuleState.setHeatingType(HeatingType.constant);
heatModuleState.setStartHeatTime(LocalDateTime.now()); heatModuleState.setStartHeatTime(LocalDateTime.now());
} else { } else {
if (heatModuleState.isFanOpen()) { if (heatModuleState.isFanOpen()) {

15
src/main/java/com/iflytop/gd/app/service/device/ActionCommandService.java

@ -99,10 +99,10 @@ public class ActionCommandService {
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setCapExist(false);//加热模块是否存在拍子 deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setCapExist(false);//加热模块是否存在拍子
capModuleService.capMotorMoveByNumNoWait(commandId, command, -1);//拍子存放模块下降1个拍子位置 capModuleService.capMotorMoveByNumNoWait(commandId, command, -1);//拍子存放模块下降1个拍子位置
gantryModuleService.gantryZMoveZero(commandId, command);//抬升z轴 gantryModuleService.gantryZMoveZero(commandId, command);//抬升z轴
heatModuleService.heaterMotorMoveNoWait(commandId, command, heatModuleCode, trayLower);//下降加热模块
Thread.sleep(2500);
// heatModuleService.heaterMotorMoveNoWait(commandId, command, heatModuleCode, trayLower);//下降加热模块
// Thread.sleep(2500);
deviceCommandTempUtilService.carryMoveXYToSolutionManyPoints(commandId, command, heatModuleCode, ClawItemType.cap);//携带拍子移动至存放区 deviceCommandTempUtilService.carryMoveXYToSolutionManyPoints(commandId, command, heatModuleCode, ClawItemType.cap);//携带拍子移动至存放区
deviceCommandTempUtilService.moveTrayHeatModuleAvoidUpNoWait(commandId, command, heatModuleCode);//移动完毕恢复抬升状态
deviceCommandTempUtilService.moveTrayHeatModuleAvoidUpNoWait(commandId, command, null);//移动完毕恢复抬升状态
gantryModuleService.gantryZMove(capModuleCapMoveHeight);//下降z轴,使夹拍子落入存放区 gantryModuleService.gantryZMove(capModuleCapMoveHeight);//下降z轴,使夹拍子落入存放区
gantryModuleService.clawMove(commandId, command, clawCapPick);//将夹爪打开释放夹取的拍子 gantryModuleService.clawMove(commandId, command, clawCapPick);//将夹爪打开释放夹取的拍子
gantryModuleService.gantryZMoveZero(commandId, command);//抬升z轴 gantryModuleService.gantryZMoveZero(commandId, command);//抬升z轴
@ -123,19 +123,18 @@ public class ActionCommandService {
double capModuleCapMoveHeight = devicePositionService.getPosition(DevicePositionCode.capModuleCapMoveHeight).getDistance();//拍子升降模块拍子z轴移动高度 double capModuleCapMoveHeight = devicePositionService.getPosition(DevicePositionCode.capModuleCapMoveHeight).getDistance();//拍子升降模块拍子z轴移动高度
Point3D capStorageCapClawPoint3D = devicePositionService.getPosition(DevicePositionCode.capStorageCapClawPoint).getPoint3D();//获取拍子存放区上方点位; Point3D capStorageCapClawPoint3D = devicePositionService.getPosition(DevicePositionCode.capStorageCapClawPoint).getPoint3D();//获取拍子存放区上方点位;
heatModuleService.heaterMotorMoveNoWait(commandId, command, heatModuleCode, trayLower);//确保目标加热模块是下降状态
// heatModuleService.heaterMotorMoveNoWait(commandId, command, heatModuleCode, trayLower);//确保目标加热模块是下降状态
gantryModuleService.gantryXYMove(commandId, command, capStorageCapClawPoint3D);//移动机械臂至拍子存放区上方 gantryModuleService.gantryXYMove(commandId, command, capStorageCapClawPoint3D);//移动机械臂至拍子存放区上方
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setTrayUp(0);//将加热模块托盘状态改为下降
// deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setTrayUp(0);//将加热模块托盘状态改为下降
gantryModuleService.clawMove(commandId, command, clawCapPick);//将夹爪打开准备夹取拍子 gantryModuleService.clawMove(commandId, command, clawCapPick);//将夹爪打开准备夹取拍子
gantryModuleService.gantryZMove(capModuleCapMoveHeight);//下降z轴,使夹爪落入拍子升降模块拍子孔位 gantryModuleService.gantryZMove(capModuleCapMoveHeight);//下降z轴,使夹爪落入拍子升降模块拍子孔位
gantryModuleService.clawMove(commandId, command, clawCapGrip);//将夹爪收紧夹住拍子 gantryModuleService.clawMove(commandId, command, clawCapGrip);//将夹爪收紧夹住拍子
gantryModuleService.gantryZMoveZero(commandId, command);//抬升z轴 gantryModuleService.gantryZMoveZero(commandId, command);//抬升z轴
deviceCommandTempUtilService.carryMoveXYToHeatManyPoints(commandId, command, heatModuleCode, ClawItemType.cap);//将拍子移动至目标加热模块上方 deviceCommandTempUtilService.carryMoveXYToHeatManyPoints(commandId, command, heatModuleCode, ClawItemType.cap);//将拍子移动至目标加热模块上方
capModuleService.capUpBalanceNoWait(commandId, command); //提升拍子存放区
// capModuleService.capUpBalanceNoWait(commandId, command); //提升拍子存放区
deviceCommandTempUtilService.moveTrayHeatModuleAvoidUpNoWait(commandId, command, heatModuleCode);
Thread.sleep(3700);
deviceCommandTempUtilService.moveTrayHeatModuleAvoidUpNoWait(commandId, command, null);
gantryModuleService.gantryZMove(heatModuleCapMoveHeight);//下降z轴,使夹拍子落入加热模块 gantryModuleService.gantryZMove(heatModuleCapMoveHeight);//下降z轴,使夹拍子落入加热模块
gantryModuleService.clawMove(commandId, command, clawCapPick);//将夹爪打开释放拍子 gantryModuleService.clawMove(commandId, command, clawCapPick);//将夹爪打开释放拍子

19
src/main/java/com/iflytop/gd/app/service/device/DeviceCommandTempUtilService.java

@ -5,7 +5,6 @@ import com.iflytop.gd.app.model.bo.status.device.HeatModuleState;
import com.iflytop.gd.app.service.api.DevicePositionService; import com.iflytop.gd.app.service.api.DevicePositionService;
import com.iflytop.gd.app.service.device.module.GantryModuleService; 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.HeatModuleService;
import com.iflytop.gd.app.service.device.module.SolutionModuleService;
import com.iflytop.gd.common.command.CommandFuture; import com.iflytop.gd.common.command.CommandFuture;
import com.iflytop.gd.common.command.DeviceCommandBundle; import com.iflytop.gd.common.command.DeviceCommandBundle;
import com.iflytop.gd.common.command.DeviceCommandGenerator; import com.iflytop.gd.common.command.DeviceCommandGenerator;
@ -56,6 +55,7 @@ public class DeviceCommandTempUtilService {
Point3D heatArea3TrayClawPoint3D = heatModuleService.getHeatAreaTrayClawPoint3D(HeatModuleCode.heat_module_03); Point3D heatArea3TrayClawPoint3D = heatModuleService.getHeatAreaTrayClawPoint3D(HeatModuleCode.heat_module_03);
Point3D heatArea4TrayClawPoint3D = heatModuleService.getHeatAreaTrayClawPoint3D(HeatModuleCode.heat_module_04); Point3D heatArea4TrayClawPoint3D = heatModuleService.getHeatAreaTrayClawPoint3D(HeatModuleCode.heat_module_04);
Point3D heatArea2CapClawPoint3D = heatModuleService.getHeatAreaCapClawPointPoint3D(HeatModuleCode.heat_module_02);
Point3D heatArea3CapClawPoint3D = heatModuleService.getHeatAreaCapClawPointPoint3D(HeatModuleCode.heat_module_03); Point3D heatArea3CapClawPoint3D = heatModuleService.getHeatAreaCapClawPointPoint3D(HeatModuleCode.heat_module_03);
Point3D[] points = new Point3D[]{}; Point3D[] points = new Point3D[]{};
@ -148,7 +148,7 @@ public class DeviceCommandTempUtilService {
} else if (HeatModuleCode.heat_module_05.equals(targetHeatModuleCode)) { } else if (HeatModuleCode.heat_module_05.equals(targetHeatModuleCode)) {
if (ClawItemType.cap.equals(clawItemType)) {//移动拍子 if (ClawItemType.cap.equals(clawItemType)) {//移动拍子
//路线 存放区 //路线 存放区
points = new Point3D[]{capStorageCapClawPoint3D};
points = new Point3D[]{heatArea2CapClawPoint3D, capStorageCapClawPoint3D};
//不避让的模块 //不避让的模块
moveTrayHeatModuleAvoidDown(commandId, command, null, moveTrayHeatModuleAvoidDown(commandId, command, null,
HeatModuleCode.heat_module_03, HeatModuleCode.heat_module_03,
@ -175,14 +175,14 @@ public class DeviceCommandTempUtilService {
HeatModuleCode.heat_module_05, HeatModuleCode.heat_module_05,
HeatModuleCode.heat_module_06); HeatModuleCode.heat_module_06);
} else if (ClawItemType.tray.equals(clawItemType)) {//移动托盘 } else if (ClawItemType.tray.equals(clawItemType)) {//移动托盘
if(deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_05).getTrayStatus() == 1){
if (deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_05).getTrayStatus() == 1) {
//路线 314加液 //路线 314加液
points = new Point3D[]{heatArea3TrayClawPoint3D, heatArea1TrayClawPoint3D, heatArea4TrayClawPoint3D, liquidAreaTrayPoint3D}; points = new Point3D[]{heatArea3TrayClawPoint3D, heatArea1TrayClawPoint3D, heatArea4TrayClawPoint3D, liquidAreaTrayPoint3D};
//不避让的模块 //不避让的模块
moveTrayHeatModuleAvoidDown(commandId, command, null, moveTrayHeatModuleAvoidDown(commandId, command, null,
HeatModuleCode.heat_module_05, HeatModuleCode.heat_module_05,
HeatModuleCode.heat_module_06); HeatModuleCode.heat_module_06);
}else{
} else {
//路线 加液 //路线 加液
points = new Point3D[]{liquidAreaTrayPoint3D}; points = new Point3D[]{liquidAreaTrayPoint3D};
//不避让的模块 //不避让的模块
@ -313,11 +313,12 @@ public class DeviceCommandTempUtilService {
} }
} else if (HeatModuleCode.heat_module_05.equals(targetHeatModuleCode)) { } else if (HeatModuleCode.heat_module_05.equals(targetHeatModuleCode)) {
if (ClawItemType.cap.equals(clawItemType)) {//移动拍子 if (ClawItemType.cap.equals(clawItemType)) {//移动拍子
//路线 5
points = new Point3D[]{heatArea5CapClawPoint3D};
//路线 25
points = new Point3D[]{heatArea2CapClawPoint3D, heatArea5CapClawPoint3D};
//不避让的模块 //不避让的模块
moveTrayHeatModuleAvoidDown(commandId, command, null, moveTrayHeatModuleAvoidDown(commandId, command, null,
HeatModuleCode.heat_module_03, HeatModuleCode.heat_module_03,
HeatModuleCode.heat_module_04,
HeatModuleCode.heat_module_05, HeatModuleCode.heat_module_05,
HeatModuleCode.heat_module_06); HeatModuleCode.heat_module_06);
} else if (ClawItemType.tray.equals(clawItemType)) {//移动托盘 } else if (ClawItemType.tray.equals(clawItemType)) {//移动托盘
@ -341,15 +342,15 @@ public class DeviceCommandTempUtilService {
HeatModuleCode.heat_module_05, HeatModuleCode.heat_module_05,
HeatModuleCode.heat_module_06); HeatModuleCode.heat_module_06);
} else if (ClawItemType.tray.equals(clawItemType)) {//移动托盘 } else if (ClawItemType.tray.equals(clawItemType)) {//移动托盘
if(deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_05).getTrayStatus() == 1
|| deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_05).getTrayUp() == 1){
if (deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_05).getTrayStatus() == 1
|| deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_05).getTrayUp() == 1) {
//路线 4136 //路线 4136
points = new Point3D[]{heatArea4TrayClawPoint3D, heatArea1TrayClawPoint3D, heatArea3TrayClawPoint3D, heatArea6TrayClawPoint3D}; points = new Point3D[]{heatArea4TrayClawPoint3D, heatArea1TrayClawPoint3D, heatArea3TrayClawPoint3D, heatArea6TrayClawPoint3D};
//不避让的模块 //不避让的模块
moveTrayHeatModuleAvoidDown(commandId, command, null, moveTrayHeatModuleAvoidDown(commandId, command, null,
HeatModuleCode.heat_module_05, HeatModuleCode.heat_module_05,
HeatModuleCode.heat_module_06); HeatModuleCode.heat_module_06);
}else{
} else {
//路线 6 //路线 6
points = new Point3D[]{heatArea6TrayClawPoint3D}; points = new Point3D[]{heatArea6TrayClawPoint3D};
//不避让的模块 //不避让的模块

27
src/main/java/com/iflytop/gd/app/service/device/DeviceInitService.java

@ -1,6 +1,5 @@
package com.iflytop.gd.app.service.device; package com.iflytop.gd.app.service.device;
import ch.qos.logback.core.joran.conditional.ThenAction;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.iflytop.gd.app.model.bo.DeviceInitializationData; import com.iflytop.gd.app.model.bo.DeviceInitializationData;
import com.iflytop.gd.app.model.bo.status.device.DeviceState; import com.iflytop.gd.app.model.bo.status.device.DeviceState;
@ -10,6 +9,7 @@ import com.iflytop.gd.app.model.entity.Container;
import com.iflytop.gd.app.model.entity.DeviceParamConfig; import com.iflytop.gd.app.model.entity.DeviceParamConfig;
import com.iflytop.gd.app.service.api.ContainerService; import com.iflytop.gd.app.service.api.ContainerService;
import com.iflytop.gd.app.service.api.DeviceParamConfigService; import com.iflytop.gd.app.service.api.DeviceParamConfigService;
import com.iflytop.gd.app.service.device.module.HeatModuleService;
import com.iflytop.gd.common.enums.ContainerCode; import com.iflytop.gd.common.enums.ContainerCode;
import com.iflytop.gd.common.enums.ContainerType; import com.iflytop.gd.common.enums.ContainerType;
import com.iflytop.gd.common.enums.HeatModuleCode; import com.iflytop.gd.common.enums.HeatModuleCode;
@ -60,6 +60,7 @@ public class DeviceInitService {
private final ObjectProvider<HeatModuleState> heatModuleStateProvider; private final ObjectProvider<HeatModuleState> heatModuleStateProvider;
private final ObjectProvider<SolutionContainerState> solutionContainerStateProvider; private final ObjectProvider<SolutionContainerState> solutionContainerStateProvider;
private final AppEventBusService eventBus; private final AppEventBusService eventBus;
private final HeatModuleService heatModuleService;
private boolean isLink = false; private boolean isLink = false;
@PostConstruct @PostConstruct
@ -79,6 +80,7 @@ public class DeviceInitService {
initDeviceSetData(); initDeviceSetData();
initOvertime(); initOvertime();
initEnable(); initEnable();
initOther();
try { try {
tricolorLightDriver.open(MId.TriColorLight, TricolorLightDriver.Color.GREEN); tricolorLightDriver.open(MId.TriColorLight, TricolorLightDriver.Color.GREEN);
} catch (HardwareException e) { } catch (HardwareException e) {
@ -150,7 +152,7 @@ public class DeviceInitService {
} }
public void initDeviceSetData() throws Exception { public void initDeviceSetData() throws Exception {
while (!isLink){
while (!isLink) {
Thread.sleep(100); Thread.sleep(100);
} }
if (deviceStateService.getDeviceState().isVirtual() || deviceStateService.getDeviceState().isInitComplete()) { if (deviceStateService.getDeviceState().isVirtual() || deviceStateService.getDeviceState().isInitComplete()) {
@ -199,4 +201,25 @@ public class DeviceInitService {
} }
log.info("初始化 initDeviceState完毕"); log.info("初始化 initDeviceState完毕");
} }
public void initOther() {
log.info("初始化 initOther");
for (HeatModuleCode heatModuleCode : HeatModuleCode.values()) {
CompletableFuture.runAsync(() -> {
try {
heatModuleService.heatRodClose(heatModuleCode);
} catch (Exception e) {
log.info("初始化 initOther 关闭加热错误:{}", heatModuleCode);
}
});
CompletableFuture.runAsync(() -> {
try {
heatModuleService.vacuumValveClose(heatModuleCode);
} catch (Exception e) {
log.info("初始化 initOther 关闭真空泵阀门错误:{}", heatModuleCode);
}
});
}
log.info("初始化initOther完毕");
}
} }
Loading…
Cancel
Save