| | |
| | | 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 ;//上线数量 |
| | | |
| | |
| | | public void onSubscribe(String identifier, Object value) { |
| | | String ecpStr = "";//异常记录标记 |
| | | try { |
| | | |
| | | if(null != value) { |
| | | //OP010 |
| | | //心跳 |
| | |
| | | //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 |
| | |
| | | //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())) { |
| | |
| | | //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 |
| | |
| | | //PLC出站 |
| | | else if (identifier.equals(OPCElement.BOP040B_J_PLC_FINISH) && null != value && "true".equals(value.toString())) { |
| | | BOP040BCallback.handleFinsh(); |
| | | // BOP040BCallback.handleMaterial(); |
| | | // BOP040BCallback.handleMaterial(); |
| | | //BOP040BCallback.handleInfo(); |
| | | } |
| | | |
| | |
| | | EOP090BCallback.handleInfo(); |
| | | } |
| | | |
| | | else if (identifier.contains("STATE") && null != value && "true".equals(value.toString())) { |
| | | else if (identifier.contains("STATE") && null != value) { |
| | | 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); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | // handleOilState("DOP020"); |
| | | StateCallback.handleOilStateOP050("OP050"); |
| | | StateCallback.handleOilStateBOP030("BOP030"); |
| | | if(identifier.contains("OP050") && !identifier.contains("EOP050") ){ |
| | | StateCallback.handleOilStateOP050("OP050"); |
| | | } |
| | | if (identifier.contains("BOP030")){ |
| | | StateCallback.handleOilStateBOP030("BOP030"); |
| | | } |
| | | } |
| | | |
| | | else { |