private void RefreshFormTimer_Tick(object sender, EventArgs e) { try { RefreshMainForm(); if (tabControlInterface.SelectedTab.Name == this.tabOPCClient.Name) { RefreshOPCPage(); } if (tabControlInterface.SelectedTab.Name == this.tabPage_groups.Name) { RefreshGroupPage(); } if (tabControlInterface.SelectedTab.Name == this.tabItems.Name) { RefreshItemPage(); } if (tabControlInterface.SelectedTab.Name == this.tabTransactions.Name) { RefreshTransactionPage(); } } catch { remoterserver = null; MessageBox.Show(Resources.tx_DataPorter_MainForm_warning_disconnected + this.textBox_connected_to_url.Text); } if (CAS.Lib.RTLib.Processes.Manager.NumOfErrors > 0) { new CAS.Lib.RTLib.Processes.EventLogMonitor ( "DataPorter finished with Assert error", System.Diagnostics.EventLogEntryType.Error, 0, 0 ).WriteEntry(); } }
private void button_ConnectDisconnect_Click(object sender, EventArgs e) { if (remoterserver != null) { //disconnecting: this.remoterserver = null; this.button_ConnectDisconnect.Text = Resources.tx_DataPorter_MainForm_buttonConnect; } else { this.button_ConnectDisconnect.Text = Resources.tx_DataPorter_MainForm_buttonDisconnect; this.ConnectToRemoteServerAndInitialiseDiagnosticPages(); } }
private void ConnectToRemoteServerAndInitialiseDiagnosticPages() { string label_connected_to_Text = "tcp://" + this.textBox_Host.Text + ":" + this.textBox_port.Text + "/" + Settings.Default.MonitorInterfaceEntryName; try { this.remoterserver = (MonitorInterfaceAbstract)Activator.GetObject (typeof(MonitorInterfaceAbstract), label_connected_to_Text); } catch { remoterserver = null; } if (remoterserver != null) { this.textBox_connected_to_url.Text = label_connected_to_Text; //pages initialisation try { this.textBox_connected_to_name.Text = remoterserver.GetProductName(); this.textBox_conected_to_version.Text = remoterserver.GetProductVersion(); this.button_ShutDown.Enabled = true; InitOPCPage(); InitGroupPage(); InitTagPage(); InitTransactionPage(); RefreshFormTimer.Enabled = true; } catch { remoterserver = null; MessageBox.Show(Resources.tx_DataPorter_MainForm_unabletoconnect + this.textBox_connected_to_url.Text); } } }