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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
using RealTimeGraphX.EventArguments;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RealTimeGraphX
{
/// <summary>
/// Represents a graph controller.
/// A graph controller is the first component in the sequence of graph components and it's role is to
/// Push data points and pass them to the output <see cref="IGraphRenderer"/>.
/// </summary>
/// <typeparam name="TDataSeries">The type of the graph data series.</typeparam>
/// <seealso cref="RealTimeGraphX.IGraphComponent" />
public interface IGraphController<TDataSeries> : IGraphOutputComponent<IGraphRenderer<TDataSeries>>, IGraphComponent where TDataSeries : IGraphDataSeries
{
#region Events
/// <summary>
/// Occurs when one of the <see cref="Range"/> properties was modified.
/// </summary>
event EventHandler<IGraphRange> RangeChanged;
#endregion
#region Properties
/// <summary>
/// Gets the graph range (limits).
/// </summary>
IGraphRange Range { get; }
/// <summary>
/// Gets the data series collection.
/// </summary>
ReadOnlyObservableCollection<TDataSeries> DataSeriesCollection { get; }
/// <summary>
/// Gets or sets a value indicating whether to pause the graph movement.
/// </summary>
bool IsPaused { get; set; }
#endregion
#region Methods
/// <summary>
/// Adds a new data series.
/// </summary>
/// <param name="series">The series.</param>
void AddDataSeries(TDataSeries series);
/// <summary>
/// Removed the specified data series
/// </summary>
/// <param name="series">The series.</param>
void RemoveDataSeries(TDataSeries series);
/// <summary>
/// Clears the graph data.
/// </summary>
void Clear();
#endregion
}
/// <summary>
/// Represents a graph controller.
/// A graph controller is the first component in the sequence of graph components and it's role is to
/// Push data points and pass them to the output <see cref="IGraphRenderer{XDataPoint, YDataPoint}"/>.
/// </summary>
/// <typeparam name="TDataSeries">The type of the graph data series.</typeparam>
/// <typeparam name="XDataPoint">The type of the x-axis data point.</typeparam>
/// <typeparam name="YDataPoint">The type of the y-axis data point.</typeparam>
/// <seealso cref="RealTimeGraphX.IGraphOutputComponent{RealTimeGraphX.IGraphRenderer}" />
/// <seealso cref="RealTimeGraphX.IGraphComponent" />
public interface IGraphController<TDataSeries, XDataPoint, YDataPoint> : IGraphController<TDataSeries>, IGraphOutputComponent<IGraphRenderer<TDataSeries, XDataPoint, YDataPoint>> where XDataPoint : GraphDataPointBase where YDataPoint : GraphDataPointBase where TDataSeries : IGraphDataSeries
{
#region Events
/// <summary>
/// Occurs when one of the <see cref="Range"/> properties was modified.
/// </summary>
new event EventHandler<GraphRange<XDataPoint, YDataPoint>> RangeChanged;
/// <summary>
/// Occurs when the connected <see cref="IGraphRenderer{XDataPoint, YDataPoint}"/> has changed.
/// </summary>
new event EventHandler<OutputChangedEventArgs<IGraphRenderer<TDataSeries, XDataPoint, YDataPoint>>> OutputChanged;
#endregion
#region Properties
/// <summary>
/// Gets the graph range (limits).
/// </summary>
new GraphRange<XDataPoint, YDataPoint> Range { get; }
/// <summary>
/// Gets the connected output <see cref="IGraphRenderer{XDataPoint, YDataPoint}"/>.
/// </summary>
new IGraphRenderer<TDataSeries, XDataPoint, YDataPoint> Output { get; }
#endregion
#region Methods
/// <summary>
/// Submits the specified x and y data points the controller.
/// If the controller has more than one data series the data points will be duplicated.
/// </summary>
/// <param name="x">X data point.</param>
/// <param name="y">Y data point.</param>
void PushData(XDataPoint x, YDataPoint y);
/// <summary>
/// Submits the specified collections of x and y data points.
/// If the controller has more than one data series the data points will be distributed evenly.
/// </summary>
/// <param name="xx">X data point collection.</param>
/// <param name="yy">Y data point collection.</param>
void PushData(IEnumerable<XDataPoint> xx, IEnumerable<YDataPoint> yy);
/// <summary>
/// Submits a matrix of x and y data points. Meaning each data series should process a single collection of x/y data points.
/// </summary>
/// <param name="xxxx">X matrix.</param>
/// <param name="yyyy">Y matrix.</param>
void PushData(IEnumerable<IEnumerable<XDataPoint>> xxxx, IEnumerable<IEnumerable<YDataPoint>> yyyy);
#endregion
}
}
|