opt:宁波富佳NDC优化

This commit is contained in:
2025-09-22 09:00:45 +08:00
parent 258dcb8c45
commit 6335da2009
5 changed files with 248 additions and 24 deletions

View File

@@ -366,7 +366,7 @@ public class NDCAgvServiceImpl implements NDCAgvService {
(byte) 0X00, (byte) 0X6D,
(byte) 0X00, (byte) 0X06,
(byte) indexhigh, (byte) indexlow,
(byte) 0X01, (byte) 0X10,
(byte) 0X01, (byte) 0X12,
(byte) phasehigh, (byte) phaselow
};

View File

@@ -209,7 +209,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
}
//任务完毕
//无车id及状态
else if (phase == 0x14) {
else if (phase == 0x0A) {
if (ObjectUtil.isEmpty(inst)) {
log.info("未找到指令号{}对应的指令", ikey);
} else {

View File

@@ -138,15 +138,15 @@ public class AutoCreateInst {
} else {
next_point_code = next_device_code;
}
BeltConveyorDeviceDriver beltConveyorDeviceDriver;
if (nextdevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextdevice.getDeviceDriver();
if (beltConveyorDeviceDriver.getType() != 2) {
beltConveyorDeviceDriver.writing("to_command","7");
log.info("当前输送线出入库信号不为出库");
continue;
}
}
// BeltConveyorDeviceDriver beltConveyorDeviceDriver;
// if (nextdevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
// beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextdevice.getDeviceDriver();
// if (beltConveyorDeviceDriver.getType() != 2) {
// beltConveyorDeviceDriver.writing("to_command","7");
// log.info("当前输送线出入库信号不为出库");
// continue;
// }
// }
Instruction instdto = new Instruction();
@@ -188,22 +188,29 @@ public class AutoCreateInst {
instdto.setNext_height(next_height);
instdto.setAgv_action_type(agvActionType);
//本项目默认类型 1
if (StrUtil.equals(agv_system_type, CommonFinalParam.TWO)) {
instdto.setAgv_inst_type("1");
} else {
instdto.setAgv_inst_type("4");
}
try {
instructionService.create(instdto);
beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextdevice.getDeviceDriver();
//满足出库,查询当前出库任务,+1后返回给
if (beltConveyorDeviceDriver.getType() == 2) {
synchronized (this) {
if (beltConveyorDeviceDriver.getType() == 2) {
//因为已经创建成功,因此这个时候可以+1了
int count = instructionService.queryInstructionCount(next_device_code);
beltConveyorDeviceDriver.updateOutboundTaskNum(count,false);
beltConveyorDeviceDriver.writing("to_taskNum", count + "");
nextdevice.setOutbound_task_num(count);
}
}
}
// beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextdevice.getDeviceDriver();
// //满足出库,查询当前出库任务,+1后返回给
// if (beltConveyorDeviceDriver.getType() == 2) {
// synchronized (this) {
// if (beltConveyorDeviceDriver.getType() == 2) {
// //因为已经创建成功,因此这个时候可以+1了
// int count = instructionService.queryInstructionCount(next_device_code);
// beltConveyorDeviceDriver.updateOutboundTaskNum(count,false);
// beltConveyorDeviceDriver.writing("to_taskNum", count + "");
// nextdevice.setOutbound_task_num(count);
// }
// }
// }
} catch (Exception e) {
acsTask.setRemark(e.getMessage());
taskserver.updateByCodeFromCache(acsTask);