Пример #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.
        /// </remarks>
        protected override MasterNodeManager CreateMasterNodeManager(IServerInternal server, ApplicationConfiguration configuration)
        {
            Utils.Trace("Creating the Node Managers.");

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

            // create the custom node managers.
            nodeManagers.Add(new TutorialNodeManager(server, configuration));

            #region Task #C4 - Add Support for COM Wrapper
            // manually configure the COM server to prevent unapproved wrappers.
            ComDaClientConfiguration wrapperConfig = new ComDaClientConfiguration();

            wrapperConfig.ServerName           = "COM";
            wrapperConfig.ServerUrl            = "opc.com://localhost/OPCSample.OpcDaServer";
            wrapperConfig.MaxReconnectWait     = 10000;
            wrapperConfig.SeperatorChars       = null;
            wrapperConfig.BrowseToNotSupported = false;
            wrapperConfig.ItemIdParser         = new ItemIdParser();

            // create an instance of the wrapper node manager.
            TutorialDaComNodeManager manager = new TutorialDaComNodeManager(
                server,
                wrapperConfig.ServerUrl,
                wrapperConfig,
                true);

            nodeManagers.Add(manager);
            #endregion

            // create master node manager.
            return(new MasterNodeManager(server, configuration, null, nodeManagers.ToArray()));
        }
Пример #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.
        /// </remarks>
        protected override MasterNodeManager CreateMasterNodeManager(IServerInternal server, ApplicationConfiguration configuration)
        {
            Utils.Trace("Creating the Node Managers.");

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

            // create the custom node managers.
            nodeManagers.Add(new TutorialNodeManager(server, configuration));

            #region Task #C4 - Add Support for COM Wrapper
            // manually configure the COM server to prevent unapproved wrappers.
            ComDaClientConfiguration wrapperConfig = new ComDaClientConfiguration();

            wrapperConfig.ServerName = "COM";
            wrapperConfig.ServerUrl = "opc.com://localhost/OPCSample.OpcDaServer";
            wrapperConfig.MaxReconnectWait = 10000;
            wrapperConfig.SeperatorChars = null;
            wrapperConfig.BrowseToNotSupported = false;
            wrapperConfig.ItemIdParser = new ItemIdParser();

            // create an instance of the wrapper node manager.
            TutorialDaComNodeManager manager = new TutorialDaComNodeManager(
                server,
                wrapperConfig.ServerUrl,
                wrapperConfig,
                true);

            nodeManagers.Add(manager);
            #endregion

            // create master node manager.
            return new MasterNodeManager(server, configuration, null, nodeManagers.ToArray());
        }