rev 下发信号日志记录

This commit is contained in:
2023-05-06 18:07:57 +08:00
parent e9acc99e44
commit ba3aa5a6c9
12 changed files with 240 additions and 3 deletions

View File

@@ -71,6 +71,22 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_task);
}
public int getTo_command() {
return this.getOpcIntegerValue(item_to_command);
}
public int getTo_target() {
return this.getOpcIntegerValue(item_to_target);
}
public int getTo_task() {
return this.getOpcIntegerValue(item_to_task);
}
public int getTo_onset() {
return this.getOpcIntegerValue(item_to_onset);
}
Boolean isonline;

View File

@@ -88,7 +88,17 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
int heartbeat = 0;
int last_heartbeat = 0;
int to_command = 0;
int last_to_command = 0;
int to_target = 0;
int last_to_target = 0;
int to_task = 0;
int last_to_task = 0;
int to_onset = 0;
int last_to_onset = 0;
Boolean isonline = true;
int hasGoods = 0;
@@ -137,9 +147,26 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
error = this.itemProtocol.getError();
task = this.itemProtocol.getTask();
heartbeat = this.itemProtocol.getHeartbeat();
to_command = this.itemProtocol.getTo_command();
to_target = this.itemProtocol.getTo_target();
to_task = this.itemProtocol.getTo_task();
to_onset = this.itemProtocol.getTo_onset();
// if(heartbeat != last_heartbeat){
// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat);
// }
if (to_onset != last_to_onset) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_onset" + last_to_onset + "->" + to_onset);
}
if (to_command != last_to_command) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command" + last_to_command + "->" + to_command);
}
if (to_target != last_to_target) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_target" + last_to_target + "->" + to_target);
}
if (to_task != last_to_task) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task" + last_to_task + "->" + to_task);
}
if (mode != last_mode) {
if (mode == 2) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号复位前requireSuccess" + requireSucess);
@@ -527,6 +554,10 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
last_error = error;
last_task = task;
last_heartbeat = heartbeat;
last_to_task = to_task;
last_to_command = to_command;
last_to_target = to_target;
last_to_onset = to_onset;
}

View File

@@ -77,6 +77,14 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_to_command);
}
public int getTo_target() {
return this.getOpcIntegerValue(item_to_target);
}
public int getTo_task() {
return this.getOpcIntegerValue(item_to_task);
}
Boolean isonline;

View File

@@ -103,6 +103,13 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
int agvphase = 0;
String task_code = null;
int to_command = 0;
int last_to_command = 0;
int to_target = 0;
int last_to_target = 0;
int to_task = 0;
int last_to_task = 0;
int phase = 0;
int index = 0;
@@ -161,10 +168,22 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
error = this.itemProtocol.getError();
task = this.itemProtocol.getTask();
to_command = this.itemProtocol.getTo_command();
to_target = this.itemProtocol.getTo_target();
to_task = this.itemProtocol.getTo_task();
heartbeat = this.itemProtocol.getHeartbeat();
// if(heartbeat != last_heartbeat){
// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat);
// }
if (to_command != last_to_command) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command" + last_to_command + "->" + to_command);
}
if (to_target != last_to_target) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_target" + last_to_target + "->" + to_target);
}
if (to_task != last_to_task) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task" + last_to_task + "->" + to_task);
}
if (mode != last_mode) {
requireSucess = false;
requireApplyLabelingSuccess = false;
@@ -337,6 +356,9 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
last_error = error;
last_task = task;
last_heartbeat = heartbeat;
last_to_task = to_task;
last_to_command = to_command;
last_to_target = to_target;
}
private void shipDeviceUpdate() {

View File

@@ -73,6 +73,17 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_task);
}
public int getTo_command() {
return this.getOpcIntegerValue(item_to_command);
}
public int getTo_target() {
return this.getOpcIntegerValue(item_to_target);
}
public int getTo_task() {
return this.getOpcIntegerValue(item_to_task);
}
Boolean isonline;

View File

