/// <summary> /// Update readings from all devices. /// </summary> public void Read() { _gasMixer?.Read(); if (_useDatalogger == true) { _datalogger?.Read(); } // TODO: Update GUI with new values. }
/// <summary> /// When the "Measure" button is clicked, read from all channels. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonMeasure_Click(object sender, EventArgs e) { try { // Read from datalogger. _datalogger.Read(); // Update GUI. dataGridViewMeasurements.Rows.Clear(); for (uint i = 0; i < _datalogger.Readings.Count; i++) { string[] row = { (i + 1).ToString(), _datalogger.Readings[i].ToString() }; dataGridViewMeasurements.Rows.Add(row); } } catch (DeviceSettingNotSupportedException ex) { MessageBox.Show(ex.Message); } }