You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2022/07/28 09:43:45 UTC

[incubator-streampipes] 02/04: [hotfix] Use less strict filtering for OPC nodes

This is an automated email from the ASF dual-hosted git repository.

riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git

commit 964c57eaa7f4eed0431328bcab1b0bfbf7a05adf
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Thu Jul 28 11:42:06 2022 +0200

    [hotfix] Use less strict filtering for OPC nodes
---
 .../streampipes/connect/iiot/adapters/opcua/OpcUaNodeBrowser.java    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/streampipes-extensions/streampipes-connect-adapters-iiot/src/main/java/org/apache/streampipes/connect/iiot/adapters/opcua/OpcUaNodeBrowser.java b/streampipes-extensions/streampipes-connect-adapters-iiot/src/main/java/org/apache/streampipes/connect/iiot/adapters/opcua/OpcUaNodeBrowser.java
index f391de15e..585c849a1 100644
--- a/streampipes-extensions/streampipes-connect-adapters-iiot/src/main/java/org/apache/streampipes/connect/iiot/adapters/opcua/OpcUaNodeBrowser.java
+++ b/streampipes-extensions/streampipes-connect-adapters-iiot/src/main/java/org/apache/streampipes/connect/iiot/adapters/opcua/OpcUaNodeBrowser.java
@@ -25,6 +25,7 @@ import org.eclipse.milo.opcua.sdk.client.AddressSpace;
 import org.eclipse.milo.opcua.sdk.client.OpcUaClient;
 import org.eclipse.milo.opcua.sdk.client.model.nodes.variables.BaseVariableTypeNode;
 import org.eclipse.milo.opcua.sdk.client.nodes.UaNode;
+import org.eclipse.milo.opcua.sdk.client.nodes.UaVariableNode;
 import org.eclipse.milo.opcua.stack.core.UaException;
 import org.eclipse.milo.opcua.stack.core.types.builtin.NodeId;
 import org.eclipse.milo.opcua.stack.core.types.builtin.StatusCode;
@@ -81,7 +82,7 @@ public class OpcUaNodeBrowser {
     UaNode node = addressSpace.getNode(nodeId);
 
     if (node instanceof BaseVariableTypeNode) {
-      UInteger value = (UInteger) ((BaseVariableTypeNode) node).getDataType().getIdentifier();
+      UInteger value = (UInteger) ((UaVariableNode) node).getDataType().getIdentifier();
       return new OpcNode(node.getDisplayName().getText(), OpcUaTypes.getType(value), node.getNodeId());
     }
 
@@ -112,6 +113,6 @@ public class OpcUaNodeBrowser {
   }
 
   private boolean isDataNode(UaNode node) {
-    return node.getNodeClass().equals(NodeClass.Variable) && node instanceof BaseVariableTypeNode;
+    return (node.getNodeClass().equals(NodeClass.Variable) || (node.getNodeClass().equals(NodeClass.VariableType))) && node instanceof UaVariableNode;
   }
 }