REV 单工NDC

This commit is contained in:
2023-06-20 16:44:00 +08:00
parent 865fbe58f4
commit 1c60718e8c
5 changed files with 25 additions and 47 deletions

View File

@@ -148,17 +148,17 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
} }
} }
} }
} else if (phase == 0x1A) { }else if (phase == 0x30) {
instructionService.finishByLinkNum(String.valueOf(ikey));
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} else if (phase == 0x30) {
//请求删除任务 //请求删除任务
data = ndcAgvService.sendAgvTwoModeInst(143, index, 0); data = ndcAgvService.sendAgvTwoModeInst(143, index, 0);
} else if (phase == 0xFF) { } else if (phase == 0xFF) {
//任务删除确认 //任务删除确认
instructionService.forceCancelByLinkNum(String.valueOf(ikey)); instructionService.forceCancelByLinkNum(String.valueOf(ikey));
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} else { } else if (phase == 0x1A) {
instructionService.finishByLinkNum(String.valueOf(ikey));
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} else {
if (phase == 0x67) { if (phase == 0x67) {
//agv上报异常 //agv上报异常
device = deviceAppService.findDeviceByCode(Integer.toString(arr[27])); device = deviceAppService.findDeviceByCode(Integer.toString(arr[27]));

View File

@@ -115,16 +115,13 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
} }
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0); data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);
} }
} else if (phase == 0x0A) {
instructionService.finishByLinkNum(String.valueOf(ikey));
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);
} else if (phase == 0x30) { } else if (phase == 0x30) {
data = ndcAgvService.sendAgvOneModeInst(143, index, 0); data = ndcAgvService.sendAgvOneModeInst(143, index, 0);
} else if (phase == 0xFF) { } else if (phase == 0xFF) {
instructionService.cancelByLinkNum(String.valueOf(ikey)); instructionService.forceCancelByLinkNum(String.valueOf(ikey));
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);
} else if (phase == 0x0A) {
instructionService.finishByLinkNum(String.valueOf(ikey));
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0); data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);
} else if (phase == 0x50) { } else if (phase == 0x50) {
//离开区域 //离开区域

View File

@@ -163,7 +163,6 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
this.index = index; this.index = index;
this.inst = inst; this.inst = inst;
logServer.deviceExecuteLog(device_code, "", "", "设置phase值--->" + agvphase + ",index值--->" + index + ",指令信息关联编号--->" + (inst == null ? "" : inst.getLink_num())); logServer.deviceExecuteLog(device_code, "", "", "设置phase值--->" + agvphase + ",index值--->" + index + ",指令信息关联编号--->" + (inst == null ? "" : inst.getLink_num()));
} }
@Override @Override

View File

@@ -6,8 +6,10 @@ import com.alibaba.fastjson.JSONObject;
import lombok.Data; import lombok.Data;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.acs.acsEnum.InstActionEnum;
import org.nl.acs.agv.server.AgvService; import org.nl.acs.agv.server.AgvService;
import org.nl.acs.agv.server.NDCAgvService; import org.nl.acs.agv.server.NDCAgvService;
import org.nl.acs.auto.run.OneNDCSocketConnectionAutoRun;
import org.nl.acs.device.service.DeviceService; import org.nl.acs.device.service.DeviceService;
import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.RouteableDeviceDriver;
@@ -122,6 +124,7 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple
this.agvphase = agvphase; this.agvphase = agvphase;
this.index = index; this.index = index;
this.inst = inst; this.inst = inst;
logServer.deviceExecuteLog(device_code, "", "", "设置phase值--->" + agvphase + ",index值--->" + index + ",指令信息关联编号--->" + (inst == null ? "" : inst.getLink_num()));
} }
int mode = 2; int mode = 2;
@@ -136,63 +139,41 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple
if (agvphase == 0x03) { if (agvphase == 0x03) {
if (ObjectUtil.isNotEmpty(inst)) { if (ObjectUtil.isNotEmpty(inst)) {
inst.setExecute_status("1"); inst.setExecute_status(InstActionEnum.EXECUTE_TO_GET.getCode());
instructionService.update(inst); instructionService.update(inst);
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
agvphase = 0; OneNDCSocketConnectionAutoRun.write(data);
index = 0; this.set(0, 0, null);
inst = null;
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
} else {
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
} }
} }
if (agvphase == 0x05) { if (agvphase == 0x05) {
if (ObjectUtil.isNotEmpty(inst)) { if (ObjectUtil.isNotEmpty(inst)) {
inst.setExecute_status("2"); inst.setExecute_status(InstActionEnum.EXECUTE_GET_FINISH.getCode());
instructionService.update(inst); instructionService.update(inst);
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
// OneNDCSocketConnectionAutoRun.write(data); OneNDCSocketConnectionAutoRun.write(data);
agvphase = 0; this.set(0, 0, null);
index = 0;
inst = null;
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
} else {
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
} }
} }
if (agvphase == 0x07) { if (agvphase == 0x07) {
if (ObjectUtil.isNotEmpty(inst)) { if (ObjectUtil.isNotEmpty(inst)) {
inst.setExecute_status("5"); inst.setExecute_status(InstActionEnum.EXECUTE_TO_PUT_FALL_SEND_FULL.getCode());
instructionService.update(inst); instructionService.update(inst);
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
// OneNDCSocketConnectionAutoRun.write(data); OneNDCSocketConnectionAutoRun.write(data);
agvphase = 0; this.set(0, 0, null);
index = 0;
inst = null;
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
} else {
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
} }
} }
if (agvphase == 0x09) { if (agvphase == 0x09) {
if (ObjectUtil.isNotEmpty(inst)) { if (ObjectUtil.isNotEmpty(inst)) {
inst.setExecute_status("6"); inst.setExecute_status(InstActionEnum.EXECUTE_PUT_FALL_SEND_FULL_FINISH.getCode());
instructionService.update(inst); instructionService.update(inst);
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
// OneNDCSocketConnectionAutoRun.write(data); OneNDCSocketConnectionAutoRun.write(data);
agvphase = 0; this.set(0, 0, null);
index = 0;
inst = null;
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
} else {
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
} }
} }

View File

@@ -199,6 +199,7 @@ public interface InstructionService {
*/ */
void cancelByLinkNum(String linkNum) throws Exception; void cancelByLinkNum(String linkNum) throws Exception;
/** /**
* 根据指令Id强制取消指令 * 根据指令Id强制取消指令
* *