Exemplo n.º 1
0
        private void btnInterpolate_Click(object sender, EventArgs e)
        {
            var repo     = new CalibrationReadingsRepository();
            var readings = repo.Read();

            readings.Interpolate();
            repo.Write(readings);
            NotifyStatus("Missing readings interpolated and written to disk");
        }
Exemplo n.º 2
0
        public void Calibrate(Resolution resolution)
        {
            PanTiltCalibrationReadings allReadings;

            if (_readingsRepo.IsPresent)
            {
                allReadings = _readingsRepo.Read();
            }
            else
            {
                allReadings = new PanTiltCalibrationReadings();
            }

            if (allReadings.ContainsKey(resolution))
            {
                allReadings.Remove(resolution);
            }

            allReadings.Add(resolution, new AxesCalibrationReadings());
            _currentResolutionReadings = allReadings[resolution];

            _screen.Clear();

            CalibrateHalfAxis(1, PanTiltAxis.Horizontal);
            CalibrateHalfAxis(-1, PanTiltAxis.Horizontal);
            CalibrateHalfAxis(1, PanTiltAxis.Vertical);
            CalibrateHalfAxis(-1, PanTiltAxis.Vertical);

            _currentResolutionReadings.CalculateAcceptedReadings();

            _readingsRepo.Write(allReadings);
            _readingsRepo.ToCsv(allReadings);

            ResetToCenter();
            _screen.Clear();
            _screen.WriteLine("Calibration written to disk");
        }
Exemplo n.º 3
0
 private void btnInterpolate_Click(object sender, EventArgs e)
 {
     var repo = new CalibrationReadingsRepository();
     var readings = repo.Read();
     readings.Interpolate();
     repo.Write(readings);
     NotifyStatus("Missing readings interpolated and written to disk");
 }