コード例 #1
0
ファイル: ClientForm.cs プロジェクト: mpostol/UA-.NET
        public ClientForm(
            ServiceMessageContext context,
            ApplicationInstance application, 
            ClientForm masterForm, 
            ApplicationConfiguration configuration)
        {
            InitializeComponent();
            this.Icon = ClientUtils.GetAppIcon();

            m_masterForm = masterForm;
            m_context = context;
            m_application = application;
            m_server = application.Server as Opc.Ua.Server.StandardServer;

            if (m_masterForm == null)
            {
                m_forms = new List<ClientForm>();
            }

            SessionsCTRL.Configuration  = m_configuration = configuration;
            SessionsCTRL.MessageContext = context;

            // get list of cached endpoints.
            m_endpoints = m_configuration.LoadCachedEndpoints(true);
            m_endpoints.DiscoveryUrls = configuration.ClientConfiguration.WellKnownDiscoveryUrls;
            EndpointSelectorCTRL.Initialize(m_endpoints, m_configuration);

            // initialize control state.
            Disconnect();
        }
コード例 #2
0
        public ClientForm(
            ServiceMessageContext context,
            ApplicationInstance application,
            ClientForm masterForm,
            ApplicationConfiguration configuration)
        {
            InitializeComponent();
            this.Icon = ClientUtils.GetAppIcon();

            m_masterForm  = masterForm;
            m_context     = context;
            m_application = application;
            m_server      = application.Server as Opc.Ua.Server.StandardServer;

            if (m_masterForm == null)
            {
                m_forms = new List <ClientForm>();
            }

            SessionsCTRL.Configuration  = m_configuration = configuration;
            SessionsCTRL.MessageContext = context;

            // get list of cached endpoints.
            m_endpoints = m_configuration.LoadCachedEndpoints(true);
            m_endpoints.DiscoveryUrls = configuration.ClientConfiguration.WellKnownDiscoveryUrls;
            EndpointSelectorCTRL.Initialize(m_endpoints, m_configuration);

            // initialize control state.
            Disconnect();
        }
コード例 #3
0
        public ClientPage(
           ServiceMessageContext context,
           ApplicationInstance application,
           ClientPage masterPage,
           ApplicationConfiguration configuration)
        {
            InitializeComponent();

            if (!configuration.SecurityConfiguration.AutoAcceptUntrustedCertificates)
            {
                configuration.CertificateValidator.CertificateValidation += new CertificateValidationEventHandler(CertificateValidator_CertificateValidation);
            }
        
            m_masterPage = masterPage;
            m_context = context;
            m_application = application;
            m_server = application.Server as Opc.Ua.Server.StandardServer;

            if (m_masterPage == null)
            {
                m_pages = new List<ClientPage>();
            }

            m_configuration = configuration;
            
            SessionsCTRL.Configuration = configuration;
            SessionsCTRL.MessageContext = context;
            SessionsCTRL.AddressSpaceCtrl = BrowseCTRL;
            SessionsCTRL.NodeSelected += SessionCtrl_NodeSelected;

            // get list of cached endpoints.
            m_endpoints = m_configuration.LoadCachedEndpoints(true);
            m_endpoints.DiscoveryUrls = configuration.ClientConfiguration.WellKnownDiscoveryUrls;
            
            // hook up endpoint selector
            EndpointSelectorCTRL.Initialize(m_endpoints, m_configuration);
            EndpointSelectorCTRL.ConnectEndpoint += EndpointSelectorCTRL_ConnectEndpoint;
            EndpointSelectorCTRL.EndpointsChanged += EndpointSelectorCTRL_OnChange;

            BrowseCTRL.SessionTreeCtrl = SessionsCTRL;
            BrowseCTRL.NodeSelected += BrowseCTRL_NodeSelected;

            // exception dialog
            GuiUtils.ExceptionMessageDlg += ExceptionMessageDlg;

            ServerUrlTB.Text = "None";

            m_publishers = AmqpConnectionCollection.Load(configuration);

            foreach (var publisher in m_publishers)
            {
                Task t = publisher.OpenAsync();
            }

            m_MonitoredItem_Notification = new MonitoredItemNotificationEventHandler(MonitoredItem_Notification);
        }
