示例#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);
     }
 }