Esempio n. 1
0
 private void CalibrationTimer_Tick(object sender, EventArgs e, Form1 winForm)
 {
     if (calibratorBuilder.Points.Where(p => calibratorBuilder.IsMoreCalibrationNeeded(p)).Any())
     {
         var point    = calibratorBuilder.Points.Where(p => calibratorBuilder.IsMoreCalibrationNeeded(p)).First();
         int boxWidth = 4;
         winForm.DrawSquare((int)(point.X) - boxWidth / 2, (int)(point.Y) - boxWidth / 2, Brushes.Purple, boxWidth);
         calibratorBuilder.AddCalibration(point, GetGazePoint());
         if (!calibratorBuilder.IsMoreCalibrationNeeded(point))
         {
             winForm.ClearDrawings();
         }
     }
     else
     {
         calibrationTimer.Stop();
         calibrationTimer.Enabled = false;
         calibrator = calibratorBuilder.BuildCalibratedScreen();
         MessageBox.Show("Calibration complete");
     }
 }
Esempio n. 2
0
 public void LoadTobiiProfile(string participantCode, string calibrationDataFilepath, string gazeDataFilepath)
 {
     calibrator = new GlobalScalingLocalOffsetCalibrator(Calibrator.DeserialiseCalibrationMapping(File.ReadAllText(calibrationDataFilepath)));
     player.StartGazeDataStreams(GazeDataStream_Next, gazeDataFilepath, null, null, null, null);
 }