|
|
@ -20,7 +20,6 @@ import org.nl.system.service.dict.dao.Dict; |
|
|
|
import org.nl.system.service.lucene.LuceneExecuteLogService; |
|
|
|
import org.nl.system.service.param.ISysParamService; |
|
|
|
import org.nl.config.SpringContextHolder; |
|
|
|
import org.nl.system.service.param.impl.SysParamServiceImpl; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
@ -44,10 +43,6 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable { |
|
|
|
static DataInputStream dis; |
|
|
|
private int recordTimeOut = 10000; |
|
|
|
private Date recordTime; |
|
|
|
String[] ERROR = new String[]{ |
|
|
|
"货叉尖部传感器触发", "S300传感器触发", "载货状态改变", "急停按钮触发", "触边开关出发", "需要复位", |
|
|
|
"停在充电位", "取货失败", "放货失败", "轮子打滑", "没有动作码不能进入站点", "取货时有货", "丢失定位", |
|
|
|
"抬叉停止"}; |
|
|
|
boolean bConnected = true; |
|
|
|
|
|
|
|
boolean isReConnect = false; |
|
|
@ -76,7 +71,6 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable { |
|
|
|
|
|
|
|
public void autoRun() throws IOException { |
|
|
|
System.out.println("NDCAgv链接开始"); |
|
|
|
ISysParamService ISysParamService = SpringContextHolder.getBean(SysParamServiceImpl.class); |
|
|
|
InstructionService instructionService = SpringContextHolder.getBean(InstructionServiceImpl.class); |
|
|
|
NDCAgvService NDCAgvService = SpringContextHolder.getBean(NDCAgvService.class); |
|
|
|
DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppService.class); |
|
|
@ -141,7 +135,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable { |
|
|
|
link_flag = true; |
|
|
|
} |
|
|
|
log.info("接收agv上报信息:" + bs); |
|
|
|
log.info("接收agv上报信息:" + "phase--" + phase + " index--" + index + " ikey--" + ikey + " agvaddr--" + agvaddr + " carno--" + 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; |
|
|
@ -242,7 +236,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable { |
|
|
|
//充电任务下发成功上报
|
|
|
|
} else if (phase == 0x64){ |
|
|
|
log.info("AGV车号{}反馈充电任务下发成功,锁定充电桩{}",agvaddr,station); |
|
|
|
Dict dict = dictService.getDictByName3("station",null,String.valueOf(station)); |
|
|
|
Dict dict = dictService.getDictByName3("station",String.valueOf(agvaddr),null); |
|
|
|
if (ObjectUtil.isNotEmpty(dict)){ |
|
|
|
dict.setValue("1"); |
|
|
|
dict.setPara2(String.valueOf(agvaddr)); |
|
|
@ -255,11 +249,11 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable { |
|
|
|
//充电取消上报
|
|
|
|
}else if (phase == 0x66){ |
|
|
|
log.info("AGV车号{}反馈充电任务已取消,释放充电桩{}",agvaddr,station); |
|
|
|
Dict dict = dictService.getDictByName3("station",String.valueOf(agvaddr),String.valueOf(station)); |
|
|
|
Dict dict = dictService.getDictByName3("station",String.valueOf(agvaddr),null); |
|
|
|
if (ObjectUtil.isNotEmpty(dict)){ |
|
|
|
dict.setValue("0"); |
|
|
|
dict.setPara2(""); |
|
|
|
dict.setPara3(""); |
|
|
|
dict.setPara3("充电桩空闲"); |
|
|
|
dictService.updateDetail(dict); |
|
|
|
} |
|
|
|
} |
|
|
|