private void btnToCsv_Click(object sender, EventArgs e) { var repo = new CalibrationReadingsRepository(); var readings = repo.Read(); repo.ToCsv(readings); NotifyStatus("Readings CSV written to disk"); }
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"); }
public CalibratingPanTiltController(IPanTiltMechanism panTiltMech, CalibrationReadingsRepository readingsRepo, IScreen screen) : base(panTiltMech) { _colourDetector = new ColourDetector(); _readingsRepo = readingsRepo; _screen = screen; if (EnvironmentService.IsUnix) { _servoSettleTime = TimeSpan.FromMilliseconds(750); } else { _servoSettleTime = TimeSpan.FromMilliseconds(0); } }
public AutoCalibratedModifierStrategy(CaptureConfig captureConfig, Point target) : base(captureConfig, target) { var readingsRepository = new CalibrationReadingsRepository(); var readings = readingsRepository.Read(); if (!readings.ContainsKey(captureConfig.Resolution)) { readings.Add(captureConfig.Resolution, new AxesCalibrationReadings()); Log.WarnFormat("Failed to load any calibration readings for {0}", captureConfig.Resolution); } _calibratedReadings = readings[captureConfig.Resolution]; Log.InfoFormat( "Using {0} horizontal, {1} vertial calibration readings for {2}" , _calibratedReadings.Horizontal.Count , _calibratedReadings.Vertical.Count , captureConfig.Resolution); }
public AutoCalibratedModifierStrategy(CaptureConfig captureConfig, Point target) : base(captureConfig, target) { var readingsRepository = new CalibrationReadingsRepository(); var readings = readingsRepository.Read(); if (readings == null) { Log.WarnFormat("No calibration readings found for pan tilt"); readings = new PanTiltCalibrationReadings(); } if (!readings.ContainsKey(captureConfig.Resolution)) { readings.Add(captureConfig.Resolution, new AxesCalibrationReadings()); Log.WarnFormat("Failed to load any calibration readings for {0}", captureConfig.Resolution); } _calibratedReadings = readings[captureConfig.Resolution]; Log.InfoFormat( "Using {0} horizontal, {1} vertial calibration readings for {2}" , _calibratedReadings.Horizontal.Count , _calibratedReadings.Vertical.Count , captureConfig.Resolution); }