A node in the server address space.
Inheritance: IFormattable, ILocalNode
        public static NodeInfo ConvertToNodeInfo(Opc.Ua.Node node, NamespaceTable namespaceTable)
        {
            var nsUrl    = namespaceTable.GetString(node.NodeId.NamespaceIndex);
            var nsNodeId = new NSNodeId()
            {
                id = node.NodeId.ToString(), namespaceUrl = nsUrl
            };
            var nid = System.Text.Json.JsonSerializer.Serialize(nsNodeId);

            return(new NodeInfo()
            {
                browseName = GetQualifiedName(node.BrowseName, namespaceTable),
                displayName = node.DisplayName?.Text, nodeClass = (uint)node.NodeClass, nodeId = nid
            });
        }
        /// <summary>
        /// Exports a copt of the node to a node table.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="node">The node.</param>
        protected override void Export(ISystemContext context, Node node)
        {
            base.Export(context, node);

            MethodNode methodNode = node as MethodNode;

            if (methodNode != null)
            {
                methodNode.Executable = this.Executable;
                methodNode.UserExecutable = this.UserExecutable;
            }
        }
        /// <summary>
        /// Exports a copy of the node to a node table.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="node">The node to update with the values from the instance.</param>
        protected override void Export(ISystemContext context, Node node)
        {
            base.Export(context, node);

            if (this.Parent != null)
            {
                NodeId referenceTypeId = this.ReferenceTypeId;
                
                if (NodeId.IsNull(referenceTypeId))
                {
                    referenceTypeId = ReferenceTypeIds.HasComponent;
                }

                node.ReferenceTable.Add(referenceTypeId, true, this.Parent.NodeId);
            }

            if (!NodeId.IsNull(this.TypeDefinitionId))
            {
                node.ReferenceTable.Add(ReferenceTypeIds.HasTypeDefinition, false, this.TypeDefinitionId);
            }

            if (!NodeId.IsNull(this.ModellingRuleId))
            {
                node.ReferenceTable.Add(ReferenceTypeIds.HasModellingRule, false, this.ModellingRuleId);
            }            
        }
        /// <summary>
        /// Exports a copy of the node to a node table.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="node">The node.</param>
        protected override void Export(ISystemContext context, Node node)
        {
            base.Export(context, node);

            VariableTypeNode variableTypeNode = node as VariableTypeNode;

            if (variableTypeNode != null)
            {
                variableTypeNode.Value = new Variant(Utils.Clone(this.Value));
                variableTypeNode.DataType = this.DataType;
                variableTypeNode.ValueRank = this.ValueRank;
                variableTypeNode.ArrayDimensions = null;

                if (this.ArrayDimensions != null)
                {
                    variableTypeNode.ArrayDimensions = new UInt32Collection(this.ArrayDimensions);
                }
            }
        }
        /// <summary>
        /// Exports a copy of the node to a node table.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="node">The node.</param>
        protected override void Export(ISystemContext context, Node node)
        {
            base.Export(context, node);

            ReferenceTypeNode referenceTypeNode = node as ReferenceTypeNode;

            if (referenceTypeNode != null)
            {
                referenceTypeNode.InverseName = this.InverseName;
                referenceTypeNode.Symmetric = this.Symmetric;
            }
        }
        /// <summary>
        /// Exports a copy of the node to a node table.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="node">The node.</param>
        protected override void Export(ISystemContext context, Node node)
        {
            base.Export(context, node);

            ViewNode viewNode = node as ViewNode;

            if (viewNode != null)
            {
                viewNode.EventNotifier = this.EventNotifier;
                viewNode.ContainsNoLoops = this.ContainsNoLoops;
            }
        }
Beispiel #7
0
        /// <summary>
        /// Exports a copt of the node to a node table.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="node">The node.</param>
        protected override void Export(ISystemContext context, Node node)
        {
            base.Export(context, node);

            if (!NodeId.IsNull(this.SuperTypeId))
            {
                node.ReferenceTable.Add(ReferenceTypeIds.HasSubtype, true, this.SuperTypeId);
            }

            switch (this.NodeClass)
            {
                case NodeClass.ObjectType:
                {
                    ((ObjectTypeNode)node).IsAbstract = IsAbstract;
                    break;
                }

                case NodeClass.VariableType:
                {
                    ((VariableTypeNode)node).IsAbstract = IsAbstract;
                    break;
                }

                case NodeClass.DataType:
                {
                    ((DataTypeNode)node).IsAbstract = IsAbstract;
                    break;
                }

                case NodeClass.ReferenceType:
                {
                    ((ReferenceTypeNode)node).IsAbstract = IsAbstract;
                    break;
                }
            }
        }
        /// <summary>
        /// Exports a copt of the node to a node table.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="node">The node.</param>
        protected override void Export(ISystemContext context, Node node)
        {
            base.Export(context, node);

            ObjectNode objectNode = node as ObjectNode;

            if (objectNode != null)
            {
                objectNode.EventNotifier = this.EventNotifier;
            }
        }