diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java index a227e811c..418a51a3f 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java @@ -256,82 +256,88 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements } }); } + //申请空托盘出库 + if (mode == 8 && !requireSucess) { + if (container_type == 0) { + message = "托盘类型为空"; + }else { + applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType(), mode); + } + + } + + if (mode == 0) { + this.setIsonline(false); + message = "脱机"; + } else if (error != 0) { + this.setIserror(true); + message = "有报警"; + + } else { + this.setIsonline(true); + this.setIserror(false); + message = ""; + Instruction instruction = null; + List toInstructions; + + switch (mode) { + case 1: + log.debug("弃用(留作兼容)"); + break; + case 2: + //申请任务 + if (move == 1 && !requireSucess) { + instruction_require(); + } else { + String remark = ""; + ; + if (mode != 2) { + remark = "universal_remark2"; + } + if (move != 0) { + remark = "universal_remark3"; + } + if (task != 0) { + remark = "universal_remark4"; + if (ObjectUtil.isNotEmpty(this.inst)) { + this.inst = null; + } + } + if (requireSucess) { + remark = "universal_remark5"; + } + this.setNotCreateInstMessage(remark); + //} + } + break; + case 3: + log.info("运行中"); + break; + case 4: + //申请出货 + if (move == 1 && !requireSucess) { + //request_for_shipment(String.valueOf(mode), item_out_seq_arr, item_out_qty_arr); + } + break; + + + default: + break; + } + } } catch (Exception var17) { + this.iserror = true; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(this.device_code+ "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + message = "读取信号值时出现异常:" + var17.getMessage(); var17.printStackTrace(); - logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); } - - //申请空托盘出库 - if (mode == 8 && !requireSucess) { - if (container_type == 0) { - message = "托盘类型为空"; - }else { - applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType(), mode); -} - - } - - if (mode == 0) { - this.setIsonline(false); - message = "脱机"; - } else if (error != 0) { - this.setIserror(true); - message = "有报警"; - - } else { - this.setIsonline(true); - this.setIserror(false); - message = ""; - Instruction instruction = null; - List toInstructions; - - switch (mode) { - case 1: - log.debug("弃用(留作兼容)"); - break; - case 2: - //申请任务 - if (move == 1 && !requireSucess) { - instruction_require(); - } else { - String remark = ""; - ; - if (mode != 2) { - remark = "universal_remark2"; - } - if (move != 0) { - remark = "universal_remark3"; - } - if (task != 0) { - remark = "universal_remark4"; - if (ObjectUtil.isNotEmpty(this.inst)) { - this.inst = null; - } - } - if (requireSucess) { - remark = "universal_remark5"; - } - this.setNotCreateInstMessage(remark); - //} - } - break; - case 3: - log.info("运行中"); - break; - case 4: - //申请出货 - if (move == 1 && !requireSucess) { - //request_for_shipment(String.valueOf(mode), item_out_seq_arr, item_out_qty_arr); - } - break; - - - default: - break; - } - } last_heartbeat = heartbeat; last_mode = mode; last_move = move; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/ItemProtocol.java index df2e60715..03509bcd4 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/ItemProtocol.java @@ -139,7 +139,7 @@ public class ItemProtocol { setIsonline(true); return value; } - return 0; + return value; } @@ -152,7 +152,7 @@ public class ItemProtocol { } else { return value; } - return "0"; + return value; } public int[] getOpcArrayValue(String protocol) { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java index a90eb82d0..04e6bd685 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java @@ -242,10 +242,11 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i this.iserror = true; LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) - .content(this.device_code+ "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)) + .content(this.device_code+ "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null") .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + message = "读取信号值时出现异常:" + var17.getMessage(); var17.printStackTrace(); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/ItemProtocol.java index 60bd2433b..50bbb073b 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/ItemProtocol.java @@ -150,7 +150,7 @@ public class ItemProtocol { } else { return value; } - return "0"; + return value; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java index ae29ccab1..84f9dec60 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java @@ -192,80 +192,88 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i requireSucess = false; } if (move != 0 && task > 0) { - if (null!=inst) { + if (null != inst) { inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code(); } update_instruction_status(); } - } catch (Exception var17) { - var17.printStackTrace(); - logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); - } - - if (move != last_move && move == 0 && last_move == 1) { - requireSucess = false; - clearWrite(); - } - - - if (mode == 0) { - this.setIsonline(false); - - } else { - this.setIsonline(true); - this.setIserror(false); - if (error != 0) { - this.setIserror(true); - message = "有报警"; + if (move != last_move && move == 0 && last_move == 1) { + requireSucess = false; + clearWrite(); } - Instruction instruction = null; - List toInstructions; - switch (mode) { - case 1: - log.debug("设备运转模式:等待工作"); - break; - case 19: - //申请AGV任务 - if (move == 1 && !requireSucess) { - if (StrUtil.isEmpty(material_barcode)) { - message = "条码为空"; - }else { - applyAgvTask(); - } + if (mode == 0) { + this.setIsonline(false); - } - break; - case 2: - //申请任务 - if (move > 0 && !requireSucess) { - instruction_require(); - } else { - String remark = ""; - ; - if (mode != 2) { - remark = "universal_remark2"; - } - if (move != 0) { - remark = "universal_remark3"; - } - if (task != 0) { - remark = "universal_remark4"; - if (ObjectUtil.isNotEmpty(this.inst)) { - this.inst = null; + } else { + this.setIsonline(true); + this.setIserror(false); + if (error != 0) { + this.setIserror(true); + message = "有报警"; + } + + Instruction instruction = null; + List toInstructions; + + switch (mode) { + case 1: + log.debug("设备运转模式:等待工作"); + break; + case 19: + //申请AGV任务 + if (move == 1 && !requireSucess) { + if (StrUtil.isEmpty(material_barcode)) { + message = "条码为空"; + } else { + applyAgvTask(); } + } - if (requireSucess) { - remark = "universal_remark5"; + break; + case 2: + //申请任务 + if (move > 0 && !requireSucess) { + instruction_require(); + } else { + String remark = ""; + ; + if (mode != 2) { + remark = "universal_remark2"; + } + if (move != 0) { + remark = "universal_remark3"; + } + if (task != 0) { + remark = "universal_remark4"; + if (ObjectUtil.isNotEmpty(this.inst)) { + this.inst = null; + } + } + if (requireSucess) { + remark = "universal_remark5"; + } + this.setNotCreateInstMessage(remark); + //} } - this.setNotCreateInstMessage(remark); - //} - } - break; + break; + } } + } catch (Exception var17) { + this.iserror = true; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(this.device_code + "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + message = "读取信号值时出现异常:" + var17.getMessage(); + var17.printStackTrace(); } + + last_mode = mode; last_move = move; last_carrier_direction = carrier_direction; @@ -390,7 +398,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i this.writing(list); logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,返回参数:" + jo); requireSucess = true; - }else { + } else { message = "申请AGV任务报错,参数,接口返回:" + jo; this.iserror = true; } @@ -426,6 +434,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i itemMap.put(to_command, command); this.control(itemMap); } + @Override public JSONObject getDeviceStatusName() { JSONObject jo = new JSONObject(); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/ItemProtocol.java index 7755f3bf1..ddb8968df 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/ItemProtocol.java @@ -142,7 +142,7 @@ public class ItemProtocol { setIsonline(true); return value; } - return 0; + return value; } @@ -153,7 +153,7 @@ public class ItemProtocol { } else { return value; } - return ""; + return value; } public static List getReadableItemDtos() { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java index 9ae12bef9..ef27103ce 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java @@ -200,105 +200,113 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr if (move != 0 && task > 0) { update_instruction_status(); } + if (move != last_move && move==0 && last_move==1) { + requireSucess = false; + clearWrite(); + } + + + if (mode == 0) { + this.setIsonline(false); + message = "脱机"; + + //有报警 + + } else { + this.setIsonline(true); + this.setIserror(false); + if (error != 0) { + this.setIserror(true); + message = "有警报"; + } + + Instruction instruction = null; + List toInstructions; + + switch (mode) { + case 1: + log.debug("设备运转模式:等待工作"); + break; + case 2: + //申请任务 + if (move > 0 && !requireSucess) { + instruction_require(); + }else { + String remark = ""; + ; + if (mode != 2) { + remark = "universal_remark2"; + } + if (move != 0) { + remark = "universal_remark3"; + } + if (task != 0) { + remark = "universal_remark4"; + if (ObjectUtil.isNotEmpty(this.inst)) { + this.inst = null; + } + } + if (requireSucess) { + remark = "universal_remark5"; + } + this.setNotCreateInstMessage(remark); + //} + } + break; + case 5: + //申请贴标 + applyLabeling(mode); + break; + case 10: + //申请捆轧贴标信息 + if (move > 0 && !requireSucess) { + applyLaStrangulationAndLabeling(mode); + } + break; + case 12: + //申请贴标(未贴标) + applyLabeling(mode); + break; + case 13: + //申请捆轧贴标信息(未捆扎) + if (move > 0 && !requireSucess) { + applyLaStrangulationAndLabeling(mode); + } + break; + case 14: + //申请捆轧贴标信息(未贴标) + if (move > 0 && !requireSucess) { + applyLaStrangulationAndLabeling(mode); + } + break; + case 16: + //申请捆轧贴标信息(未贴标,未捆扎) + if (move > 0 && !requireSucess) { + applyLaStrangulationAndLabeling(mode); + } + case 17: + //申请调试贴标 + if(move > 0 && !requireSucess){ + applyLaStrangulationAndLabeling(mode); + } + break; + } + } } catch (Exception var17) { + this.iserror = true; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(this.device_code + "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + message = "读取信号值时出现异常:" + var17.getMessage(); var17.printStackTrace(); - logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); } - if (move != last_move && move==0 && last_move==1) { - requireSucess = false; - clearWrite(); - } - - if (mode == 0) { - this.setIsonline(false); - message = "脱机"; - - //有报警 - - } else { - this.setIsonline(true); - this.setIserror(false); - if (error != 0) { - this.setIserror(true); - message = "有警报"; - } - - Instruction instruction = null; - List toInstructions; - - switch (mode) { - case 1: - log.debug("设备运转模式:等待工作"); - break; - case 2: - //申请任务 - if (move > 0 && !requireSucess) { - instruction_require(); - }else { - String remark = ""; - ; - if (mode != 2) { - remark = "universal_remark2"; - } - if (move != 0) { - remark = "universal_remark3"; - } - if (task != 0) { - remark = "universal_remark4"; - if (ObjectUtil.isNotEmpty(this.inst)) { - this.inst = null; - } - } - if (requireSucess) { - remark = "universal_remark5"; - } - this.setNotCreateInstMessage(remark); - //} - } - break; - case 5: - //申请贴标 - applyLabeling(mode); - break; - case 10: - //申请捆轧贴标信息 - if (move > 0 && !requireSucess) { - applyLaStrangulationAndLabeling(mode); - } - break; - case 12: - //申请贴标(未贴标) - applyLabeling(mode); - break; - case 13: - //申请捆轧贴标信息(未捆扎) - if (move > 0 && !requireSucess) { - applyLaStrangulationAndLabeling(mode); - } - break; - case 14: - //申请捆轧贴标信息(未贴标) - if (move > 0 && !requireSucess) { - applyLaStrangulationAndLabeling(mode); - } - break; - case 16: - //申请捆轧贴标信息(未贴标,未捆扎) - if (move > 0 && !requireSucess) { - applyLaStrangulationAndLabeling(mode); - } - case 17: - //申请调试贴标 - if(move > 0 && !requireSucess){ - applyLaStrangulationAndLabeling(mode); - } - break; - } - } last_mode = mode; last_move = move; last_carrier_direction = carrier_direction; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/ItemProtocol.java index b511bfb3e..f95a2d4cf 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/ItemProtocol.java @@ -194,7 +194,7 @@ public class ItemProtocol { setIsonline(true); return value; } - return 0; + return value; } @@ -205,7 +205,7 @@ public class ItemProtocol { } else { return value; } - return "0"; + return value; } public static List getReadableItemDtos() { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/FoldDiscSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/FoldDiscSiteDeviceDriver.java index 518d6d51a..d0f1a0eaf 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/FoldDiscSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/FoldDiscSiteDeviceDriver.java @@ -198,101 +198,109 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements if (move != 0 && task > 0) { update_instruction_status(); } + if (move != last_move && move == 0 && last_move == 1) { + requireSucess = false; + clearWrite(); + } + + + //托盘去扫码位 + if (mode == 4) { + List list1 = new ArrayList(); + Map map = new HashMap(); + map.put("code", "to_command"); + map.put("value", 0); + list1.add(map); + this.writing(list1); + } + + if (mode == 0) { + this.setIsonline(false); + message = "脱机"; + + //有报警 + } else if (error != 0) { + this.setIserror(true); + message = "有报警"; + //无报警 + } else { + this.setIsonline(true); + this.setIserror(false); + message = ""; + Instruction instruction = null; + List toInstructions; + + //申请空托盘入库 + if (mode == 9 && move == 1 && !requireSucess) { + if (container_type == 0) { + message = "托盘类型为空"; + } else { + applyEmptyTask(StorageTypeEnum.DISKS_IN.getType(), mode); + } + } + + + //申请空托盘出库 + if (mode == 8 && !requireSucess) { + if (container_type == 0) { + message = "托盘类型为空"; + } else { + applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType(), mode); + } + + } + + + //碟盘位申请任务 + if (mode == 2 && move == 1 && !requireSucess) { + boolean res = instruction_require(); + if (res) { + notCreateInstMessage = ""; + notCreateTaskMessage = ""; + feedMessage = ""; + } + } else { + if (mode == 2) { + //if (!requireSucess) { + String remark = ""; + ; + if (mode != 2) { + remark = "universal_remark2"; + } + if (move != 0) { + remark = "universal_remark3"; + } + if (task != 0) { + remark = LangProcess.msg("universal_remark4"); + if (ObjectUtil.isNotEmpty(this.inst)) { + this.inst = null; + } + } + if (requireSucess) { + remark = LangProcess.msg("universal_remark5"); + } + this.setNotCreateTaskMessage(remark); + //} + } + } + + } } catch (Exception var17) { + this.iserror = true; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(this.device_code + "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + message = "读取信号值时出现异常:" + var17.getMessage(); var17.printStackTrace(); - logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); } - if (move != last_move && move == 0 && last_move == 1) { - requireSucess = false; - clearWrite(); - } - - //托盘去扫码位 - if (mode == 4) { - List list1 = new ArrayList(); - Map map = new HashMap(); - map.put("code", "to_command"); - map.put("value", 0); - list1.add(map); - this.writing(list1); - } - - if (mode == 0) { - this.setIsonline(false); - message = "脱机"; - - //有报警 - } else if (error != 0) { - this.setIserror(true); - message = "有报警"; - //无报警 - } else { - this.setIsonline(true); - this.setIserror(false); - message = ""; - Instruction instruction = null; - List toInstructions; - - //申请空托盘入库 - if (mode == 9 && move == 1 && !requireSucess) { - if (container_type == 0) { - message = "托盘类型为空"; - } else { - applyEmptyTask(StorageTypeEnum.DISKS_IN.getType(), mode); - } - } - - - //申请空托盘出库 - if (mode == 8 && !requireSucess) { - if (container_type == 0) { - message = "托盘类型为空"; - } else { - applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType(), mode); - } - - } - - - //碟盘位申请任务 - if (mode == 2 && move == 1 && !requireSucess) { - boolean res = instruction_require(); - if (res) { - notCreateInstMessage = ""; - notCreateTaskMessage = ""; - feedMessage = ""; - } - } else { - if (mode == 2) { - //if (!requireSucess) { - String remark = ""; - ; - if (mode != 2) { - remark = "universal_remark2"; - } - if (move != 0) { - remark = "universal_remark3"; - } - if (task != 0) { - remark = LangProcess.msg("universal_remark4"); - if (ObjectUtil.isNotEmpty(this.inst)) { - this.inst = null; - } - } - if (requireSucess) { - remark = LangProcess.msg("universal_remark5"); - } - this.setNotCreateTaskMessage(remark); - //} - } - } - - } last_mode = mode; last_move = move; last_action = action; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/ItemProtocol.java index 04161b0b8..7fbb5453c 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/ItemProtocol.java @@ -112,7 +112,7 @@ public class ItemProtocol { setIsonline(true); return value; } - return 0; + return value; } public String getOpcStringValue(String protocol) { @@ -123,7 +123,7 @@ public class ItemProtocol { } else { return value; } - return "0"; + return value; } public static List getReadableItemDtos() { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java index 9b8ae0da5..3804e96c2 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java @@ -243,15 +243,6 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记:" + requireSucess); logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); } - if (mode == -99){ - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("PLC断连需重启程序") - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - throw new BadRequestException("PLC断连需重启程序"); - } if (move != last_move && move == 0 && last_move == 1) { @@ -287,105 +278,113 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv update_instruction_status(); } - } catch (Exception e) { - logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + Arrays.toString(e.getStackTrace())); - - } - - if (mode == 0) { - this.setIsonline(false); - //有报警 - } else if (error != 0) { - this.setIserror(true); - message = "有报警"; - //申请异常位任务 - applyErrorTask(); - } else { - this.setIsonline(true); - this.setIserror(false); - message = ""; - Instruction instruction = null; - List toInstructions; - //木箱入库申请入库任务 - if (mode == 6 && !requireSucess) { - if (StrUtil.isEmpty(barcode) || StrUtil.isEmpty(material_barcode)) { - message = "托盘条码为空、或者子卷码为空"; - } else { - applyIn(StorageTypeEnum.BOX_IN.getType(), mode); - } - - } - - //子卷入库申请入库任务 - if (mode == 7 && move == 1 && !requireSucess) { - if (StrUtil.isEmpty(barcode) || StrUtil.isEmpty(material_barcode)) { - message = "托盘条码为空、或者子卷码为空"; - } else { - applyIn(StorageTypeEnum.STORAGE.getType(), mode); - } - - } - - - //申请空托盘入库 - if (mode == 9 && move == 1 && !requireSucess) { - if (container_type == 0 || StrUtil.isEmpty(barcode)) { - message = "托盘类型为空"; - } else { - applyEmptyTask(StorageTypeEnum.DISKS_IN.getType(), mode); - } - } - - //申请退货入库 - if (mode == 18 && move == 1 && !requireSucess) { - if (StrUtil.isEmpty(barcode)) { - message = "托盘条码为空"; - } else { - applyBoxReturnTask(StorageTypeEnum.BOX_RETURN.getType(), mode); - } - - } - //申请高度 - if (mode == 23 && !requireSucess) { - if (StrUtil.isEmpty(barcode) || StrUtil.isEmpty(material_barcode)) { - message = "条码为空"; - } else { - applyErrorHeight(); - } - - } - - //申请入库指令、异常位指令 - if (mode == 2 && move == 1 && !requireSucess) { - boolean res = instruction_require(); - if (res) { - notCreateInstMessage = ""; - notCreateTaskMessage = ""; - feedMessage = ""; - } + if (mode == 0) { + this.setIsonline(false); + //有报警 + } else if (error != 0) { + this.setIserror(true); + message = "有报警"; + //申请异常位任务 + applyErrorTask(); } else { - String remark = ""; - ; - if (mode != 2) { - remark = "universal_remark2"; + this.setIsonline(true); + this.setIserror(false); + message = ""; + Instruction instruction = null; + List toInstructions; + //木箱入库申请入库任务 + if (mode == 6 && !requireSucess) { + if (StrUtil.isEmpty(barcode) || StrUtil.isEmpty(material_barcode)) { + message = "托盘条码为空、或者子卷码为空"; + } else { + applyIn(StorageTypeEnum.BOX_IN.getType(), mode); + } + } - if (move != 0) { - remark = "universal_remark3"; + + //子卷入库申请入库任务 + if (mode == 7 && move == 1 && !requireSucess) { + if (StrUtil.isEmpty(barcode) || StrUtil.isEmpty(material_barcode)) { + message = "托盘条码为空、或者子卷码为空"; + } else { + applyIn(StorageTypeEnum.STORAGE.getType(), mode); + } + } - if (task != 0) { - remark = "universal_remark4"; - if (ObjectUtil.isNotEmpty(this.inst)) { - this.inst = null; + + + //申请空托盘入库 + if (mode == 9 && move == 1 && !requireSucess) { + if (container_type == 0 || StrUtil.isEmpty(barcode)) { + message = "托盘类型为空"; + } else { + applyEmptyTask(StorageTypeEnum.DISKS_IN.getType(), mode); } } - if (requireSucess) { - remark = "universal_remark5"; - } - this.setNotCreateInstMessage(remark); - //} - } + //申请退货入库 + if (mode == 18 && move == 1 && !requireSucess) { + if (StrUtil.isEmpty(barcode)) { + message = "托盘条码为空"; + } else { + applyBoxReturnTask(StorageTypeEnum.BOX_RETURN.getType(), mode); + } + + } + //申请高度 + if (mode == 23 && !requireSucess) { + if (StrUtil.isEmpty(barcode) || StrUtil.isEmpty(material_barcode)) { + message = "条码为空"; + } else { + applyErrorHeight(); + } + + } + + //申请入库指令、异常位指令 + if (mode == 2 && move == 1 && !requireSucess) { + boolean res = instruction_require(); + if (res) { + notCreateInstMessage = ""; + notCreateTaskMessage = ""; + feedMessage = ""; + } + } else { + String remark = ""; + ; + if (mode != 2) { + remark = "universal_remark2"; + } + if (move != 0) { + remark = "universal_remark3"; + } + if (task != 0) { + remark = "universal_remark4"; + if (ObjectUtil.isNotEmpty(this.inst)) { + this.inst = null; + } + } + if (requireSucess) { + remark = "universal_remark5"; + } + this.setNotCreateInstMessage(remark); + //} + } + + } + } catch (Exception e) { + this.iserror = true; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(this.device_code + "读取信号值时出现异常:" + e.getMessage() + ",this.itemProtocol is null") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + message = "读取信号值时出现异常:" + e.getMessage(); + e.printStackTrace(); } + + last_mode = mode; last_move = move; last_action = action; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ItemProtocol.java index 89f5cd649..63364e885 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ItemProtocol.java @@ -166,7 +166,7 @@ public class ItemProtocol { } else { return value; } - return "0"; + return value; } public int getOpcIntegerValue(String protocol) { @@ -178,7 +178,7 @@ public class ItemProtocol { setIsonline(true); return value; } - return -99; + return value; } @@ -191,7 +191,7 @@ public class ItemProtocol { setIsonline(true); return value; } - return 0; + return value; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/ItemProtocol.java index 909d2492e..a6e5683db 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/ItemProtocol.java @@ -178,7 +178,7 @@ public class ItemProtocol { setIsonline(true); return value; } - return 0; + return value; } @@ -189,7 +189,7 @@ public class ItemProtocol { } else { return value; } - return "0"; + return value; } public static List getReadableItemDtos() { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/UnBoxLableConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/UnBoxLableConveyorDeviceDriver.java index cda1ff206..1f2e493af 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/UnBoxLableConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/UnBoxLableConveyorDeviceDriver.java @@ -178,48 +178,55 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl to_target = this.itemProtocol.getTo_target(); to_task = this.itemProtocol.getTo_task(); heartbeat = this.itemProtocol.getHeartbeat(); + if (mode != last_mode) { - } catch (Exception e) { - logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + Arrays.toString(e.getStackTrace())); - - } - - if (mode != last_mode) { - - requireSucess = false; - } - if (mode == 0) { - this.setIsonline(false); - message = "脱机"; - - //有报警 - - } else { - this.setIsonline(true); - this.setIserror(false); - if (error != 0) { - this.setIserror(true); - message = "有报警"; - } - inst = checkInst(); - if (inst != null) { - inst_message = "当前指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code(); + requireSucess = false; } + if (mode == 0) { + this.setIsonline(false); + message = "脱机"; - Instruction instruction = instructionService.findByCode(String.valueOf(task)); - //空箱出库开盖位,申请开盖 - if (mode == 15 && move == 1 && task > 0 ) { - //不允许开盖,完成出库任务,自动去扫码位 - if (StrUtil.isEmpty(instruction.getVehicle_code())){ - message = "任务托盘码为空"; + //有报警 + + } else { + this.setIsonline(true); + this.setIserror(false); + if (error != 0) { + this.setIserror(true); + message = "有报警"; + } + inst = checkInst(); + if (inst != null) { + inst_message = "当前指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code(); } - applyUnbox(instruction.getVehicle_code()); + Instruction instruction = instructionService.findByCode(String.valueOf(task)); + //空箱出库开盖位,申请开盖 + if (mode == 15 && move == 1 && task > 0 ) { + //不允许开盖,完成出库任务,自动去扫码位 + if (StrUtil.isEmpty(instruction.getVehicle_code())){ + message = "任务托盘码为空"; + } + applyUnbox(instruction.getVehicle_code()); + + } } + } catch (Exception e) { + this.iserror = true; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(this.device_code + "读取信号值时出现异常:" + e.getMessage() + ",this.itemProtocol is null") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + message = "读取信号值时出现异常:" + e.getMessage(); + e.printStackTrace(); } + + last_mode =mode; last_move =move; last_carrier_direction =carrier_direction; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java index eb2103f83..f753640cd 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java @@ -194,59 +194,66 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } updateInstrction(); } + if (mode == 0) { + this.setIsonline(false); + message = "universal_off-line"; - } catch (Exception e) { - logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + Arrays.toString(e.getStackTrace())); + //有报警 + } else if (error != 0) { + this.setIserror(true); + message = "有报警"; + //无报警 + } else { + this.setIsonline(true); + this.setIserror(false); + message = ""; + Instruction instruction = null; + List toInstructions; - } - - if (mode == 0) { - this.setIsonline(false); - message = "universal_off-line"; - - //有报警 - } else if (error != 0) { - this.setIserror(true); - message = "有报警"; - //无报警 - } else { - this.setIsonline(true); - this.setIserror(false); - message = ""; - Instruction instruction = null; - List toInstructions; - - //行架机械手申请任务 - if (mode == 2 && move == 0 && !requireSucess) { - boolean res = applyTask(); - if (res) { - notCreateInstMessage = ""; - notCreateTaskMessage = ""; - feedMessage = ""; - } - }else { - String remark = ""; - ; - if (mode != 2) { - remark = "universal_remark2"; - } - if (move != 0) { - remark = "universal_remark3"; - } - if (task != 0) { - remark = "universal_remark4"; - if (ObjectUtil.isNotEmpty(this.inst)) { - this.inst = null; + //行架机械手申请任务 + if (mode == 2 && move == 0 && !requireSucess) { + boolean res = applyTask(); + if (res) { + notCreateInstMessage = ""; + notCreateTaskMessage = ""; + feedMessage = ""; } + }else { + String remark = ""; + ; + if (mode != 2) { + remark = "universal_remark2"; + } + if (move != 0) { + remark = "universal_remark3"; + } + if (task != 0) { + remark = "universal_remark4"; + if (ObjectUtil.isNotEmpty(this.inst)) { + this.inst = null; + } + } + if (requireSucess) { + remark = "universal_remark5"; + } + this.setNotCreateInstMessage(remark); + //} } - if (requireSucess) { - remark = "universal_remark5"; - } - this.setNotCreateInstMessage(remark); - //} - } + } + } catch (Exception e) { + this.iserror = true; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(this.device_code + "读取信号值时出现异常:" + e.getMessage() + ",this.itemProtocol is null") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + message = "读取信号值时出现异常:" + e.getMessage(); + e.printStackTrace(); } + + last_mode = mode; last_move = move; last_action = action; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/ItemProtocol.java index b4c2891f0..e1f8a76ef 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/ItemProtocol.java @@ -199,7 +199,7 @@ public class ItemProtocol { } else { return value; } - return "0"; + return value; } public float getOpcFloatValue(String protocol) { @@ -211,7 +211,7 @@ public class ItemProtocol { setIsonline(true); return value; } - return 0; + return value; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java index b9ce39591..099f2bd77 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java @@ -164,64 +164,68 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } updateInstructionStatus(); } + if (mode == 0) { + this.setIsonline(false); + message = "universal_off-line"; - } catch (Exception e) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("读取信号值时出现异常" + this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.device_code + "." + Arrays.toString(e.getStackTrace())) - .build(); - logDto.setLog_level(2); - luceneExecuteLogService.deviceExecuteLog(logDto); - - } - - if (mode == 0) { - this.setIsonline(false); - message = "universal_off-line"; - - //有报警 - } else if (error != 0) { - this.setIserror(true); - message = "universal_message3"; - //无报警 - } else { - this.setIsonline(true); - this.setIserror(false); - message = ""; - Instruction instruction = null; - List toInstructions; - - //行架机械手申请任务 - if (mode == 2 && move == 0 && task == 0 && !requireSucess) { - boolean res = applyTask(); - if (res) { - notCreateInstMessage = ""; - notCreateTaskMessage = ""; - feedMessage = ""; - } + //有报警 + } else if (error != 0) { + this.setIserror(true); + message = "universal_message3"; + //无报警 } else { - String remark = ""; - ; - if (mode != 2) { - remark = "universal_remark2"; - } - if (move != 0) { - remark = "universal_remark3"; - } - if (task != 0) { - remark = "universal_remark4"; - if (ObjectUtil.isNotEmpty(this.inst)) { - this.inst = null; + this.setIsonline(true); + this.setIserror(false); + message = ""; + Instruction instruction = null; + List toInstructions; + + //行架机械手申请任务 + if (mode == 2 && move == 0 && task == 0 && !requireSucess) { + boolean res = applyTask(); + if (res) { + notCreateInstMessage = ""; + notCreateTaskMessage = ""; + feedMessage = ""; } + } else { + String remark = ""; + ; + if (mode != 2) { + remark = "universal_remark2"; + } + if (move != 0) { + remark = "universal_remark3"; + } + if (task != 0) { + remark = "universal_remark4"; + if (ObjectUtil.isNotEmpty(this.inst)) { + this.inst = null; + } + } + if (requireSucess) { + remark = "universal_remark5"; + } + this.setNotCreateInstMessage(remark); + //} } - if (requireSucess) { - remark = "universal_remark5"; - } - this.setNotCreateInstMessage(remark); - //} + } + } catch (Exception e) { + this.iserror = true; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(this.device_code + "读取信号值时出现异常:" + e.getMessage() + ",this.itemProtocol is null") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + message = "读取信号值时出现异常:" + e.getMessage(); + e.printStackTrace(); + } + + last_mode =mode; last_action = action; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/ItemProtocol.java index ed75bc350..ee1d3bc79 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/ItemProtocol.java @@ -199,7 +199,7 @@ public class ItemProtocol { setIsonline(true); return value; } - return 0; + return value; } public String getOpcStringValue(String protocol) { @@ -209,7 +209,7 @@ public class ItemProtocol { } else { return value; } - return "0"; + return value; } public static List getReadableItemDtos() { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ItemProtocol.java index fb5ca6ccd..ff80b8cd2 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ItemProtocol.java @@ -173,7 +173,7 @@ public class ItemProtocol { setIsonline(true); return value; } - return 0; + return value; } public int getOpcIntegerValue(String protocol) { @@ -184,7 +184,7 @@ public class ItemProtocol { setIsonline(true); return value; } - return 0; + return value; } public static List getReadableItemDtos() { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ReturnGoodManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ReturnGoodManipulatorDeviceDriver.java index 34add76b5..a1879c6cf 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ReturnGoodManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ReturnGoodManipulatorDeviceDriver.java @@ -177,60 +177,68 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } updateInstructionStatus(); } + if (mode == 0) { + this.setIsonline(false); + message = "universal_off-line"; + + //有报警 + } else if (error != 0) { + this.setIserror(true); + message = "universal_message3"; + //无报警 + } else { + this.setIsonline(true); + this.setIserror(false); + message = ""; + Instruction instruction = null; + List toInstructions; + + //行架机械手申请任务 + if (mode == 2 && move == 0 && task == 0 && !requireSucess) { + boolean res = applyTask(); + if (res) { + notCreateInstMessage = ""; + notCreateTaskMessage = ""; + feedMessage = ""; + } + } else { + String remark = ""; + ; + if (mode != 2) { + remark = "universal_remark2"; + } + if (move != 0) { + remark = "universal_remark3"; + } + if (task != 0) { + remark = "universal_remark4"; + if (ObjectUtil.isNotEmpty(this.inst)) { + this.inst = null; + } + } + if (requireSucess) { + remark = "universal_remark5"; + } + this.setNotCreateInstMessage(remark); + //} + } + + } } catch (Exception e) { - logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + Arrays.toString(e.getStackTrace())); - + this.iserror = true; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(this.device_code + "读取信号值时出现异常:" + e.getMessage() + ",this.itemProtocol is null") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + message = "读取信号值时出现异常:" + e.getMessage(); + e.printStackTrace(); } - if (mode == 0) { - this.setIsonline(false); - message = "universal_off-line"; - //有报警 - } else if (error != 0) { - this.setIserror(true); - message = "universal_message3"; - //无报警 - } else { - this.setIsonline(true); - this.setIserror(false); - message = ""; - Instruction instruction = null; - List toInstructions; - - //行架机械手申请任务 - if (mode == 2 && move == 0 && task == 0 && !requireSucess) { - boolean res = applyTask(); - if (res) { - notCreateInstMessage = ""; - notCreateTaskMessage = ""; - feedMessage = ""; - } - } else { - String remark = ""; - ; - if (mode != 2) { - remark = "universal_remark2"; - } - if (move != 0) { - remark = "universal_remark3"; - } - if (task != 0) { - remark = "universal_remark4"; - if (ObjectUtil.isNotEmpty(this.inst)) { - this.inst = null; - } - } - if (requireSucess) { - remark = "universal_remark5"; - } - this.setNotCreateInstMessage(remark); - //} - } - - } last_mode = mode; last_move = move; last_action = action; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/standard_manipulator/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/standard_manipulator/ItemProtocol.java index b257434dc..d39a3f16b 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/standard_manipulator/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/standard_manipulator/ItemProtocol.java @@ -81,7 +81,7 @@ ItemProtocol { setIsonline(true); return value; } - return 0; + return value; } public String getOpcStringValue(String protocol) { @@ -91,7 +91,7 @@ ItemProtocol { } else { return value; } - return "0"; + return value; } public static List getReadableItemDtos() { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/standard_manipulator/StandardManipulatoDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/standard_manipulator/StandardManipulatoDeviceDriver.java index ca1adc0b7..7113f8c84 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/standard_manipulator/StandardManipulatoDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/standard_manipulator/StandardManipulatoDeviceDriver.java @@ -163,32 +163,39 @@ public class StandardManipulatoDeviceDriver extends AbstractOpcDeviceDriver impl if (mode != last_mode) { requireSucess = false; } + if (mode == 0) { + this.setIsonline(false); + message = "universal_off-line"; + //有报警 + } else if (error != 0) { + this.setIserror(true); + message = "universal_message3"; + //无报警 + } else { + this.setIsonline(true); + this.setIserror(false); + message = ""; + Instruction instruction = null; + List toInstructions; + + } + } catch (Exception var17) { + this.iserror = true; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(this.device_code + "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + message = "读取信号值时出现异常:" + var17.getMessage(); var17.printStackTrace(); - logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); } - if (mode == 0) { - this.setIsonline(false); - message = "universal_off-line"; - //有报警 - } else if (error != 0) { - this.setIserror(true); - message = "universal_message3"; - //无报警 - } else { - this.setIsonline(true); - this.setIserror(false); - message = ""; - Instruction instruction = null; - List toInstructions; - - - } last_mode = mode; last_move = move; last_action = action; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/ItemProtocol.java index 95d2147f3..11dfbdec5 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/ItemProtocol.java @@ -182,7 +182,7 @@ public class ItemProtocol { setIsonline(true); return value; } - return 0; + return value; } public float getOpcFloatValue(String protocol) { @@ -194,7 +194,7 @@ public class ItemProtocol { setIsonline(true); return value; } - return 0; + return value; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/TrappedManipulatorManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/TrappedManipulatorManipulatorDeviceDriver.java index 84e41c216..1c98ff0d5 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/TrappedManipulatorManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/TrappedManipulatorManipulatorDeviceDriver.java @@ -172,58 +172,65 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice } updateInstructionStatus(); } - - } catch (Exception var17) { - var17.printStackTrace(); - // feedMessage = var17.getMessage(); - logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); - - } - - if (mode == 0) { - this.setIsonline(false); - //有报警 - } else if (error != 0) { - this.setIserror(true); - message = "universal_message3"; - //无报警 - } else { - this.setIsonline(true); - this.setIserror(false); - Instruction instruction = null; - List toInstructions; - - //行架机械手申请任务 - if (mode == 2 && move == 0 && task == 0 && !requireSucess) { - boolean res = applyTask(); - if (res) { - notCreateInstMessage = ""; - notCreateTaskMessage = ""; - feedMessage = ""; - } + if (mode == 0) { + this.setIsonline(false); + //有报警 + } else if (error != 0) { + this.setIserror(true); + message = "universal_message3"; + //无报警 } else { - String remark = ""; - ; - if (mode != 2) { - remark = "universal_remark2"; - } - if (move != 0) { - remark = "universal_remark3"; - } - if (task != 0) { - remark = "universal_remark4"; - if (ObjectUtil.isNotEmpty(this.inst)) { - this.inst = null; + this.setIsonline(true); + this.setIserror(false); + Instruction instruction = null; + List toInstructions; + + //行架机械手申请任务 + if (mode == 2 && move == 0 && task == 0 && !requireSucess) { + boolean res = applyTask(); + if (res) { + notCreateInstMessage = ""; + notCreateTaskMessage = ""; + feedMessage = ""; } + } else { + String remark = ""; + ; + if (mode != 2) { + remark = "universal_remark2"; + } + if (move != 0) { + remark = "universal_remark3"; + } + if (task != 0) { + remark = "universal_remark4"; + if (ObjectUtil.isNotEmpty(this.inst)) { + this.inst = null; + } + } + if (requireSucess) { + remark = "universal_remark5"; + } + this.setNotCreateInstMessage(remark); + //} } - if (requireSucess) { - remark = "universal_remark5"; - } - this.setNotCreateInstMessage(remark); - //} + } + } catch (Exception var17) { + this.iserror = true; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(this.device_code + "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + message = "读取信号值时出现异常:" + var17.getMessage(); + var17.printStackTrace(); + } + + last_mode = mode; last_move = move; last_action = action; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/ItemProtocol.java index ba1bafc0b..db8f1e8f6 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/ItemProtocol.java @@ -177,7 +177,7 @@ public class ItemProtocol { setIsonline(true); return value; } - return 0; + return value; } public float getOpcFloatValue(String protocol) { @@ -189,7 +189,7 @@ public class ItemProtocol { setIsonline(true); return value; } - return 0; + return value; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java index 533d86382..6636eda84 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java @@ -210,60 +210,68 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi Integer actionType = ActionTypeEnum.IN_FINISHING.getCode(); creatAGV(actionType, action); } + if (mode == 0) { + this.setIsonline(false); + message = "universal_off-line"; - } catch (Exception var17) { - var17.printStackTrace(); - logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); - - } - - if (mode == 0) { - this.setIsonline(false); - message = "universal_off-line"; - - //有报警 - } else if (error != 0) { - this.setIserror(true); - message = "universal_message3"; - //无报警 - } else { - this.setIsonline(true); - this.setIserror(false); - message = ""; - Instruction instruction = null; - List toInstructions; - - //行架机械手申请任务 - if (mode == 2 && move == 0 && task == 0 && !requireSucess) { - boolean res = applyTask(); - if (res) { - notCreateInstMessage = ""; - notCreateTaskMessage = ""; - feedMessage = ""; - } + //有报警 + } else if (error != 0) { + this.setIserror(true); + message = "universal_message3"; + //无报警 } else { - String remark = ""; - ; - if (mode != 2) { - remark = "universal_remark2"; - } - if (move != 0) { - remark = "universal_remark3"; - } - if (task != 0) { - remark = "universal_remark4"; - if (ObjectUtil.isNotEmpty(this.inst)) { - this.inst = null; + this.setIsonline(true); + this.setIserror(false); + message = ""; + Instruction instruction = null; + List toInstructions; + + //行架机械手申请任务 + if (mode == 2 && move == 0 && task == 0 && !requireSucess) { + boolean res = applyTask(); + if (res) { + notCreateInstMessage = ""; + notCreateTaskMessage = ""; + feedMessage = ""; } + } else { + String remark = ""; + ; + if (mode != 2) { + remark = "universal_remark2"; + } + if (move != 0) { + remark = "universal_remark3"; + } + if (task != 0) { + remark = "universal_remark4"; + if (ObjectUtil.isNotEmpty(this.inst)) { + this.inst = null; + } + } + if (requireSucess) { + remark = "universal_remark5"; + } + this.setNotCreateInstMessage(remark); + //} } - if (requireSucess) { - remark = "universal_remark5"; - } - this.setNotCreateInstMessage(remark); - //} + } + } catch (Exception var17) { + this.iserror = true; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(this.device_code + "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + message = "读取信号值时出现异常:" + var17.getMessage(); + var17.printStackTrace(); + } + + last_mode = mode; last_move = move; last_action = action; diff --git a/acs2/nladmin-ui/src/views/acs/device/customPolicy/task/index.vue b/acs2/nladmin-ui/src/views/acs/device/customPolicy/task/index.vue index 9481f84ee..8cc475257 100644 --- a/acs2/nladmin-ui/src/views/acs/device/customPolicy/task/index.vue +++ b/acs2/nladmin-ui/src/views/acs/device/customPolicy/task/index.vue @@ -7,7 +7,7 @@
- +
- + - + - + - + - +