Browse Source

add 反馈压机残留重量

master
周俊杰 1 year ago
parent
commit
51c9776bd1
  1. 2
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/RequestMethodEnum.java
  2. 48
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/ItemProtocol.java
  3. 288
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/LnshPalletizingManipulatorDeviceDriver.java
  4. 7
      acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_palletizing_manipulator.vue
  5. 7
      acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_station.vue

2
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/RequestMethodEnum.java

@ -42,7 +42,7 @@ public enum RequestMethodEnum {
feedback_device_status(16, "feedback_device_status", "反馈设备状态","1"), feedback_device_status(16, "feedback_device_status", "反馈设备状态","1"),
apply_feedback_weight(16, "apply_feedback_weight", "反馈压机残留重量","1"); apply_feedback_weight(16, "apply_feedback_weight", "反馈压机残留重量","0");
//驱动索引 //驱动索引

48
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/ItemProtocol.java

@ -65,6 +65,10 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_to_weight); return this.getOpcIntegerValue(item_to_weight);
} }
public String getTo_material_code() {
return this.getOpcStringValue(item_to_material_code);
}
public int getMode() { public int getMode() {
return this.getOpcIntegerValue(item_mode); return this.getOpcIntegerValue(item_mode);
} }
@ -85,6 +89,10 @@ public class ItemProtocol {
return this.getOpcStringValue(item_open_time); return this.getOpcStringValue(item_open_time);
} }
public String getToorderno() {
return this.getOpcStringValue(item_to_order_No);
}
public int getStandby_time() { public int getStandby_time() {
return this.getOpcIntegerValue(item_standby_time); return this.getOpcIntegerValue(item_standby_time);
} }
@ -121,44 +129,44 @@ public class ItemProtocol {
return this.getOpcStringValue(item_grinding_number); return this.getOpcStringValue(item_grinding_number);
} }
public String getHeight1() { public int getHeight1() {
return this.getOpcStringValue(item_height1); return this.getOpcIntegerValue(item_height1);
} }
public String getHeight2() { public int getHeight2() {
return this.getOpcStringValue(item_height2); return this.getOpcIntegerValue(item_height2);
} }
public String getHeight3() { public int getHeight3() {
return this.getOpcStringValue(item_height3); return this.getOpcIntegerValue(item_height3);
} }
public String getHeight4() { public int getHeight4() {
return this.getOpcStringValue(item_height4); return this.getOpcIntegerValue(item_height4);
} }
public String getWidth1() { public int getWidth1() {
return this.getOpcStringValue(item_width1); return this.getOpcIntegerValue(item_width1);
} }
public String getWidth2() { public int getWidth2() {
return this.getOpcStringValue(item_width2); return this.getOpcIntegerValue(item_width2);
} }
public String getLen() { public int getLen() {
return this.getOpcStringValue(item_len); return this.getOpcIntegerValue(item_len);
} }
public String getVolume() { public int getVolume() {
return this.getOpcStringValue(item_volume); return this.getOpcIntegerValue(item_volume);
} }
public String getFlatness() { public int getFlatness() {
return this.getOpcStringValue(item_flatness); return this.getOpcIntegerValue(item_flatness);
} }
public String getUnqualified_qty() { public int getUnqualified_qty() {
return this.getOpcStringValue(item_unqualified_qty); return this.getOpcIntegerValue(item_unqualified_qty);
} }
Boolean isonline; Boolean isonline;

288
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/LnshPalletizingManipulatorDeviceDriver.java

