/// <summary> /// Selects the variable to display. /// </summary> private void Aggregates_SelectVariableMI_Click(object sender, EventArgs e) { try { if (m_session == null) { return; } NodeId nodeId = new Opc.Ua.Client.Controls.SelectNodeDlg().ShowDialog( m_session, Opc.Ua.ObjectIds.ObjectsFolder, "Select Variable to Monitor", ReferenceTypes.Organizes, ReferenceTypes.Aggregates); if (nodeId != null) { ReadCTRL.ChangeNode(nodeId); } } catch (Exception exception) { ClientUtils.HandleException(this.Text, exception); } }
/// <summary> /// Creates a form which uses the specified client configuration. /// </summary> /// <param name="configuration">The configuration to use.</param> public MainForm(ApplicationConfiguration configuration) { InitializeComponent(); this.Icon = ClientUtils.GetAppIcon(); ReadCTRL.Reset(); ConnectServerCTRL.Configuration = m_configuration = configuration; ConnectServerCTRL.ServerUrl = "opc.tcp://localhost:62550/Quickstarts/HistoricalAccessServer"; this.Text = m_configuration.ApplicationName; }
/// <summary> /// Updates the application after reconnecting to the server. /// </summary> private void Server_ReconnectComplete(object sender, EventArgs e) { try { m_session = ConnectServerCTRL.Session; ReadCTRL.SessionReconnected(m_session); } catch (Exception exception) { ClientUtils.HandleException(this.Text, exception); } }
private void ViewHistoricalConfigurationMI_Click(object sender, EventArgs e) { try { if (m_session == null) { return; } ReadCTRL.ShowConfiguration(); } catch (Exception exception) { ClientUtils.HandleException(this.Text, exception); } }
/// <summary> /// Updates the application after connecting to or disconnecting from the server. /// </summary> private void Server_ConnectComplete(object sender, EventArgs e) { try { m_session = ConnectServerCTRL.Session; // set a suitable initial state. if (m_session != null && !m_connectedOnce) { m_connectedOnce = true; } ReadCTRL.ChangeSession(m_session); } catch (Exception exception) { ClientUtils.HandleException(this.Text, exception); } }