コード例 #4
0
        public ClientPage(
            ServiceMessageContext context,
            ApplicationInstance application,
            ClientPage masterPage,
            ApplicationConfiguration configuration)
        {
            InitializeComponent();

            if (!configuration.SecurityConfiguration.AutoAcceptUntrustedCertificates)
            {
                configuration.CertificateValidator.CertificateValidation += new CertificateValidationEventHandler(CertificateValidator_CertificateValidation);
            }

            m_masterPage  = masterPage;
            m_context     = context;
            m_application = application;
            m_server      = application.Server as Opc.Ua.Server.StandardServer;

            if (m_masterPage == null)
            {
                m_pages = new List <ClientPage>();
            }

            m_configuration = configuration;

            SessionsCTRL.Configuration    = configuration;
            SessionsCTRL.MessageContext   = context;
            SessionsCTRL.AddressSpaceCtrl = BrowseCTRL;
            SessionsCTRL.NodeSelected    += SessionCtrl_NodeSelected;

            // get list of cached endpoints.
            m_endpoints = m_configuration.LoadCachedEndpoints(true);
            m_endpoints.DiscoveryUrls = configuration.ClientConfiguration.WellKnownDiscoveryUrls;

            // hook up endpoint selector
            EndpointSelectorCTRL.Initialize(m_endpoints, m_configuration);
            EndpointSelectorCTRL.ConnectEndpoint  += EndpointSelectorCTRL_ConnectEndpoint;
            EndpointSelectorCTRL.EndpointsChanged += EndpointSelectorCTRL_OnChange;

            BrowseCTRL.SessionTreeCtrl = SessionsCTRL;
            BrowseCTRL.NodeSelected   += BrowseCTRL_NodeSelected;

            // exception dialog
            GuiUtils.ExceptionMessageDlg += ExceptionMessageDlg;

            ServerUrlTB.Text = "None";

            m_publishers = AmqpConnectionCollection.Load(configuration);

            foreach (var publisher in m_publishers)
            {
                Task t = publisher.OpenAsync();
            }

            m_MonitoredItem_Notification = new MonitoredItemNotificationEventHandler(MonitoredItem_Notification);
        }
コード例 #5
0
        private void OnRegister(object sender)
        {
            try {
                Opc.Ua.Server.StandardServer server = m_server;

                if (server != null)
                {
                    server.RegisterWithDiscoveryServer();
                }
            } catch (Exception exception) {
                Utils.Trace(exception, "Could not register with the LDS");
            }
        }
コード例 #6
0
        public ClientForm(
            ServiceMessageContext context,
            ApplicationInstance application,
            ClientForm masterForm,
            ApplicationConfiguration configuration)
        {
            InitializeComponent();
            this.Icon = ClientUtils.GetAppIcon();

            // Create the NotifyIcon.
            this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);

            // The Icon property sets the icon that will appear
            // in the systray for this application.
            notifyIcon1.Icon = ClientUtils.GetAppIcon();

            // The Text property sets the text that will be displayed,
            // in a tooltip, when the mouse hovers over the systray icon.
            notifyIcon1.Text    = "OPCUA-MQTT Interface";
            notifyIcon1.Visible = true;

            // Handle the DoubleClick event to activate the form.
            notifyIcon1.DoubleClick += new System.EventHandler(this.notifyIcon1_DoubleClick);

            m_masterForm  = masterForm;
            m_context     = context;
            m_application = application;
            m_server      = application.Server as Opc.Ua.Server.StandardServer;

            if (m_masterForm == null)
            {
                m_forms = new List <ClientForm>();
            }

            SessionsCTRL.Configuration  = m_configuration = configuration;
            SessionsCTRL.MessageContext = context;

            // get list of cached endpoints.
            m_endpoints = m_configuration.LoadCachedEndpoints(true);
            m_endpoints.DiscoveryUrls = configuration.ClientConfiguration.WellKnownDiscoveryUrls;
            EndpointSelectorCTRL.Initialize(m_endpoints, m_configuration);

            // initialize control state.
            Disconnect();
        }
