示例#1
0
 /// <summary>
 /// Creates a new browser object with a set of filters.
 /// </summary>
 public Browser(
     ISystemContext context,
     ViewDescription view,
     NodeId referenceType,
     bool includeSubtypes,
     BrowseDirection browseDirection,
     QualifiedName browseName,
     IEnumerable<IReference> additionalReferences,
     bool internalOnly,
     Opc.Ua.Client.Session client,
     NamespaceMapper mapper,
     NodeState source,
     NodeId rootId)
 :
     base(
         context,
         view,
         referenceType,
         includeSubtypes,
         browseDirection,
         browseName,
         additionalReferences,
         internalOnly)
 {
     m_client = client;
     m_mapper = mapper;
     m_source = source;
     m_rootId = rootId;
     m_stage = Stage.Begin;
 }
示例#2
0
 /// <summary>
 /// Creates a new browser object with a set of filters.
 /// </summary>
 public Browser(
     ISystemContext context,
     ViewDescription view,
     NodeId referenceType,
     bool includeSubtypes,
     BrowseDirection browseDirection,
     QualifiedName browseName,
     IEnumerable <IReference> additionalReferences,
     bool internalOnly,
     Opc.Ua.Client.Session client,
     NamespaceMapper mapper,
     NodeState source,
     NodeId rootId)
     :
     base(
         context,
         view,
         referenceType,
         includeSubtypes,
         browseDirection,
         browseName,
         additionalReferences,
         internalOnly)
 {
     m_client = client;
     m_mapper = mapper;
     m_source = source;
     m_rootId = rootId;
     m_stage  = Stage.Begin;
 }
示例#3
0
 /// <summary>
 /// Fetches the event type information from the AE server.
 /// </summary>
 public void LoadTypes(Opc.Ua.Client.Session client, IServerInternal server, NamespaceMapper mapper)
 {
     TypeNodes = new NodeIdDictionary<ReferenceDescription>();
     LoadTypes(client, server, mapper, Opc.Ua.ObjectTypeIds.BaseObjectType);
     LoadTypes(client, server, mapper, Opc.Ua.VariableTypeIds.BaseVariableType);
     LoadTypes(client, server, mapper, Opc.Ua.DataTypeIds.BaseDataType);
     LoadTypes(client, server, mapper, Opc.Ua.ReferenceTypeIds.References);
 }
示例#4
0
 /// <summary>
 /// Fetches the event type information from the AE server.
 /// </summary>
 public void LoadTypes(Opc.Ua.Client.Session client, IServerInternal server, NamespaceMapper mapper)
 {
     TypeNodes = new NodeIdDictionary <ReferenceDescription>();
     LoadTypes(client, server, mapper, Opc.Ua.ObjectTypeIds.BaseObjectType);
     LoadTypes(client, server, mapper, Opc.Ua.VariableTypeIds.BaseVariableType);
     LoadTypes(client, server, mapper, Opc.Ua.DataTypeIds.BaseDataType);
     LoadTypes(client, server, mapper, Opc.Ua.ReferenceTypeIds.References);
 }
        /// <summary>
        /// Initializes the node manager.
        /// </summary>
        public AggregationNodeManager(IServerInternal server, ApplicationConfiguration configuration, ConfiguredEndpoint endpoint, bool ownsTypeModel)
        :
            base(server, configuration, Namespaces.Aggregation, AggregationModel.Namespaces.Aggregation)
        {
            SystemContext.NodeIdFactory = this;

            m_configuration = configuration;
            m_endpoint = endpoint;
            m_ownsTypeModel = ownsTypeModel;
            m_clients = new Dictionary<NodeId, Opc.Ua.Client.Session>();
            m_mapper = new NamespaceMapper();
        }
示例#6
0
        /// <summary>
        /// Fetches the event categories for the specified event type.
        /// </summary>
        private void LoadTypes(Opc.Ua.Client.Session client, IServerInternal server, NamespaceMapper mapper, NodeId parentId)
        {
            List<ReferenceDescription> references = null;

            // find references to subtypes.
            try
            {
                references = BrowseSubTypes(client, parentId);
            }
            catch (Exception e)
            {
                Utils.Trace("Could not browse subtypes of {0}. {1}", parentId, e.Message);
                return;
            }

            for (int ii = 0; ii < references.Count; ii++)
            {
                ReferenceDescription reference = references[ii];

                // ignore absolute references.
                if (reference.NodeId == null || reference.NodeId.IsAbsolute)
                {
                    continue;
                }

                // recursively browse until a non-UA node is found.
                if (reference.NodeId.NamespaceIndex == 0)
                {
                    LoadTypes(client, server, mapper, (NodeId)reference.NodeId);
                    continue;
                }

                // map the node id and browse name to local indexes.
                NodeId targetId = mapper.ToLocalId((NodeId)reference.NodeId);

                reference.NodeId = targetId;
                reference.BrowseName = mapper.ToLocalName(reference.BrowseName);

                // add non-UA node to the table.
                TypeNodes[targetId] = reference;
                server.TypeTree.AddSubtype(targetId, parentId);
            }
        }
示例#7
0
        /// <summary>
        /// Fetches the event categories for the specified event type.
        /// </summary>
        private void LoadTypes(Opc.Ua.Client.Session client, IServerInternal server, NamespaceMapper mapper, NodeId parentId)
        {
            List <ReferenceDescription> references = null;

            // find references to subtypes.
            try
            {
                references = BrowseSubTypes(client, parentId);
            }
            catch (Exception e)
            {
                Utils.Trace("Could not browse subtypes of {0}. {1}", parentId, e.Message);
                return;
            }

            for (int ii = 0; ii < references.Count; ii++)
            {
                ReferenceDescription reference = references[ii];

                // ignore absolute references.
                if (reference.NodeId == null || reference.NodeId.IsAbsolute)
                {
                    continue;
                }

                // recursively browse until a non-UA node is found.
                if (reference.NodeId.NamespaceIndex == 0)
                {
                    LoadTypes(client, server, mapper, (NodeId)reference.NodeId);
                    continue;
                }

                // map the node id and browse name to local indexes.
                NodeId targetId = mapper.ToLocalId((NodeId)reference.NodeId);

                reference.NodeId     = targetId;
                reference.BrowseName = mapper.ToLocalName(reference.BrowseName);

                // add non-UA node to the table.
                TypeNodes[targetId] = reference;
                server.TypeTree.AddSubtype(targetId, parentId);
            }
        }