@ -32,6 +32,7 @@ import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.TaskService;
import org.nl.modules.lucene.service.LuceneExecuteLogService; import org.nl.modules.lucene.service.LuceneExecuteLogService;
import org.nl.modules.lucene.service.dto.LuceneLogDto; import org.nl.modules.lucene.service.dto.LuceneLogDto;
import org.nl.modules.system.domain.Param;
import org.nl.modules.wql.util.SpringContextHolder; import org.nl.modules.wql.util.SpringContextHolder;
import org.openscada.opc.lib.da.Server; import org.openscada.opc.lib.da.Server;
@ -70,7 +71,8 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri
int mode = 0; int mode = 0;
int move = 0; int move = 0;
int weight = 0;
String material_code="";
int error = 0; int error = 0;
int action = 0; int action = 0;
int last_action = 0; int last_action = 0;
@ -102,6 +104,18 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri
String device_code; String device_code;
int status = 0; int status = 0;
int last_status = 0; int last_status = 0;
String last_laser_marking_code="";
String last_grinding_number="";
int last_height1=0;
int last_height2=0;
int last_height3=0;
int last_height4=0;
int last_width1=0;
int last_width2=0;
int last_len=0;
int last_volume=0;
int last_flatness=0;
int last_unqualified_qty=0;
//开机时间 //开机时间
String open_time = "0"; String open_time = "0";
String last_open_time = "0"; String last_open_time = "0";
@ -119,32 +133,22 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri
int last_get_station = 0; int last_get_station = 0;
int put_station = 0; int put_station = 0;
int last_put_station = 0; int last_put_station = 0;
int is_qualified = 0; int is_qualified=0;
int last_is_qualified = 0; int last_is_qualified=0;
String laser_marking_code = ""; String laser_marking_code ="";
String last_laser_marking_code = ""; String grinding_number ="";
String grinding_number = ""; int height1 = 0;
String last_grinding_number = ""; int height2 = 0;
String height1 = ""; int height3 = 0;
String last_height1 = ""; int height4 = 0;
String height2 = ""; int width1 = 0;
String last_height2 = ""; int width2 = 0;
String height3 = ""; int len = 0;
String last_height3 = ""; int volume = 0;
String height4 = ""; int flatness =0;
String last_height4 = "";
String width1 = ""; int unqualified_qty=0;
String last_width1 = "";
String width2 = "";
String last_width2 = "";
String len = "";
String last_len = "";
String volume = "";
String last_volume = "";
String flatness = "";
String last_flatness = "";
String unqualified_qty = "";
String last_unqualified_qty = "";
@Override @Override
public Device getDevice() { public Device getDevice() {
@ -155,6 +159,7 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri
@Override @Override
public void execute() { public void execute() {
String message = null; String message = null;
try { try {
device_code = this.getDeviceCode(); device_code = this.getDeviceCode();
mode = this.itemProtocol.getMode(); mode = this.itemProtocol.getMode();
@ -186,96 +191,96 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + " -> " + mode); logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + " -> " + mode);
} }
if (status != last_status) { // if (status != last_status) {
logServer.deviceItemValue(this.device_code, "status", String.valueOf(status)); // logServer.deviceItemValue(this.device_code, "status", String.valueOf(status));
logServer.deviceExecuteLog(this.device_code, "", "", "信号status:" + last_status + " -> " + status); // logServer.deviceExecuteLog(this.device_code, "", "", "信号status:" + last_status + " -> " + status);
} // }
if (action != last_action) { // if (action != last_action) {
logServer.deviceItemValue(this.device_code, "action", String.valueOf(action)); // logServer.deviceItemValue(this.device_code, "action", String.valueOf(action));
logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + " -> " + action); // logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + " -> " + action);
} // }
if (error != last_error) { // if (error != last_error) {
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); // logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + " -> " + error); // logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + " -> " + error);
} // }
if (!open_time.equals(last_open_time)) { // if (!open_time.equals(last_open_time)) {
logServer.deviceItemValue(this.device_code, "open_time", String.valueOf(open_time)); // logServer.deviceItemValue(this.device_code, "open_time", String.valueOf(open_time));
logServer.deviceExecuteLog(this.device_code, "", "", "信号open_time:" + last_open_time + " -> " + open_time); // logServer.deviceExecuteLog(this.device_code, "", "", "信号open_time:" + last_open_time + " -> " + open_time);
} // }
if (standby_time != last_standby_time) { // if (standby_time != last_standby_time) {
logServer.deviceItemValue(this.device_code, "standby_time", String.valueOf(standby_time)); // logServer.deviceItemValue(this.device_code, "standby_time", String.valueOf(standby_time));
logServer.deviceExecuteLog(this.device_code, "", "", "信号standby_time:" + last_standby_time + " -> " + standby_time); // logServer.deviceExecuteLog(this.device_code, "", "", "信号standby_time:" + last_standby_time + " -> " + standby_time);
} // }
if (production_time != last_production_time) { // if (production_time != last_production_time) {
logServer.deviceItemValue(this.device_code, "production_time", String.valueOf(production_time)); // logServer.deviceItemValue(this.device_code, "production_time", String.valueOf(production_time));
logServer.deviceExecuteLog(this.device_code, "", "", "信号production_time:" + last_production_time + " -> " + production_time); // logServer.deviceExecuteLog(this.device_code, "", "", "信号production_time:" + last_production_time + " -> " + production_time);
} // }
if (error_time != last_error_time) { // if (error_time != last_error_time) {
logServer.deviceItemValue(this.device_code, "error_time", String.valueOf(error_time)); // logServer.deviceItemValue(this.device_code, "error_time", String.valueOf(error_time));
logServer.deviceExecuteLog(this.device_code, "", "", "信号error_time:" + last_error_time + " -> " + error_time); // logServer.deviceExecuteLog(this.device_code, "", "", "信号error_time:" + last_error_time + " -> " + error_time);
} // }
//
if (get_station != last_get_station) { // if (get_station != last_get_station) {
this.setRequireSucess(false); // this.setRequireSucess(false);
logServer.deviceItemValue(this.device_code, "get_station", String.valueOf(get_station)); // logServer.deviceItemValue(this.device_code, "get_station", String.valueOf(get_station));
logServer.deviceExecuteLog(this.device_code, "", "", "信号get_station:" + last_get_station + " -> " + get_station); // logServer.deviceExecuteLog(this.device_code, "", "", "信号get_station:" + last_get_station + " -> " + get_station);
} // }
if (put_station != last_put_station) { // if (put_station != last_put_station) {
logServer.deviceItemValue(this.device_code, "put_station", String.valueOf(put_station)); // logServer.deviceItemValue(this.device_code, "put_station", String.valueOf(put_station));
logServer.deviceExecuteLog(this.device_code, "", "", "信号put_station:" + last_put_station + " -> " + put_station); // logServer.deviceExecuteLog(this.device_code, "", "", "信号put_station:" + last_put_station + " -> " + put_station);
} // }
if (is_qualified != last_is_qualified) { // if (is_qualified != last_is_qualified) {
logServer.deviceItemValue(this.device_code, "is_qualified", String.valueOf(is_qualified)); // logServer.deviceItemValue(this.device_code, "is_qualified", String.valueOf(is_qualified));
logServer.deviceExecuteLog(this.device_code, "", "", "信号is_qualified:" + last_is_qualified + " -> " + is_qualified); // logServer.deviceExecuteLog(this.device_code, "", "", "信号is_qualified:" + last_is_qualified + " -> " + is_qualified);
} // }
if (!laser_marking_code.equals(last_laser_marking_code)) { // if (!laser_marking_code.equals(last_laser_marking_code)) {
logServer.deviceItemValue(this.device_code, "laser_marking_code", String.valueOf(laser_marking_code)); // logServer.deviceItemValue(this.device_code, "laser_marking_code", String.valueOf(laser_marking_code));
logServer.deviceExecuteLog(this.device_code, "", "", "信号laser_marking_code:" + last_laser_marking_code + " -> " + laser_marking_code); // logServer.deviceExecuteLog(this.device_code, "", "", "信号laser_marking_code:" + last_laser_marking_code + " -> " + laser_marking_code);
} // }
if (!grinding_number.equals(last_grinding_number)) { // if (!grinding_number.equals(last_grinding_number)) {
logServer.deviceItemValue(this.device_code, "grinding_number", String.valueOf(grinding_number)); // logServer.deviceItemValue(this.device_code, "grinding_number", String.valueOf(grinding_number));
logServer.deviceExecuteLog(this.device_code, "", "", "信号grinding_number:" + last_grinding_number + " -> " + grinding_number); // logServer.deviceExecuteLog(this.device_code, "", "", "信号grinding_number:" + last_grinding_number + " -> " + grinding_number);
} // }
if (!height1.equals(last_height1)) { // if (!height1.equals(last_height1)) {
logServer.deviceItemValue(this.device_code, "height1", String.valueOf(height1)); // logServer.deviceItemValue(this.device_code, "height1", String.valueOf(height1));
logServer.deviceExecuteLog(this.device_code, "", "", "信号height1:" + last_height1 + " -> " + height1); // logServer.deviceExecuteLog(this.device_code, "", "", "信号height1:" + last_height1 + " -> " + height1);
} // }
if (!height2.equals(last_height2)) { // if (!height2.equals(last_height2)) {
logServer.deviceItemValue(this.device_code, "height2", String.valueOf(height2)); // logServer.deviceItemValue(this.device_code, "height2", String.valueOf(height2));
logServer.deviceExecuteLog(this.device_code, "", "", "信号height2:" + last_height2 + " -> " + height2); // logServer.deviceExecuteLog(this.device_code, "", "", "信号height2:" + last_height2 + " -> " + height2);
} // }
if (!height3.equals(last_height3)) { // if (!height3.equals(last_height3)) {
logServer.deviceItemValue(this.device_code, "height3", String.valueOf(height3)); // logServer.deviceItemValue(this.device_code, "height3", String.valueOf(height3));
logServer.deviceExecuteLog(this.device_code, "", "", "信号height3:" + last_height3 + " -> " + height3); // logServer.deviceExecuteLog(this.device_code, "", "", "信号height3:" + last_height3 + " -> " + height3);
} // }
if (!height4.equals(last_height4)) { // if (!height4.equals(last_height4)) {
logServer.deviceItemValue(this.device_code, "height4", String.valueOf(height4)); // logServer.deviceItemValue(this.device_code, "height4", String.valueOf(height4));
logServer.deviceExecuteLog(this.device_code, "", "", "信号height4:" + last_height4 + " -> " + height4); // logServer.deviceExecuteLog(this.device_code, "", "", "信号height4:" + last_height4 + " -> " + height4);
} // }
if (!width1.equals(last_width1)) { // if (!width1.equals(last_width1)) {
logServer.deviceItemValue(this.device_code, "width1", String.valueOf(width1)); // logServer.deviceItemValue(this.device_code, "width1", String.valueOf(width1));
logServer.deviceExecuteLog(this.device_code, "", "", "信号width1:" + last_width1 + " -> " + width1); // logServer.deviceExecuteLog(this.device_code, "", "", "信号width1:" + last_width1 + " -> " + width1);
} // }
if (!width2.equals(last_width2)) { // if (!width2.equals(last_width2)) {
logServer.deviceItemValue(this.device_code, "width2", String.valueOf(width2)); // logServer.deviceItemValue(this.device_code, "width2", String.valueOf(width2));
logServer.deviceExecuteLog(this.device_code, "", "", "信号width2:" + last_width2 + " -> " + width2); // logServer.deviceExecuteLog(this.device_code, "", "", "信号width2:" + last_width2 + " -> " + width2);
} // }
if (!len.equals(last_len)) { // if (!len.equals(last_len)) {
logServer.deviceItemValue(this.device_code, "len", String.valueOf(len)); // logServer.deviceItemValue(this.device_code, "len", String.valueOf(len));
logServer.deviceExecuteLog(this.device_code, "", "", "信号len:" + last_len + " -> " + len); // logServer.deviceExecuteLog(this.device_code, "", "", "信号len:" + last_len + " -> " + len);
} // }
if (!volume.equals(last_volume)) { // if (!volume.equals(last_volume)) {
logServer.deviceItemValue(this.device_code, "volume", String.valueOf(volume)); // logServer.deviceItemValue(this.device_code, "volume", String.valueOf(volume));
logServer.deviceExecuteLog(this.device_code, "", "", "信号volume:" + last_volume + " -> " + volume); // logServer.deviceExecuteLog(this.device_code, "", "", "信号volume:" + last_volume + " -> " + volume);
} // }
if (!flatness.equals(last_flatness)) { // if (!flatness.equals(last_flatness)) {
logServer.deviceItemValue(this.device_code, "flatness", String.valueOf(flatness)); // logServer.deviceItemValue(this.device_code, "flatness", String.valueOf(flatness));
logServer.deviceExecuteLog(this.device_code, "", "", "信号flatness:" + last_flatness + " -> " + flatness); // logServer.deviceExecuteLog(this.device_code, "", "", "信号flatness:" + last_flatness + " -> " + flatness);
} // }
if (!unqualified_qty.equals(last_unqualified_qty)) { // if (!unqualified_qty.equals(last_unqualified_qty)) {
logServer.deviceItemValue(this.device_code, "unqualified_qty", String.valueOf(unqualified_qty)); // logServer.deviceItemValue(this.device_code, "unqualified_qty", String.valueOf(unqualified_qty));
logServer.deviceExecuteLog(this.device_code, "", "", "信号unqualified_qty:" + last_unqualified_qty + " -> " + unqualified_qty); // logServer.deviceExecuteLog(this.device_code, "", "", "信号unqualified_qty:" + last_unqualified_qty + " -> " + unqualified_qty);
} // }
} catch (Exception var17) { } catch (Exception var17) {
return; return;
@ -672,22 +677,22 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri
request.setDevice_code(this.getDevice_code()); request.setDevice_code(this.getDevice_code());
request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName()); request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName());
request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName())); request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName()));
List<String> getDeviceCodeList = this.getExtraDeviceCodes("get_station"); List<String> getDeviceCodeList = this.getExtraDeviceCodes("link_get_station");
List<String> putDeviceCodeList = this.getExtraDeviceCodes("put_station"); List<String> putDeviceCodeList = this.getExtraDeviceCodes("link_put_station");
request.setGet_station(getDeviceCodeList.get(0)); request.setGet_station(getDeviceCodeList.get(0));
request.setPut_station(putDeviceCodeList.get(put_station)); request.setPut_station(putDeviceCodeList.get(put_station));
request.setLaser_marking_code(laser_marking_code); request.setLaser_marking_code(laser_marking_code);
request.setGrinding_number(grinding_number); request.setGrinding_number(grinding_number);
request.setHeight1(height1); request.setHeight1(String.valueOf(height1));
request.setHeight2(height2); request.setHeight2(String.valueOf(height2));
request.setHeight3(height3); request.setHeight3(String.valueOf(height3));
request.setHeight4(height4); request.setHeight4(String.valueOf(height4));
request.setWidth1(width1); request.setWidth1(String.valueOf(width1));
request.setWidth2(width2); request.setWidth2(String.valueOf(width2));
request.setLen(len); request.setLen(String.valueOf(len));
request.setVolume(volume); request.setVolume(String.valueOf(volume));
request.setFlatness(flatness); request.setFlatness(String.valueOf(flatness));
request.setUnqualified_qty(unqualified_qty); request.setUnqualified_qty(String.valueOf(unqualified_qty));
message = RequestMethodEnum.getName("apply_one_grab") + "apply_one_grab 接口请求LMS..."; message = RequestMethodEnum.getName("apply_one_grab") + "apply_one_grab 接口请求LMS...";
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request)));
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
@ -703,6 +708,31 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri
return true; return true;
} }
/**
* 反馈压机残留重量
*/
public synchronized boolean apply_feedback_weight() {
ApplyTaskRequest request = new ApplyTaskRequest();
request.setDevice_code(this.getDevice_code());
request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName());
request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName()));
request.setWeight(String.valueOf(weight));
request.setMaterial_code(String.valueOf(material_code));
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)), ApplyTaskResponse.class);
message = RequestMethodEnum.getName("apply_feedback_weight") + "apply_feedback_weight 接口请求LMS...";
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request)));
if (resp.getCode() == 200) {
this.writing(200);
this.setRequireSucess(true);
} else {
this.writing(400);
message = RequestMethodEnum.getName("apply_feedback_weight") + "apply_feedback_weight 接口请求失败" + resp.getMessage();
;
}
return true;
}
/** /**
* 获取托盘信息 * 获取托盘信息
* *

7
acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_palletizing_manipulator.vue

@ -488,6 +488,13 @@ export default {
} }
this.data1 = data.rs this.data1 = data.rs
this.data2 = data.ws this.data2 = data.ws
if (data.modeform) {
const arr = Object.keys(data.modeform)
//
if (arr.length > 0) {
this.modeform.tableData = data.modeform
}
}
this.sliceItem() this.sliceItem()
}) })
selectPlcList().then(data => { selectPlcList().then(data => {

7
acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_station.vue

@ -464,6 +464,13 @@ export default {
}) })
}, },
methods: { methods: {
insertdtl() {
this.modeform.tableData.push({mode: '', request: '' })
},
deleteRow(index, rows) {
debugger
rows.splice(index, 1)
},
finishReadEdit(data) { finishReadEdit(data) {
// code,mode // code,mode
if (data.code.indexOf('mode') !== -1) { if (data.code.indexOf('mode') !== -1) {

Loading…
Cancel
Save