From 6dadf36ef118fbb3b2cd5aca94cde88e29fb55dc Mon Sep 17 00:00:00 2001 From: cl <418351270@qq.com> Date: 星期二, 23 一月 2024 11:22:04 +0800 Subject: [PATCH] 修改数据采集 --- guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/callback/InitCallback.java | 31 ++++++++++++++++++++++++------- 1 files changed, 24 insertions(+), 7 deletions(-) diff --git a/guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/callback/InitCallback.java b/guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/callback/InitCallback.java index 79ae7ed..a21f8d7 100644 --- a/guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/callback/InitCallback.java +++ b/guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/callback/InitCallback.java @@ -106,7 +106,6 @@ private static String S_SFC_CODE = "";//鎬绘垚缂栫爜 private static String PRODUCTION_LINE = "OP";//浜х嚎鍙� private static String LOCATION_CODE = "OP010";//宸ヤ綅鍙� - private static List list = null; private static Integer ACTUAL_ONLINE_QTY = 0 ;//涓婄嚎鏁伴噺 @@ -523,8 +522,9 @@ //PLC鍑虹珯 else if (identifier.equals(OPCElement.OP080_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { OP080Callback.handleFinsh(); - OP080Callback.handleMaterial(); OP080Callback.handleInfo(); + OP080Callback.handleMaterial(); + } //OP090 @@ -536,6 +536,23 @@ //PLC杩涚珯 else if (identifier.equals(OPCElement.OP090_J_PLC_START) && null != value && "true".equals(value.toString())) { OP090Callback.handleOrder(); + } + //PLC鍑虹珯 + else if (identifier.equals(OPCElement.OP090_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { + OP090Callback.handleMaterial(); + OP090Callback.handleInfo(); + OP090Callback.handleFinsh(); + } + + //OP100 + //蹇冭烦 + else if (identifier.equals(OPCElement.OP100_F_HEART_BEAT) && null != value && "false".equals(value.toString())) { + ReadWriteEntity entity = new ReadWriteEntity(OPCElement.OP100_F_HEART_BEAT, true); + miloService.writeToOpcUa(entity); + } + //PLC杩涚珯 + else if (identifier.equals(OPCElement.OP100_J_PLC_START) && null != value && "true".equals(value.toString())) { + OP100Callback.handleOrder(); } //PLC鍑虹珯 else if (identifier.equals(OPCElement.OP100_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { @@ -591,8 +608,8 @@ //PLC鍑虹珯 else if (identifier.equals(OPCElement.OP120B_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { OP120BCallback.handleFinsh(); - OP120BCallback.handleMaterial(); - OP120BCallback.handleInfo(); + //OP120BCallback.handleMaterial(); + //OP120BCallback.handleInfo(); } //OP130 @@ -802,7 +819,7 @@ //PLC鍑虹珯 else if (identifier.equals(OPCElement.BOP040B_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { BOP040BCallback.handleFinsh(); - // BOP040BCallback.handleMaterial(); + // BOP040BCallback.handleMaterial(); //BOP040BCallback.handleInfo(); } @@ -1079,8 +1096,8 @@ EquipmentInfoParam equipmentInfoParam = new EquipmentInfoParam(); equipmentInfoParam.setSpareField1(identifier); List<EquipmentInfoResult> lists = equipmentInfoService.findListBySpec(equipmentInfoParam); - if(!lists.isEmpty()){ - EquipmentInfoResult result = (EquipmentInfoResult) list.get(0); + if(!lists.isEmpty() && lists.size()>0){ + EquipmentInfoResult result = (EquipmentInfoResult) lists.get(0); String equipmentNo = result.getEquipmentNo(); EquipmentStatusParam equipmentStatusParam = new EquipmentStatusParam(); equipmentStatusParam.setEquipmentNo(equipmentNo); -- Gitblit v1.9.3