From 220f7b818bb9399391830fbbb9fb2028a21b938f Mon Sep 17 00:00:00 2001 From: yyt <306727702@qq.com> Date: 星期三, 21 二月 2024 00:23:34 +0800 Subject: [PATCH] 批量数据采集方法更新 --- jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/client/ClientHandler.java | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/client/ClientHandler.java b/jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/client/ClientHandler.java index 6267237..fc78ab0 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/client/ClientHandler.java +++ b/jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/client/ClientHandler.java @@ -168,8 +168,13 @@ try { Class<?> clazz = Class.forName("com.jcdm.main.da.opcuaconfig.cert.MethodName"); Method method = clazz.getMethod(daOpcuaConfig.getrFunction(), new Class[] { String.class, String.class }); + if (value.isNull()){ + method.invoke(clazz.newInstance(),new Object[] { + new String(id.getIdentifier().toString()), new String("") }); + }else{ method.invoke(clazz.newInstance(),new Object[] { new String(id.getIdentifier().toString()), new String(value.getValue().toString()) }); + } } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) { e.printStackTrace(); @@ -257,11 +262,14 @@ log.info("Value={}", value); Variant variant = value.getValue(); - log.info("Variant={}", variant.getValue()); - log.info("BackingClass={}", BuiltinDataType.getBackingClass(variant.getDataType().get())); + if(null == variant.getValue()) + { + return null; + }else{ + return variant.getValue().toString(); + } - return variant.getValue().toString(); } -- Gitblit v1.9.3