diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-15 15:10:08 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-15 15:10:08 +0300 |
| commit | b90acacb7dbef7d088d57a200cc4d71148bffd1e (patch) | |
| tree | ca3ae211da23ac1352d1aaa4d43b7947eddee916 /Software/Visual_Studio/SideChains | |
| parent | de5700549a5fe01862f71d452f2abe4a74996605 (diff) | |
| download | Tango-b90acacb7dbef7d088d57a200cc4d71148bffd1e.tar.gz Tango-b90acacb7dbef7d088d57a200cc4d71148bffd1e.zip | |
Implemented custom min max on single and multiple graphs on tech board.
Diffstat (limited to 'Software/Visual_Studio/SideChains')
3 files changed, 33 insertions, 2 deletions
diff --git a/Software/Visual_Studio/SideChains/RealTimeGraphEx/Components/ComponentBase.cs b/Software/Visual_Studio/SideChains/RealTimeGraphEx/Components/ComponentBase.cs index 3e2294068..5bdef111c 100644 --- a/Software/Visual_Studio/SideChains/RealTimeGraphEx/Components/ComponentBase.cs +++ b/Software/Visual_Studio/SideChains/RealTimeGraphEx/Components/ComponentBase.cs @@ -37,10 +37,16 @@ namespace RealTimeGraphEx.Components { Graph.ZoomComplete += OnGraphZoomComplete; Graph.PanningComplete += OnGraphPanningComplete; + Graph.MinMaxChanged += Graph_MinMaxChanged; Render(Graph); } } + private void Graph_MinMaxChanged(object sender, EventArgs e) + { + OnGraphMinMaxChanged(); + } + public abstract void Render(RealTimeGraphExBase graph, bool animate = false); public void RemoveFromParent() @@ -97,5 +103,10 @@ namespace RealTimeGraphEx.Components { } + + protected virtual void OnGraphMinMaxChanged() + { + + } } } diff --git a/Software/Visual_Studio/SideChains/RealTimeGraphEx/Components/YAxisScroll.cs b/Software/Visual_Studio/SideChains/RealTimeGraphEx/Components/YAxisScroll.cs index 40a6ca5cb..618cdc27e 100644 --- a/Software/Visual_Studio/SideChains/RealTimeGraphEx/Components/YAxisScroll.cs +++ b/Software/Visual_Studio/SideChains/RealTimeGraphEx/Components/YAxisScroll.cs @@ -192,6 +192,11 @@ namespace RealTimeGraphEx.Components Render(Graph, true); } + protected override void OnGraphMinMaxChanged() + { + Render(Graph); + } + protected override void OnGraphPanningComplete(Point translate) { if (innerGrid != null) diff --git a/Software/Visual_Studio/SideChains/RealTimeGraphEx/RealTimeGraphExBase.cs b/Software/Visual_Studio/SideChains/RealTimeGraphEx/RealTimeGraphExBase.cs index f0c612608..a2060d10e 100644 --- a/Software/Visual_Studio/SideChains/RealTimeGraphEx/RealTimeGraphExBase.cs +++ b/Software/Visual_Studio/SideChains/RealTimeGraphEx/RealTimeGraphExBase.cs @@ -71,6 +71,11 @@ namespace RealTimeGraphEx /// </summary> public new event MouseEventHandler MouseLeave; + /// <summary> + /// Occurs when [minimum maximum changed]. + /// </summary> + public event EventHandler MinMaxChanged; + #endregion #region Protected Fields @@ -141,7 +146,12 @@ namespace RealTimeGraphEx set { SetValue(MaximumProperty, value); } } public static readonly DependencyProperty MaximumProperty = - DependencyProperty.Register("Maximum", typeof(double), typeof(RealTimeGraphExBase), new PropertyMetadata(255.0, new PropertyChangedCallback(CrossModelChanged))); + DependencyProperty.Register("Maximum", typeof(double), typeof(RealTimeGraphExBase), new PropertyMetadata(255.0, (d, e) => + { + var control = d as RealTimeGraphExBase; + CrossModelChanged(d, e); + control.MinMaxChanged?.Invoke(control, new EventArgs()); + })); /// <summary> /// Gets or sets the minimum expected value to be plotted on the graph (default 0). @@ -152,7 +162,12 @@ namespace RealTimeGraphEx set { SetValue(MinimumProperty, value); } } public static readonly DependencyProperty MinimumProperty = - DependencyProperty.Register("Minimum", typeof(double), typeof(RealTimeGraphExBase), new PropertyMetadata(0.0, new PropertyChangedCallback(CrossModelChanged))); + DependencyProperty.Register("Minimum", typeof(double), typeof(RealTimeGraphExBase), new PropertyMetadata(0.0, (d, e) => + { + var control = d as RealTimeGraphExBase; + CrossModelChanged(d, e); + control.MinMaxChanged?.Invoke(control, new EventArgs()); + })); /// <summary> /// Gets or sets the graph refresh rate in milliseconds (default 30, affects performance). |
