protected override IObservable <ValidationResult> Process(IObservable <ValidationPointData> data, PixelOptions options)
        {
            Point2 resolution = ReadScreenResolution(options);

            var strategy = new PixelValidationEvaluationStrategy(resolution.X, resolution.Y);

            return(data.Buffer((a, b) => a.Point.Validation != b.Point.Validation)
                   .Select(validation =>
            {
                return ValidationEvaluation.Evaluate(validation, strategy);
            }));
        }
Exemple #2
0
        protected override IObservable <ValidationResult> Process(IObservable <ValidationPointData> data, AngularOptions options)
        {
            var defaultDisplayArea = _displayAreaEvents.Select(e => e.DisplayArea).FirstOrDefault();

            if (defaultDisplayArea == null)
            {
                return(Observable.Empty <ValidationResult>());
            }

            return(data.Buffer((a, b) => a.Point.Validation != b.Point.Validation)
                   .Select(validation =>
            {
                var startTime = validation.Min(v => v.Point.StartTime);
                var displayArea = _displayAreaEvents.Where(e => e.Timestamp < startTime)
                                  .OrderBy(e => e.Timestamp)
                                  .Select(e => e.DisplayArea)
                                  .LastOrDefault() ?? defaultDisplayArea;

                var strategy = new AngularValidationEvaluationStrategy(displayArea);

                return ValidationEvaluation.Evaluate(validation, strategy);
            }));
        }