REV 单工NDC
This commit is contained in:
@@ -148,17 +148,17 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (phase == 0x1A) {
|
||||
instructionService.finishByLinkNum(String.valueOf(ikey));
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||
} else if (phase == 0x30) {
|
||||
}else if (phase == 0x30) {
|
||||
//请求删除任务
|
||||
data = ndcAgvService.sendAgvTwoModeInst(143, index, 0);
|
||||
} else if (phase == 0xFF) {
|
||||
//任务删除确认
|
||||
instructionService.forceCancelByLinkNum(String.valueOf(ikey));
|
||||
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) {
|
||||
//agv上报异常
|
||||
device = deviceAppService.findDeviceByCode(Integer.toString(arr[27]));
|
||||
|
||||
@@ -115,16 +115,13 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
}
|
||||
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) {
|
||||
data = ndcAgvService.sendAgvOneModeInst(143, index, 0);
|
||||
|
||||
} 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);
|
||||
} else if (phase == 0x50) {
|
||||
//离开区域
|
||||
|
||||
@@ -163,7 +163,6 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
this.index = index;
|
||||
this.inst = inst;
|
||||
logServer.deviceExecuteLog(device_code, "", "", "设置phase值--->" + agvphase + ",index值--->" + index + ",指令信息关联编号--->" + (inst == null ? "" : inst.getLink_num()));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,8 +6,10 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.acsEnum.InstActionEnum;
|
||||
import org.nl.acs.agv.server.AgvService;
|
||||
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_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||
@@ -122,6 +124,7 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple
|
||||
this.agvphase = agvphase;
|
||||
this.index = index;
|
||||
this.inst = inst;
|
||||
logServer.deviceExecuteLog(device_code, "", "", "设置phase值--->" + agvphase + ",index值--->" + index + ",指令信息关联编号--->" + (inst == null ? "" : inst.getLink_num()));
|
||||
}
|
||||
|
||||
int mode = 2;
|
||||
@@ -136,63 +139,41 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple
|
||||
|
||||
if (agvphase == 0x03) {
|
||||
if (ObjectUtil.isNotEmpty(inst)) {
|
||||
inst.setExecute_status("1");
|
||||
inst.setExecute_status(InstActionEnum.EXECUTE_TO_GET.getCode());
|
||||
instructionService.update(inst);
|
||||
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||
agvphase = 0;
|
||||
index = 0;
|
||||
inst = null;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||
} else {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
||||
|
||||
OneNDCSocketConnectionAutoRun.write(data);
|
||||
this.set(0, 0, null);
|
||||
}
|
||||
}
|
||||
|
||||
if (agvphase == 0x05) {
|
||||
if (ObjectUtil.isNotEmpty(inst)) {
|
||||
inst.setExecute_status("2");
|
||||
inst.setExecute_status(InstActionEnum.EXECUTE_GET_FINISH.getCode());
|
||||
instructionService.update(inst);
|
||||
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||
// OneNDCSocketConnectionAutoRun.write(data);
|
||||
agvphase = 0;
|
||||
index = 0;
|
||||
inst = null;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||
} else {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
||||
|
||||
OneNDCSocketConnectionAutoRun.write(data);
|
||||
this.set(0, 0, null);
|
||||
}
|
||||
}
|
||||
|
||||
if (agvphase == 0x07) {
|
||||
if (ObjectUtil.isNotEmpty(inst)) {
|
||||
inst.setExecute_status("5");
|
||||
inst.setExecute_status(InstActionEnum.EXECUTE_TO_PUT_FALL_SEND_FULL.getCode());
|
||||
instructionService.update(inst);
|
||||
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||
// OneNDCSocketConnectionAutoRun.write(data);
|
||||
agvphase = 0;
|
||||
index = 0;
|
||||
inst = null;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||
} else {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
||||
OneNDCSocketConnectionAutoRun.write(data);
|
||||
this.set(0, 0, null);
|
||||
}
|
||||
}
|
||||
|
||||
if (agvphase == 0x09) {
|
||||
if (ObjectUtil.isNotEmpty(inst)) {
|
||||
inst.setExecute_status("6");
|
||||
inst.setExecute_status(InstActionEnum.EXECUTE_PUT_FALL_SEND_FULL_FINISH.getCode());
|
||||
instructionService.update(inst);
|
||||
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||
// OneNDCSocketConnectionAutoRun.write(data);
|
||||
agvphase = 0;
|
||||
index = 0;
|
||||
inst = null;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||
} else {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
||||
|
||||
OneNDCSocketConnectionAutoRun.write(data);
|
||||
this.set(0, 0, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -199,6 +199,7 @@ public interface InstructionService {
|
||||
*/
|
||||
void cancelByLinkNum(String linkNum) throws Exception;
|
||||
|
||||
|
||||
/**
|
||||
* 根据指令Id强制取消指令
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user