From ffba68ef988743f3b70f3cd85fa16eab2abc7030 Mon Sep 17 00:00:00 2001 From: Roy Date: Sun, 4 Feb 2018 09:04:55 +0200 Subject: Modified video frame. Modified developer module configuration design. Implemented graph full-screen. --- .../Controls/IRealTimeGraph.cs | 5 +++ .../Controls/RealTimeGraphControl.xaml.cs | 47 ++++++++++++++++++---- .../Controls/RealTimeGraphMultiControl.xaml.cs | 44 ++++++++++++++++---- 3 files changed, 82 insertions(+), 14 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/IRealTimeGraph.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/IRealTimeGraph.cs index 5ca930c91..bf40d459e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/IRealTimeGraph.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/IRealTimeGraph.cs @@ -44,5 +44,10 @@ namespace Tango.MachineStudio.Common.Controls /// Gets or sets the inner graph controller. /// GraphControllerBase Controller { get; set; } + + /// + /// Gets or sets a value indicating whether to enable toolbar buttons. + /// + bool EnableToolBar { get; set; } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphControl.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphControl.xaml.cs index 359e52823..c1728a975 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphControl.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphControl.xaml.cs @@ -24,6 +24,8 @@ namespace Tango.MachineStudio.Common.Controls /// public partial class RealTimeGraphControl : UserControl, IRealTimeGraph { + private Grid headerGrid; + #region Properties /// @@ -58,6 +60,32 @@ namespace Tango.MachineStudio.Common.Controls /// public GraphControllerBase Controller { get; set; } + + private bool _enableToolbar; + /// + /// Gets or sets a value indicating whether to enable toolbar buttons. + /// + public bool EnableToolBar + { + get { return _enableToolbar; } + set + { + _enableToolbar = value; + + if (!value) + { + if (headerGrid != null) + { + ThicknessAnimation ani = new ThicknessAnimation(); + ani.To = new Thickness(0, -35, 0, 0); + ani.Duration = TimeSpan.FromSeconds(0.2); + headerGrid.BeginAnimation(Grid.MarginProperty, ani); + } + } + } + } + + #endregion #region Events @@ -70,6 +98,7 @@ namespace Tango.MachineStudio.Common.Controls public RealTimeGraphControl() { InitializeComponent(); + EnableToolBar = true; InnerGraph = Graph; Controller = new GraphController(); } @@ -81,18 +110,21 @@ namespace Tango.MachineStudio.Common.Controls private void Graph_MouseEnter(object sender, MouseEventArgs e) { - Grid mainGrid = sender as Grid; - var headerGrid = mainGrid.Children.OfType().ToList().First(); - ThicknessAnimation ani = new ThicknessAnimation(); - ani.To = new Thickness(0, 0, 0, 0); - ani.Duration = TimeSpan.FromSeconds(0.2); - headerGrid.BeginAnimation(Grid.MarginProperty, ani); + if (EnableToolBar) + { + Grid mainGrid = sender as Grid; + headerGrid = mainGrid.Children.OfType().ToList().First(); + ThicknessAnimation ani = new ThicknessAnimation(); + ani.To = new Thickness(0, 0, 0, 0); + ani.Duration = TimeSpan.FromSeconds(0.2); + headerGrid.BeginAnimation(Grid.MarginProperty, ani); + } } private void Graph_MouseLeave(object sender, MouseEventArgs e) { Grid mainGrid = sender as Grid; - var headerGrid = mainGrid.Children.OfType().ToList().First(); + headerGrid = mainGrid.Children.OfType().ToList().First(); ThicknessAnimation ani = new ThicknessAnimation(); ani.To = new Thickness(0, -35, 0, 0); ani.Duration = TimeSpan.FromSeconds(0.2); @@ -103,5 +135,6 @@ namespace Tango.MachineStudio.Common.Controls { GraphRemoveButtonPressed?.Invoke(this, new EventArgs()); } + } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphMultiControl.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphMultiControl.xaml.cs index 5cb69b786..a18021ff5 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphMultiControl.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphMultiControl.xaml.cs @@ -24,6 +24,8 @@ namespace Tango.MachineStudio.Common.Controls /// public partial class RealTimeGraphMultiControl : UserControl , IRealTimeGraph { + private Grid headerGrid; + #region Properties /// @@ -58,6 +60,30 @@ namespace Tango.MachineStudio.Common.Controls /// public GraphControllerBase Controller { get; set; } + private bool _enableToolbar; + /// + /// Gets or sets a value indicating whether to enable toolbar buttons. + /// + public bool EnableToolBar + { + get { return _enableToolbar; } + set + { + _enableToolbar = value; + + if (!value) + { + if (headerGrid != null) + { + ThicknessAnimation ani = new ThicknessAnimation(); + ani.To = new Thickness(0, -35, 0, 0); + ani.Duration = TimeSpan.FromSeconds(0.2); + headerGrid.BeginAnimation(Grid.MarginProperty, ani); + } + } + } + } + #endregion #region Events @@ -70,6 +96,7 @@ namespace Tango.MachineStudio.Common.Controls public RealTimeGraphMultiControl() { InitializeComponent(); + EnableToolBar = true; InnerGraph = Graph; Controller = new GraphMultiController(); } @@ -81,18 +108,21 @@ namespace Tango.MachineStudio.Common.Controls private void Graph_MouseEnter(object sender, MouseEventArgs e) { - Grid mainGrid = sender as Grid; - var headerGrid = mainGrid.Children.OfType().ToList().First(); - ThicknessAnimation ani = new ThicknessAnimation(); - ani.To = new Thickness(0, 0, 0, 0); - ani.Duration = TimeSpan.FromSeconds(0.2); - headerGrid.BeginAnimation(Grid.MarginProperty, ani); + if (EnableToolBar) + { + Grid mainGrid = sender as Grid; + headerGrid = mainGrid.Children.OfType().ToList().First(); + ThicknessAnimation ani = new ThicknessAnimation(); + ani.To = new Thickness(0, 0, 0, 0); + ani.Duration = TimeSpan.FromSeconds(0.2); + headerGrid.BeginAnimation(Grid.MarginProperty, ani); + } } private void Graph_MouseLeave(object sender, MouseEventArgs e) { Grid mainGrid = sender as Grid; - var headerGrid = mainGrid.Children.OfType().ToList().First(); + headerGrid = mainGrid.Children.OfType().ToList().First(); ThicknessAnimation ani = new ThicknessAnimation(); ani.To = new Thickness(0, -35, 0, 0); ani.Duration = TimeSpan.FromSeconds(0.2); -- cgit v1.3.1