コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: brocci/HP3478Ctrl
 private void ReadButton_Click(object sender, RoutedEventArgs e)
 {
     try {
         DataTextBox.Text = "Reading....";
         EnableButtons(false);
         string calString = HP3478A.ReadCalibration(AddressTextBox.Text);
         DataTextBox.Text = calString;
     } catch (Exception exc) {
         MessageBox.Show("An exception occured: \n\n " + exc.Message, "Error",
                         MessageBoxButton.OK, MessageBoxImage.Error);
     } finally {
         EnableButtons(true);
     }
 }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: brocci/HP3478Ctrl
 private void VerifyButton_Click(object sender, RoutedEventArgs e)
 {
     try {
         string oldCal     = DataTextBox.Text;
         string currentCal = HP3478A.ReadCalibration(AddressTextBox.Text);
         if (HP3478A.CalibrationsEqual(oldCal, currentCal))
         {
             MessageBox.Show("Calibration matches provided data.", "Calibration Verified",
                             MessageBoxButton.OK, MessageBoxImage.Information);
         }
         else
         {
             MessageBox.Show("Calibration DOES NOT match provided data.", "Calibration MISMATCH",
                             MessageBoxButton.OK, MessageBoxImage.Exclamation);
         }
     } catch (Exception exc) {
         MessageBox.Show("An exception occured: \n\n " + exc.Message, "Error",
                         MessageBoxButton.OK, MessageBoxImage.Error);
     } finally {
         EnableButtons(true);
     }
 }