public ClientWrapper(string IRType) { _UCDataView = new UserControlDataView(IRType); _clientComm = new ClientComm(IRType); _UCDataView.ConnectRequestEvent += _clientComm.ConnectRequestEventHandler; _UCDataView.DownloadRequestEvent += _clientComm.DownloadRequestEventHandler; _UCDataView.UpdateRequestEVent += _clientComm.UpdateRequestEventHandler; _clientComm.ConnectionEstablishedEvent += _UCDataView.ConnectionEstablishedEventHandler; _clientComm.SendConnectionInfoEvent += _UCDataView.SendConnectionInfoEventHandler; _clientComm.SendDataTableToUIEvent += _UCDataView.SendDataTableToUIEventHandler; _clientComm.ErrorReportToUIEvent += _UCDataView.ErrorReportToUIEventhandler; }
private void btnStartStop_Click(object sender, EventArgs e) { if (coefficientsRead == true) { try { if (btnStartStop.Text == "START") { comm = new ClientComm(Port, IP); btnStartStop.Text = "STOP"; if (testMode) { ServerProcessing = new Thread(GetFilteredTestData); ServerProcessing.Start(); } else { ServerProcessing = new Thread(GetFilteredData); ServerProcessing.Start(); } } else { stopAcquisition = true; btnStartStop.Text = "START"; return; } } catch (Exception ex) { Log("Error in connection: " + ex.Message); } } else { MessageBox.Show("No coefficient file specified.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }