diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/RequestMethodEnum.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/RequestMethodEnum.java index 0937a7b..e7910e1 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/RequestMethodEnum.java +++ b/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"), - apply_feedback_weight(16, "apply_feedback_weight", "反馈压机残留重量","1"); + apply_feedback_weight(16, "apply_feedback_weight", "反馈压机残留重量","0"); //驱动索引 diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/ItemProtocol.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/ItemProtocol.java index fc8ced3..d38e37b 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/ItemProtocol.java +++ b/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); } + public String getTo_material_code() { + return this.getOpcStringValue(item_to_material_code); + } + public int getMode() { return this.getOpcIntegerValue(item_mode); } @@ -85,6 +89,10 @@ public class ItemProtocol { return this.getOpcStringValue(item_open_time); } + public String getToorderno() { + return this.getOpcStringValue(item_to_order_No); + } + public int getStandby_time() { return this.getOpcIntegerValue(item_standby_time); } @@ -121,44 +129,44 @@ public class ItemProtocol { return this.getOpcStringValue(item_grinding_number); } - public String getHeight1() { - return this.getOpcStringValue(item_height1); + public int getHeight1() { + return this.getOpcIntegerValue(item_height1); } - public String getHeight2() { - return this.getOpcStringValue(item_height2); + public int getHeight2() { + return this.getOpcIntegerValue(item_height2); } - public String getHeight3() { - return this.getOpcStringValue(item_height3); + public int getHeight3() { + return this.getOpcIntegerValue(item_height3); } - public String getHeight4() { - return this.getOpcStringValue(item_height4); + public int getHeight4() { + return this.getOpcIntegerValue(item_height4); } - public String getWidth1() { - return this.getOpcStringValue(item_width1); + public int getWidth1() { + return this.getOpcIntegerValue(item_width1); } - public String getWidth2() { - return this.getOpcStringValue(item_width2); + public int getWidth2() { + return this.getOpcIntegerValue(item_width2); } - public String getLen() { - return this.getOpcStringValue(item_len); + public int getLen() { + return this.getOpcIntegerValue(item_len); } - public String getVolume() { - return this.getOpcStringValue(item_volume); + public int getVolume() { + return this.getOpcIntegerValue(item_volume); } - public String getFlatness() { - return this.getOpcStringValue(item_flatness); + public int getFlatness() { + return this.getOpcIntegerValue(item_flatness); } - public String getUnqualified_qty() { - return this.getOpcStringValue(item_unqualified_qty); + public int getUnqualified_qty() { + return this.getOpcIntegerValue(item_unqualified_qty); } Boolean isonline; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/LnshPalletizingManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/LnshPalletizingManipulatorDeviceDriver.java index 0b6e0b1..4573d58 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/LnshPalletizingManipulatorDeviceDriver.java +++ b/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.modules.lucene.service.LuceneExecuteLogService; import org.nl.modules.lucene.service.dto.LuceneLogDto; +import org.nl.modules.system.domain.Param; import org.nl.modules.wql.util.SpringContextHolder; import org.openscada.opc.lib.da.Server; @@ -70,7 +71,8 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri int mode = 0; int move = 0; - + int weight = 0; + String material_code=""; int error = 0; int action = 0; int last_action = 0; @@ -102,6 +104,18 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri String device_code; int 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 last_open_time = "0"; @@ -119,32 +133,22 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri int last_get_station = 0; int put_station = 0; int last_put_station = 0; - int is_qualified = 0; - int last_is_qualified = 0; - String laser_marking_code = ""; - String last_laser_marking_code = ""; - String grinding_number = ""; - String last_grinding_number = ""; - String height1 = ""; - String last_height1 = ""; - String height2 = ""; - String last_height2 = ""; - String height3 = ""; - String last_height3 = ""; - String height4 = ""; - String last_height4 = ""; - String width1 = ""; - 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 = ""; + int is_qualified=0; + int last_is_qualified=0; + String laser_marking_code =""; + String grinding_number =""; + int height1 = 0; + int height2 = 0; + int height3 = 0; + int height4 = 0; + int width1 = 0; + int width2 = 0; + int len = 0; + int volume = 0; + int flatness =0; + + int unqualified_qty=0; + @Override public Device getDevice() { @@ -155,6 +159,7 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri @Override public void execute() { String message = null; + try { device_code = this.getDeviceCode(); mode = this.itemProtocol.getMode(); @@ -186,96 +191,96 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + " -> " + mode); } - if (status != last_status) { - logServer.deviceItemValue(this.device_code, "status", String.valueOf(status)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号status:" + last_status + " -> " + status); - } - if (action != last_action) { - logServer.deviceItemValue(this.device_code, "action", String.valueOf(action)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + " -> " + action); - } - if (error != last_error) { - logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + " -> " + error); - } - if (!open_time.equals(last_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); - } - if (standby_time != last_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); - } - if (production_time != last_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); - } - if (error_time != last_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); - } - - if (get_station != last_get_station) { - this.setRequireSucess(false); - logServer.deviceItemValue(this.device_code, "get_station", String.valueOf(get_station)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号get_station:" + last_get_station + " -> " + get_station); - } - if (put_station != last_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); - } - if (is_qualified != last_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); - } - if (!laser_marking_code.equals(last_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); - } - if (!grinding_number.equals(last_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); - } - if (!height1.equals(last_height1)) { - logServer.deviceItemValue(this.device_code, "height1", String.valueOf(height1)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号height1:" + last_height1 + " -> " + height1); - } - if (!height2.equals(last_height2)) { - logServer.deviceItemValue(this.device_code, "height2", String.valueOf(height2)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号height2:" + last_height2 + " -> " + height2); - } - if (!height3.equals(last_height3)) { - logServer.deviceItemValue(this.device_code, "height3", String.valueOf(height3)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号height3:" + last_height3 + " -> " + height3); - } - if (!height4.equals(last_height4)) { - logServer.deviceItemValue(this.device_code, "height4", String.valueOf(height4)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号height4:" + last_height4 + " -> " + height4); - } - if (!width1.equals(last_width1)) { - logServer.deviceItemValue(this.device_code, "width1", String.valueOf(width1)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号width1:" + last_width1 + " -> " + width1); - } - if (!width2.equals(last_width2)) { - logServer.deviceItemValue(this.device_code, "width2", String.valueOf(width2)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号width2:" + last_width2 + " -> " + width2); - } - if (!len.equals(last_len)) { - logServer.deviceItemValue(this.device_code, "len", String.valueOf(len)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号len:" + last_len + " -> " + len); - } - if (!volume.equals(last_volume)) { - logServer.deviceItemValue(this.device_code, "volume", String.valueOf(volume)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号volume:" + last_volume + " -> " + volume); - } - if (!flatness.equals(last_flatness)) { - logServer.deviceItemValue(this.device_code, "flatness", String.valueOf(flatness)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号flatness:" + last_flatness + " -> " + flatness); - } - if (!unqualified_qty.equals(last_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); - } +// if (status != last_status) { +// logServer.deviceItemValue(this.device_code, "status", String.valueOf(status)); +// logServer.deviceExecuteLog(this.device_code, "", "", "信号status:" + last_status + " -> " + status); +// } +// if (action != last_action) { +// logServer.deviceItemValue(this.device_code, "action", String.valueOf(action)); +// logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + " -> " + action); +// } +// if (error != last_error) { +// logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); +// logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + " -> " + error); +// } +// if (!open_time.equals(last_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); +// } +// if (standby_time != last_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); +// } +// if (production_time != last_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); +// } +// if (error_time != last_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); +// } +// +// if (get_station != last_get_station) { +// this.setRequireSucess(false); +// logServer.deviceItemValue(this.device_code, "get_station", String.valueOf(get_station)); +// logServer.deviceExecuteLog(this.device_code, "", "", "信号get_station:" + last_get_station + " -> " + get_station); +// } +// if (put_station != last_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); +// } +// if (is_qualified != last_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); +// } +// if (!laser_marking_code.equals(last_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); +// } +// if (!grinding_number.equals(last_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); +// } +// if (!height1.equals(last_height1)) { +// logServer.deviceItemValue(this.device_code, "height1", String.valueOf(height1)); +// logServer.deviceExecuteLog(this.device_code, "", "", "信号height1:" + last_height1 + " -> " + height1); +// } +// if (!height2.equals(last_height2)) { +// logServer.deviceItemValue(this.device_code, "height2", String.valueOf(height2)); +// logServer.deviceExecuteLog(this.device_code, "", "", "信号height2:" + last_height2 + " -> " + height2); +// } +// if (!height3.equals(last_height3)) { +// logServer.deviceItemValue(this.device_code, "height3", String.valueOf(height3)); +// logServer.deviceExecuteLog(this.device_code, "", "", "信号height3:" + last_height3 + " -> " + height3); +// } +// if (!height4.equals(last_height4)) { +// logServer.deviceItemValue(this.device_code, "height4", String.valueOf(height4)); +// logServer.deviceExecuteLog(this.device_code, "", "", "信号height4:" + last_height4 + " -> " + height4); +// } +// if (!width1.equals(last_width1)) { +// logServer.deviceItemValue(this.device_code, "width1", String.valueOf(width1)); +// logServer.deviceExecuteLog(this.device_code, "", "", "信号width1:" + last_width1 + " -> " + width1); +// } +// if (!width2.equals(last_width2)) { +// logServer.deviceItemValue(this.device_code, "width2", String.valueOf(width2)); +// logServer.deviceExecuteLog(this.device_code, "", "", "信号width2:" + last_width2 + " -> " + width2); +// } +// if (!len.equals(last_len)) { +// logServer.deviceItemValue(this.device_code, "len", String.valueOf(len)); +// logServer.deviceExecuteLog(this.device_code, "", "", "信号len:" + last_len + " -> " + len); +// } +// if (!volume.equals(last_volume)) { +// logServer.deviceItemValue(this.device_code, "volume", String.valueOf(volume)); +// logServer.deviceExecuteLog(this.device_code, "", "", "信号volume:" + last_volume + " -> " + volume); +// } +// if (!flatness.equals(last_flatness)) { +// logServer.deviceItemValue(this.device_code, "flatness", String.valueOf(flatness)); +// logServer.deviceExecuteLog(this.device_code, "", "", "信号flatness:" + last_flatness + " -> " + flatness); +// } +// if (!unqualified_qty.equals(last_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); +// } } catch (Exception var17) { return; @@ -672,22 +677,22 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri 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())); - List getDeviceCodeList = this.getExtraDeviceCodes("get_station"); - List putDeviceCodeList = this.getExtraDeviceCodes("put_station"); + List getDeviceCodeList = this.getExtraDeviceCodes("link_get_station"); + List putDeviceCodeList = this.getExtraDeviceCodes("link_put_station"); request.setGet_station(getDeviceCodeList.get(0)); request.setPut_station(putDeviceCodeList.get(put_station)); request.setLaser_marking_code(laser_marking_code); request.setGrinding_number(grinding_number); - request.setHeight1(height1); - request.setHeight2(height2); - request.setHeight3(height3); - request.setHeight4(height4); - request.setWidth1(width1); - request.setWidth2(width2); - request.setLen(len); - request.setVolume(volume); - request.setFlatness(flatness); - request.setUnqualified_qty(unqualified_qty); + request.setHeight1(String.valueOf(height1)); + request.setHeight2(String.valueOf(height2)); + request.setHeight3(String.valueOf(height3)); + request.setHeight4(String.valueOf(height4)); + request.setWidth1(String.valueOf(width1)); + request.setWidth2(String.valueOf(width2)); + request.setLen(String.valueOf(len)); + request.setVolume(String.valueOf(volume)); + request.setFlatness(String.valueOf(flatness)); + request.setUnqualified_qty(String.valueOf(unqualified_qty)); message = RequestMethodEnum.getName("apply_one_grab") + "apply_one_grab 接口请求LMS..."; lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); @@ -703,6 +708,31 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri 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; + } + /** * 获取托盘信息 * diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_palletizing_manipulator.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_palletizing_manipulator.vue index 7076b4e..64ec25f 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_palletizing_manipulator.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_palletizing_manipulator.vue @@ -488,6 +488,13 @@ export default { } this.data1 = data.rs this.data2 = data.ws + if (data.modeform) { + const arr = Object.keys(data.modeform) + // 不为空 + if (arr.length > 0) { + this.modeform.tableData = data.modeform + } + } this.sliceItem() }) selectPlcList().then(data => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_station.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_station.vue index 4673b57..9ab599f 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_station.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_station.vue @@ -464,6 +464,13 @@ export default { }) }, methods: { + insertdtl() { + this.modeform.tableData.push({mode: '', request: '' }) + }, + deleteRow(index, rows) { + debugger + rows.splice(index, 1) + }, finishReadEdit(data) { // 编辑的是code列,并且值包含mode if (data.code.indexOf('mode') !== -1) {