/// <summary> /// Update readings from all devices. /// </summary> public void Read() { _gasMixer?.Read(); if (_useDatalogger == true) { _datalogger?.Read(); } // TODO: Update GUI with new values. }
private void buttonReadConcentration_Click(object sender, EventArgs e) { try { // Fetch new values from the mass flow controllers. _gasMixer.Read(); // Update the form. textBoxGasConcentration.Text = _gasMixer.Readings[VariableType.GasConcentration].ToString(); textBoxMassFlow.Text = _gasMixer.Readings[VariableType.MassFlow].ToString(); // Alert the user. toolStripStatusLabel1.Text = "Success."; } catch (Exception ex) { // If an error occurs, alert the user. MessageBox.Show(ex.Message, ex.GetType().Name.ToString()); toolStripStatusLabel1.Text = ex.GetType().ToString(); } }