@@ -125,7 +125,14 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
int branchProtocol = 0;
String inst_message;
String last_inst_message;
int to_command = 0;
int last_to_command = 0;
int to_target = 0;
int last_to_target = 0;
int to_task = 0;
int last_to_task = 0;
//当前指令
//暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域
@@ -152,9 +159,21 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
error = this.itemProtocol.getError();
task = this.itemProtocol.getTask();
heartbeat = this.itemProtocol.getHeartbeat();
to_command = this.itemProtocol.getTo_command();
to_target = this.itemProtocol.getTo_target();
to_task = this.itemProtocol.getTo_task();
// if(heartbeat != last_heartbeat){
// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat);
// }
if (to_command != last_to_command) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command" + last_to_command + "->" + to_command);
}
if (to_target != last_to_target) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_target" + last_to_target + "->" + to_target);
}
if (to_task != last_to_task) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task" + last_to_task + "->" + to_task);
}
if (mode != last_mode) {
if (mode == 2) {
requireSucess = false;
@@ -284,6 +303,9 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
last_error = error;
last_task = task;
last_heartbeat = heartbeat;
last_to_task = to_task;
last_to_command = to_command;
last_to_target = to_target;
}
private void shipDeviceUpdate() {

View File

@@ -77,6 +77,14 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_to_command);
}
public int getTo_target() {
return this.getOpcIntegerValue(item_to_target);
}
public int getTo_task() {
return this.getOpcIntegerValue(item_to_task);
}
Boolean isonline;

View File

@@ -97,6 +97,13 @@ public class SiemensOneFloorAGVConveyorDeviceDriver extends AbstractOpcDeviceDri
int agvphase = 0;
String task_code = null;
int to_command = 0;
int last_to_command = 0;
int to_target = 0;
int last_to_target = 0;
int to_task = 0;
int last_to_task = 0;
private String error_type = "ssx_error_type";
int phase = 0;
int index = 0;
@@ -152,6 +159,17 @@ public class SiemensOneFloorAGVConveyorDeviceDriver extends AbstractOpcDeviceDri
error = this.itemProtocol.getError();
task = this.itemProtocol.getTask();
to_command = this.itemProtocol.getTo_command();
to_target = this.itemProtocol.getTo_target();
to_task = this.itemProtocol.getTo_task();
if (to_command != last_to_command) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command" + last_to_command + "->" + to_command);
}
if (to_target != last_to_target) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_target" + last_to_target + "->" + to_target);
}
if (to_task != last_to_task) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task" + last_to_task + "->" + to_task);
}
if (error != last_error) {
if (error != 0) {
DeviceErrorLogDto dto = new DeviceErrorLogDto();
@@ -185,6 +203,9 @@ public class SiemensOneFloorAGVConveyorDeviceDriver extends AbstractOpcDeviceDri
last_carrier_direction = carrier_direction;
last_error = error;
last_task = task;
last_to_task = to_task;
last_to_command = to_command;
last_to_target = to_target;
}

View File

@@ -128,6 +128,22 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_to_task2);
}
public int getTo_target1() {
return this.getOpcIntegerValue(item_to_target1);
}
public int getTo_target2() {
return this.getOpcIntegerValue(item_to_target2);
}
public int getTo_onset1() {
return this.getOpcIntegerValue(item_to_onset1);
}
public int getTo_onset2() {
return this.getOpcIntegerValue(item_to_onset2);
}
//是否有货
public int hasGoods(int move) {

View File

@@ -101,9 +101,22 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
int task2 = 0;
int last_task2 = 0;
int to_command1 = 0;
int last_to_command1 = 0;
int to_command2 = 0;
int last_to_command2 = 0;
int to_task1 = 0;
int last_to_task1 = 0;
int to_task2 = 0;
int last_to_task2 = 0;
int to_target1 = 0;
int last_to_target1 = 0;
int to_target2 = 0;
int last_to_target2 = 0;
int to_onset1 = 0;
int last_to_onset1 = 0;
int to_onset2 = 0;
int last_to_onset2 = 0;
Boolean isonline = true;
//前工位申请任务请求标记
Boolean requireSucess = false;
@@ -179,6 +192,36 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
heartbeat = this.itemProtocol.getHeartbeat();
to_task1 = this.itemProtocol.getTo_task1();
to_task2 = this.itemProtocol.getTo_task2();
to_target1 = this.itemProtocol.getTo_target1();
to_target2 = this.itemProtocol.getTo_target2();
to_onset1 = this.itemProtocol.getTo_onset1();
to_onset2 = this.itemProtocol.getTo_onset2();
if (to_command1 != last_to_command1) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command1" + last_to_command1 + "->" + to_command1);
}
if (to_target1 != last_to_target1) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_target1" + last_to_target1 + "->" + to_target1);
}
if (to_task1 != last_to_task1) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task1" + last_to_task1 + "->" + to_task1);
}
if (to_onset1 != last_to_onset1) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_onset1" + last_to_onset1 + "->" + to_onset1);
}
if (to_command2 != last_to_command2) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command2" + last_to_command2 + "->" + to_command2);
}
if (to_target2 != last_to_target2) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_target2" + last_to_target2 + "->" + to_target2);
}
if (to_task2 != last_to_task2) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task2" + last_to_task2 + "->" + to_task2);
}
if (to_onset2 != last_to_onset2) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_onset2" + last_to_onset2 + "->" + to_onset2);
}
// if(heartbeat != last_heartbeat){
// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat);
// }
@@ -761,6 +804,14 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
last_task1 = task1;
last_task2 = task2;
last_heartbeat = heartbeat;
last_to_command1 = to_command1;
last_to_task1 = to_task1;
last_to_onset1 = to_onset1;
last_to_target1 = to_target1;
last_to_command2 = to_command2;
last_to_task2 = to_task2;
last_to_onset2 = to_onset2;
last_to_target2 = to_target2;
}
public synchronized boolean task_check() {

View File

@@ -92,7 +92,15 @@ public class ItemProtocol {
return this.getOpcStringValue(item_barcode);
}
public int getTotTask() {
public int getTo_command() {
return this.getOpcIntegerValue(item_to_command);
}
public int getTo_target() {
return this.getOpcIntegerValue(item_to_target);
}
public int getTo_task() {
return this.getOpcIntegerValue(item_to_task);
}

View File

@@ -95,7 +95,6 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
int error = 0;
int task = 0;
int weight = 0;
int to_task = 0;
String plcbarcode = null;
String last_plcbarcode = null;
int plcbarcode_length = 0;
@@ -117,6 +116,15 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
String inst_message;
String device_code;
int to_command = 0;
int last_to_command = 0;
int to_target = 0;
int last_to_target = 0;
int to_task = 0;
int last_to_task = 0;
String message;
private String error_type = "ssx_error_type";
//请求成功标记
@@ -207,8 +215,20 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
task = this.itemProtocol.getTask();
plcbarcode = this.itemProtocol.getplcBarCode();
plcbarcode_length = this.itemProtocol.getBarCode_length();
to_task = this.itemProtocol.getTotTask();
to_command = this.itemProtocol.getTo_command();
to_target = this.itemProtocol.getTo_target();
to_task = this.itemProtocol.getTo_task();
weight = this.itemProtocol.getWeight();
if (to_command != last_to_command) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command" + last_to_command + "->" + to_command);
}
if (to_target != last_to_target) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_target" + last_to_target + "->" + to_target);
}
if (to_task != last_to_task) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task" + last_to_task + "->" + to_task);
}
if (mode != last_mode) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode + "复位请求标记");
if (mode == 2) {
@@ -351,6 +371,9 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
last_plcbarcode_length = plcbarcode_length;
last_plcbarcode = plcbarcode;
last_weight = weight;
last_to_task = to_task;
last_to_command = to_command;
last_to_target = to_target;
}
public boolean exe_error() {