예제 #1
0
 public FrameAnalyserDialog(FrameCaptureCollection frames, SampleCondition condition, AnalysisParameters parameters)
 {
     TaskbarItemInfo = new TaskbarItemInfo();
     _condition      = condition;
     _parameters     = parameters;
     _frames         = frames;
     InitializeComponent();
 }
예제 #2
0
        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;
            }
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
 public SampleAnalyser(SampleCondition condition, AnalysisParameters parameters)
 {
     _condition  = condition;
     _parameters = parameters;
 }