private void ButtonEraseData_Click(object sender, EventArgs e) { try { GeigerHandler.EraseSDCard(serialHandler); MessageBox.Show("SD Card succesfully erased!"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void ButtonUpdateConfig_Click(object sender, EventArgs e) { try { if ((comboBoxInterval.SelectedIndex > -1) && (comboBoxNumber.SelectedIndex > -1)) { GeigerHandler.ConfigureGeiger(serialHandler, comboBoxInterval.SelectedItem.ToString(), comboBoxNumber.SelectedItem.ToString()); MessageBox.Show("Geiger succesfully configured!"); } else { MessageBox.Show("Error! You need to choose configuration parameters before update"); } } catch (Exception) { throw new Exception("Could not configure counter!"); } }
private void ButtonSyncClock_Click(object sender, EventArgs e) { try { if (serialHandler.serialPort.IsOpen == true) { GeigerHandler.SyncClockOnArduino(serialHandler); MessageBox.Show("Clock has been succesfully synchronized!"); } else { DisableFeaturesButtons(); UpdateAvailablePorts(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }