aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Utilities/Tango.DispenserAnalyzer.UI/Analysis/IAnalyzerResult.cs
blob: 6b404d2a51dafea094e32744467c85410965e92e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using OxyPlot;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Core;

namespace Tango.DispenserAnalyzer.UI.Analysis
{
    public class AnalyzerResultPlotData: ExtendedObject
    {
        public ObservableCollection<DataPoint> Points { get; set; }

        public string Title { get; set; }

        private int _step;
        public int XStep
        {
            get { return _step; }
            set { _step = value; RaisePropertyChangedAuto(); }
        }

        private double _from;
        public double From
        {
            get { return _from; }
            set { _from = value; RaisePropertyChangedAuto(); }
        }

        private double _to;
        public double To
        {
            get { return _to; }
            set { _to = value; RaisePropertyChangedAuto(); }
        }

        public void UpdateData()
        {
            _to = Points.Max(x => x.Y) + 2;
            _from = Points.Min(x => x.Y)-1;
            RaisePropertyChanged("Title");
            RaisePropertyChanged("Points");
        }

        public AnalyzerResultPlotData()
        {
            Points = new ObservableCollection<DataPoint>();
            _from = 0;
            _to = 1;
            XStep = 1;
        }

    }
    public interface IAnalyzerResult
    {
        AnalyzerResultValue Result { get; set; }
        List<AnalysisPlotValue> PlotValues { get; set; }
        // ObservableCollection<DataPoint> Points { get; set; }
        AnalyzerResultPlotData RangeToCountChart { get; set; }
        AnalyzerResultPlotData RangeToTimeChart { get; set; }
    }
}