public FrameAnalyserDialog(FrameCaptureCollection frames, SampleCondition condition, AnalysisParameters parameters) { TaskbarItemInfo = new TaskbarItemInfo(); _condition = condition; _parameters = parameters; _frames = frames; InitializeComponent(); }
public ConditionEditorDialog(PixelColorSampleCondition condition, AnalysisParameters parameters) { Conditions = new List <ConditionViewModel>(); Conditions.Add(new ConditionViewModel("Red", 0, 255, condition?.Red)); Conditions.Add(new ConditionViewModel("Green", 0, 255, condition?.Green)); Conditions.Add(new ConditionViewModel("Blue", 0, 255, condition?.Blue)); Conditions.Add(new ConditionViewModel("Hue", 0, 360, condition?.Hue)); Conditions.Add(new ConditionViewModel("Sat", 0, 100, condition?.Saturation)); Conditions.Add(new ConditionViewModel("Lum", 0, 100, condition?.Luminosity)); InitializeComponent(); if (condition != null) { switch (condition.Source) { case ConditionSource.Average: rbAverage.IsChecked = true; break; case ConditionSource.Majority: rbMajority.IsChecked = true; break; default: throw new ArgumentOutOfRangeException(); } } if (parameters != null) { switch (parameters.Method) { case TimeStampDeterminationMethod.FirstOccurence: rbFirst.IsChecked = true; break; case TimeStampDeterminationMethod.Center: rbCenter.IsChecked = true; break; case TimeStampDeterminationMethod.LastOccurence: rbLast.IsChecked = true; break; default: throw new ArgumentOutOfRangeException(); } } foreach (var cond in Conditions) { cond.PropertyChanged += CondOnPropertyChanged; } }
private void AnalyseSamples() { if (_frameSamples == null) { MessageBox.Show(this, "No samples to analyse!"); return; } AnalysisParameters parameters = new AnalysisParameters(); FrameAnalyserDialog dialog = new FrameAnalyserDialog(_frameSamples, _condition, parameters); if (dialog.ShowDialog() != true) { return; } SetAllBeats(dialog.Result); }
private AnalysisParameters GetParameters() { AnalysisParameters result = new AnalysisParameters { MaxPositiveSamples = int.MaxValue }; if (rbFirst.IsChecked == true) { result.Method = TimeStampDeterminationMethod.FirstOccurence; } else if (rbCenter.IsChecked == true) { result.Method = TimeStampDeterminationMethod.Center; } else if (rbLast.IsChecked == true) { result.Method = TimeStampDeterminationMethod.LastOccurence; } return(result); }
public SampleAnalyser(SampleCondition condition, AnalysisParameters parameters) { _condition = condition; _parameters = parameters; }