opt:优化自动充电
This commit is contained in:
@@ -116,7 +116,6 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
bs.append(temp < 16 ? bs1.append(Integer.toHexString(temp)) : Integer.toHexString(temp));
|
||||
}
|
||||
|
||||
//System.out.println("收到请求参数:" + bs);
|
||||
boolean flag = false;
|
||||
if (arr[8] * 256 + arr[9] == 0x73) {
|
||||
byte[] data = null;
|
||||
@@ -127,12 +126,12 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
int index = arr[12] * 256 + arr[13];
|
||||
//任务号
|
||||
int ikey = arr[26] * 256 + arr[27];
|
||||
//站点号
|
||||
//agv车号
|
||||
int agvaddr = arr[18] * 256 + arr[19];
|
||||
//车号
|
||||
int carno = arr[20];
|
||||
//充电桩站点号
|
||||
int station=arr[25];
|
||||
int station = arr[25];
|
||||
|
||||
Instruction link_inst = null;
|
||||
Instruction inst = null;
|
||||
@@ -152,7 +151,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
link_flag = true;
|
||||
}
|
||||
log.info("接收agv上报信息:" + bs);
|
||||
log.info("接收agv上报信息:" + "phase--" + phase + " index--" + index + " ikey--" + ikey + " agvaddr--" + agvaddr + " Car--" + carno);
|
||||
log.info("接收agv上报信息:" + "phase--" + phase + " index--" + index + " ikey--" + ikey + " agvaddr--" + agvaddr + " carno--" + carno+" station--"+station);
|
||||
Device device = null;
|
||||
String device_code = null;
|
||||
String old_device_code = null;
|
||||
@@ -169,7 +168,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
}
|
||||
device = deviceAppService.findDeviceByCode(device_code);
|
||||
}
|
||||
|
||||
log.info("接收agv上报信息,agvaddr != 0,device:"+device);
|
||||
//
|
||||
AgvNdcOneDeviceDriver agvNdcOneDeviceDriver;
|
||||
StandardAutodoorDeviceDriver standardAutodoorDeviceDriver;
|
||||
@@ -284,11 +283,19 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
else {
|
||||
//上报异常信息
|
||||
//(不需要WCS反馈)
|
||||
if (phase == 0x67) {
|
||||
/* if (phase == 0x67) {
|
||||
device = deviceAppService.findDeviceByCode(Integer.toString(arr[27]));
|
||||
} else {
|
||||
device = deviceAppService.findDeviceByCode(Integer.toString(arr[20]));
|
||||
}*/
|
||||
if (phase == 0x67) {
|
||||
device = deviceAppService.findDeviceByCode(Integer.toString(arr[27]));
|
||||
} else if (phase == 0x73) {
|
||||
device = deviceAppService.findDeviceByCode(Integer.toString(agvaddr));
|
||||
}else{
|
||||
device = deviceAppService.findDeviceByCode(Integer.toString(arr[20]));
|
||||
}
|
||||
log.info("接收agv上报信息,上报异常信息:" + device);
|
||||
if (ObjectUtil.isNotEmpty(device)) {
|
||||
if (device.getDeviceDriver() instanceof AgvNdcOneDeviceDriver) {
|
||||
agvNdcOneDeviceDriver = (AgvNdcOneDeviceDriver) device.getDeviceDriver();
|
||||
|
||||
@@ -99,6 +99,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
if (carno != 0) {
|
||||
agv_device = deviceAppService.findDeviceByCode(String.valueOf(carno));
|
||||
}
|
||||
log.info("接收agv上报信息,agv_device:" + agv_device);
|
||||
if (ikey != 0) {
|
||||
inst = instructionService.findByCodeFromCache(String.valueOf(ikey));
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
@@ -108,7 +109,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
if (!ObjectUtil.isEmpty(link_inst)) {
|
||||
link_flag = true;
|
||||
}
|
||||
|
||||
log.info("接收agv上报信息,link_flag:" + link_flag);
|
||||
Device device = null;
|
||||
String old_device_code = null;
|
||||
String emptyNum = null;
|
||||
@@ -325,10 +326,12 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
|
||||
}else if (phase == 0x73) {
|
||||
log.info("接收agv上报信息,phase == 0x73:" + phase);
|
||||
//agv电量
|
||||
electric_qty = ikey;
|
||||
//是否开启自动充电
|
||||
String is_atuo_electric = paramService.findByCode(AcsConfig.IS_ATUO_ELECTRIC).getValue();
|
||||
log.info("接收agv上报信息,is_atuo_electric:" + is_atuo_electric);
|
||||
if("1".equals(is_atuo_electric)){
|
||||
int electric = Integer.parseInt(paramService.findByCode(AcsConfig.ELECTRIC).getValue());
|
||||
if (electric_qty>0&&electric_qty < electric) {
|
||||
@@ -351,6 +354,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
}
|
||||
}
|
||||
|
||||
@LokiLog(type = LokiLogType.ACS_TO_LMS)
|
||||
private byte[] getData(byte[] data, int index, Instruction inst, TaskDto task) {
|
||||
String next_point;
|
||||
String start_point;
|
||||
|
||||
Reference in New Issue
Block a user