Example #1
0
        /// <summary>
        /// Creates the node managers for the server.
        /// </summary>
        /// <remarks>
        /// This method allows the sub-class create any additional node managers which it uses. The SDK
        /// always creates a CoreNodeManager which handles the built-in nodes defined by the specification.
        /// Any additional NodeManagers are expected to handle application specific nodes.
        ///
        /// Applications with small address spaces do not need to create their own NodeManagers and can add any
        /// application specific nodes to the CoreNodeManager. Applications should use custom NodeManagers when
        /// the structure of the address space is stored in another system or when the address space is too large
        /// to keep in memory.
        /// </remarks>
        protected override MasterNodeManager CreateMasterNodeManager(
            IServerInternal server, ApplicationConfiguration configuration)
        {
            Debug.WriteLine("Creating the Node Managers.");

            List <INodeManager> nodeManagers = new List <INodeManager>();

            // create the custom node managers.
            var aasnm = new global::AasOpcUaServer.AasModeManager(
                server, configuration, thePackageEnv, theServerOptions);

            nodeManagers.Add(aasnm);

            // create master node manager.
            var x = new MasterNodeManager(server, configuration, null, nodeManagers.ToArray());

            // try to do some fixes
            if (x.NodeManagers.Count > 0)
            {
                var cm = x.NodeManagers[0] as CustomNodeManager2;

                //// (old) code for fixing node issued
                //// if (cm != null)
                ////    cm.AasInjectedNodes = aasnm.GenerateInjectNodeStates();
            }

            // ok
            return(x);
        }
Example #2
0
        /// <summary>
        /// Creates the node managers for the server.
        /// </summary>
        /// <remarks>
        /// This method allows the sub-class create any additional node managers which it uses. The SDK
        /// always creates a CoreNodeManager which handles the built-in nodes defined by the specification.
        /// Any additional NodeManagers are expected to handle application specific nodes.
        ///
        /// Applications with small address spaces do not need to create their own NodeManagers and can add any
        /// application specific nodes to the CoreNodeManager. Applications should use custom NodeManagers when
        /// the structure of the address space is stored in another system or when the address space is too large
        /// to keep in memory.
        /// </remarks>
        protected override MasterNodeManager CreateMasterNodeManager(IServerInternal server, ApplicationConfiguration configuration)
        {
            Debug.WriteLine("Creating the Node Managers.");

            List <INodeManager> nodeManagers = new List <INodeManager>();

            // create the custom node managers.
            // TODO (MIHO, 2021-01-01): re-implement multi environment UA server again!
            var aasnm = new global::AasOpcUaServer.AasModeManager(server, configuration, thePackageEnv, theServerOptions);

            nodeManagers.Add(aasnm);

            // create master node manager.
            var x = new MasterNodeManager(server, configuration, null, nodeManagers.ToArray());

            // try to do some fixes
            if (x.NodeManagers.Count > 0)
            {
                var cm = x.NodeManagers[0] as CustomNodeManager2;
            }

            // ok
            return(x);
        }