Ejemplo n.º 1
0
 private void _viewCalibrationMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         var calibration = _connectedTracker.GetCalibration();
         var resultForm  = new CalibrationResultForm();
         resultForm.SetPlotData(calibration);
         resultForm.ShowDialog();
     }
     catch (EyeTrackerException ee)
     {
         MessageBox.Show("Failed to get calibration data. Got exception " + ee,
                         "Error",
                         MessageBoxButtons.OK,
                         MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 2
0
        private void _calibrateButton_Click(object sender, EventArgs e)
        {
            var runner = new CalibrationRunner();

            try
            {
                if (_isTracking)
                {
                    _connectedTracker.StopTracking();
                    _isTracking = false;
                }

                // Start a new calibration procedure
                var result = runner.RunCalibration(_connectedTracker, _calib_flag);

                // Show a calibration plot if everything went OK
                if (result != null)
                {
                    var resultForm = new CalibrationResultForm();
                    resultForm.SetPlotData(result);
                    resultForm.ShowDialog();
                }
                else
                {
                    MessageBox.Show("Not enough data to create a calibration (or calibration aborted).");
                }
            }
            catch (EyeTrackerException ee)
            {
                MessageBox.Show("Failed to calibrate. Got exception " + ee,
                                "Calibration Failed",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }
            UpdateUIElements();
        }