add:刻字称重
This commit is contained in:
@@ -35,7 +35,9 @@ import org.nl.modules.system.service.impl.ParamServiceImpl;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* NDC单工位AGV
|
||||
@@ -134,7 +136,6 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
instructionService.update(inst);
|
||||
}
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
|
||||
|
||||
//请求取货
|
||||
} else if (phase == 0x03) {
|
||||
if (agvaddr == 0) {
|
||||
@@ -220,29 +221,29 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
|
||||
|
||||
} else if (phase == 0x65) {//param,重量待定
|
||||
//1、得到重量信息
|
||||
int weight = (arr[18] * 256 + arr[19]) * 10;
|
||||
for (Instruction inst : insts) {
|
||||
//校验agv上报站点编号与指令起始点相同
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到关联编号{}对应的指令", ikey);
|
||||
break;
|
||||
int weight = 0;
|
||||
//称重在包装机1上面
|
||||
Device a1_bzj_1 = deviceAppService.findDeviceByCode("A1_BZJ_1");
|
||||
if (a1_bzj_1 != null) {
|
||||
if (a1_bzj_1.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver) {
|
||||
hailiangPackerStationDeviceDriver = (HailiangPackerStationDeviceDriver) a1_bzj_1.getDeviceDriver();
|
||||
if (hailiangPackerStationDeviceDriver.getCache_weight() > 0) {
|
||||
weight = hailiangPackerStationDeviceDriver.getCache_weight();
|
||||
for (Instruction inst : insts) {
|
||||
TaskDto taskDto = taskService.findByCodeFromCache(inst.getTask_code());
|
||||
if (taskDto != null) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("weight", String.valueOf(weight));
|
||||
taskDto.setExt_param(map);
|
||||
taskDto.setWeight(String.valueOf(weight));
|
||||
taskService.update(taskDto);
|
||||
}
|
||||
}
|
||||
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
|
||||
}
|
||||
}
|
||||
// 4010 待处理
|
||||
// if (StrUtil.equals(inst.getStart_device_code(), device_code)) {
|
||||
inst.setWeight(String.valueOf(weight));
|
||||
instructionService.update(inst);
|
||||
TaskDto taskDto = taskService.findByCodeFromCache(inst.getTask_code());
|
||||
if (taskDto != null) {
|
||||
taskDto.setWeight(String.valueOf(weight));
|
||||
taskService.update(taskDto);
|
||||
}
|
||||
//}
|
||||
}
|
||||
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
|
||||
|
||||
//取货完毕/取满框完毕1/点对点取货完毕
|
||||
} else if (phase == 0x64) {//param,agv货位id待定
|
||||
//1、根据货位id找到对应三工位设备,赋给agv属性地址对应的满料位设备
|
||||
@@ -250,7 +251,6 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
agvaddr_copy = agvaddr;
|
||||
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
|
||||
|
||||
//取货完毕
|
||||
} else if (phase == 0x05) {
|
||||
if (agvaddr == 0) {
|
||||
|
||||
Reference in New Issue
Block a user