agv
This commit is contained in:
@@ -757,9 +757,10 @@ public class AgvServiceImpl implements AgvService {
|
||||
(byte) indexhigh, (byte) indexlow,
|
||||
};
|
||||
log.info("下发删除AGV指令--{}", Bytes2HexString(b));
|
||||
|
||||
NDCSocketConnectionAutoRun.write(b);
|
||||
System.out.println("下发删除agv指令数据:" + Bytes2HexString(b));
|
||||
if (ObjectUtil.isNotEmpty(b)){
|
||||
NDCSocketConnectionAutoRun.write(b);
|
||||
System.out.println("下发删除agv指令数据:" + Bytes2HexString(b));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,6 +58,20 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
int weight = 0;
|
||||
String device_code = "";
|
||||
int phase = 0;
|
||||
|
||||
int x = 0; //x坐标
|
||||
int y = 0; //y坐标
|
||||
int angle = 0; //角度
|
||||
int electric_qty = 0; //电量
|
||||
int status = 0; //三色灯状态
|
||||
int error = 0; //车辆故障
|
||||
|
||||
int last_x = 0;
|
||||
int last_y = 0;
|
||||
int last_angle = 0;
|
||||
int last_electric_qty = 0;
|
||||
int last_status = 0;
|
||||
int last_error = 0;
|
||||
public synchronized void processSocket(int[] arr) throws Exception {
|
||||
device_code = this.getDeviceCode();
|
||||
byte[] data = null;
|
||||
@@ -423,6 +437,36 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
}
|
||||
logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data);
|
||||
|
||||
} else if (phase == 0x71){
|
||||
x = ikey;
|
||||
if (x != last_x){
|
||||
logServer.deviceLog(this.device_code, "x", String.valueOf(x));
|
||||
}
|
||||
} else if (phase == 0x72){
|
||||
y = ikey;
|
||||
if (y != last_y){
|
||||
logServer.deviceLog(this.device_code, "y", String.valueOf(y));
|
||||
}
|
||||
} else if (phase == 0x73){
|
||||
angle = last_angle;
|
||||
if (angle != last_angle){
|
||||
logServer.deviceLog(this.device_code, "angle", String.valueOf(angle));
|
||||
}
|
||||
} else if (phase == 0x74){
|
||||
electric_qty = ikey;
|
||||
if (electric_qty != last_electric_qty){
|
||||
logServer.deviceLog(this.device_code, "electric_qty", String.valueOf(electric_qty));
|
||||
}
|
||||
} else if (phase == 0x75){
|
||||
status = ikey;
|
||||
if (status != last_status){
|
||||
logServer.deviceLog(this.device_code, "status", String.valueOf(status));
|
||||
}
|
||||
} else if (phase == 0x76){
|
||||
error = ikey;
|
||||
if (error != last_error){
|
||||
logServer.deviceLog(this.device_code, "error", String.valueOf(error));
|
||||
}
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(data)) {
|
||||
logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data);
|
||||
|
||||
@@ -55,7 +55,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
String device_code = "";
|
||||
int phase = 0;
|
||||
|
||||
int x = 0; //x坐标
|
||||
int y = 0; //y坐标
|
||||
int angle = 0; //角度
|
||||
int electric_qty = 0; //电量
|
||||
int status = 0; //三色灯状态
|
||||
int error = 0; //车辆故障
|
||||
|
||||
int last_x = 0;
|
||||
int last_y = 0;
|
||||
int last_angle = 0;
|
||||
int last_electric_qty = 0;
|
||||
int last_status = 0;
|
||||
int last_error = 0;
|
||||
public synchronized void processSocket(int[] arr) throws Exception {
|
||||
device_code = this.getDeviceCode();
|
||||
logServer.deviceLogToacs(this.device_code,"","","接收AGV上报信息:" + arr);
|
||||
@@ -686,6 +698,36 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
data = AgvService.sendAgvTwoModeInst(143, index, 0);
|
||||
logServer.deviceLogToacs(this.device_code,"","","agvphase:" + phase + "反馈:"+data);
|
||||
|
||||
} else if (phase == 0x71){
|
||||
x = ikey;
|
||||
if (x != last_x){
|
||||
logServer.deviceLog(this.device_code, "x", String.valueOf(x));
|
||||
}
|
||||
} else if (phase == 0x72){
|
||||
y = ikey;
|
||||
if (y != last_y){
|
||||
logServer.deviceLog(this.device_code, "y", String.valueOf(y));
|
||||
}
|
||||
} else if (phase == 0x73){
|
||||
angle = last_angle;
|
||||
if (angle != last_angle){
|
||||
logServer.deviceLog(this.device_code, "angle", String.valueOf(angle));
|
||||
}
|
||||
} else if (phase == 0x74){
|
||||
electric_qty = ikey;
|
||||
if (electric_qty != last_electric_qty){
|
||||
logServer.deviceLog(this.device_code, "electric_qty", String.valueOf(electric_qty));
|
||||
}
|
||||
} else if (phase == 0x75){
|
||||
status = ikey;
|
||||
if (status != last_status){
|
||||
logServer.deviceLog(this.device_code, "status", String.valueOf(status));
|
||||
}
|
||||
} else if (phase == 0x76){
|
||||
error = ikey;
|
||||
if (error != last_error){
|
||||
logServer.deviceLog(this.device_code, "error", String.valueOf(error));
|
||||
}
|
||||
}
|
||||
|
||||
if (!ObjectUtil.isEmpty(data)) {
|
||||
|
||||
@@ -191,7 +191,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
logServer.deviceLog(this.device_code, "packer_ready", String.valueOf(packer_ready));
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "信号packer_ready:" + last_packer_ready + "->" + packer_ready);
|
||||
}
|
||||
if (lack_req != last_lack_req) {
|
||||
if (lack_req != last_lack_req) {
|
||||
if (lack_req == 0) {
|
||||
this.setRequireSucess(false);
|
||||
}
|
||||
@@ -228,14 +228,14 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "信号order_now:" + last_order_now + "->" + order_now);
|
||||
}
|
||||
|
||||
if (open_ready_time != last_open_ready_time) {
|
||||
/* if (open_ready_time != last_open_ready_time) {
|
||||
logServer.deviceLog(this.device_code, "open_ready_time", String.valueOf(open_ready_time));
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "信号open_ready_time:" + last_open_ready_time + "->" + open_ready_time);
|
||||
}
|
||||
if (device_running_time != last_device_running_time) {
|
||||
}*/
|
||||
/* if (device_running_time != last_device_running_time) {
|
||||
logServer.deviceLog(this.device_code, "device_running_time", String.valueOf(device_running_time));
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "信号device_running_time:" + last_device_running_time + "->" + device_running_time);
|
||||
}
|
||||
}*/
|
||||
if (await_time != last_await_time) {
|
||||
logServer.deviceLog(this.device_code, "await_time", String.valueOf(await_time));
|
||||
logServer.deviceLogToacs(this.device_code, "", "", "信号await_time:" + last_await_time + "->" + await_time);
|
||||
|
||||
Reference in New Issue
Block a user