コード例 #7
0
ファイル: ClientForm.cs プロジェクト: zzpgeorge/OPCUA.Viewer
        public ClientForm(
            ServiceMessageContext context,
            ApplicationInstance application,
            ClientForm masterForm,
            ApplicationConfiguration configuration,
            string logFileFolderPath
            )
        {
            InitializeComponent();
            if (maintenanceControlComponent.Warning != null)
            {
                Utils.Trace("The following warning(s) appeared during loading the license: " + maintenanceControlComponent.Warning);
            }
            if (String.IsNullOrEmpty(logFileFolderPath))
            {
                throw new ArgumentNullException(nameof(logFileFolderPath));
            }
            m_logFileFolderPath = logFileFolderPath;
            m_masterForm        = masterForm;
            m_context           = context;
            m_application       = application;
            m_server            = application.Server as Opc.Ua.Server.StandardServer;

            if (m_masterForm == null)
            {
                m_forms = new List <ClientForm>();
            }

            SessionsCTRL.Configuration  = m_configuration = configuration;
            SessionsCTRL.MessageContext = context;

            m_btcBrowse  = (BaseTreeCtrl)BrowseCTRL;
            m_btcSession = (BaseTreeCtrl)SessionsCTRL;
            m_btcSession.NodesTV.MouseDown += new MouseEventHandler(NodesTVInSession_MouseDown);
            m_btcBrowse.NodesTV.MouseDown  += new MouseEventHandler(NodesTVInBrowse_MouseDown);

            // get list of cached endpoints.
            m_endpoints = m_configuration.LoadCachedEndpoints(true);
            m_endpoints.DiscoveryUrls = configuration.ClientConfiguration.WellKnownDiscoveryUrls;
            EndpointSelectorCTRL.Initialize(m_endpoints, m_configuration);

            // initialize control state.
            Disconnect();
        }
コード例 #8
0
ファイル: PublisherForm.cs プロジェクト: fr830/OPCUA.NET
        public PublisherForm(
            ServiceMessageContext context,
            ApplicationInstance application,
            PublisherForm masterForm,
            ApplicationConfiguration configuration)
        {
            InitializeComponent();
            this.Icon = ClientUtils.GetAppIcon();

            m_masterForm  = masterForm;
            m_context     = context;
            m_application = application;
            m_server      = application.Server as Opc.Ua.Server.StandardServer;

            if (m_masterForm == null)
            {
                m_forms = new List <PublisherForm>();
            }

            SessionsCTRL.Configuration  = m_configuration = configuration;
            SessionsCTRL.MessageContext = context;

            // get list of cached endpoints.
            m_endpoints = m_configuration.LoadCachedEndpoints(true);
            m_endpoints.DiscoveryUrls = configuration.ClientConfiguration.WellKnownDiscoveryUrls;
            EndpointSelectorCTRL.Initialize(m_endpoints, m_configuration);

            // initialize control state.
            Disconnect();

            m_publishers = AmqpConnectionCollection.Load(configuration);
            foreach (var publisher in m_publishers)
            {
                Task t = publisher.OpenAsync();
            }

            this.NotificationsCTRL.ItemsAdded += NotificationsCTRL_ItemsAdded;
        }
コード例 #9
0
ファイル: PublisherForm.cs プロジェクト: mpostol/UA-.NET
        public PublisherForm(
            ServiceMessageContext context,
            ApplicationInstance application, 
            PublisherForm masterForm, 
            ApplicationConfiguration configuration)
        {
            InitializeComponent();
            this.Icon = ClientUtils.GetAppIcon();

            m_masterForm = masterForm;
            m_context = context;
            m_application = application;
            m_server = application.Server as Opc.Ua.Server.StandardServer;

            if (m_masterForm == null)
            {
                m_forms = new List<PublisherForm>();
            }

            SessionsCTRL.Configuration  = m_configuration = configuration;
            SessionsCTRL.MessageContext = context;

            // get list of cached endpoints.
            m_endpoints = m_configuration.LoadCachedEndpoints(true);
            m_endpoints.DiscoveryUrls = configuration.ClientConfiguration.WellKnownDiscoveryUrls;
            EndpointSelectorCTRL.Initialize(m_endpoints, m_configuration);

            // initialize control state.
            Disconnect();

            m_publishers = AmqpConnectionCollection.Load(configuration);
            foreach (var publisher in m_publishers)
            {
                Task t = publisher.OpenAsync();
            }

            this.NotificationsCTRL.ItemsAdded += NotificationsCTRL_ItemsAdded;
        }