예제 #1
0
 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);
     }
 }
예제 #2
0
 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!");
     }
 }
예제 #3
0
 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);
     }
 }