diff options
| author | Roy <roy.mail.net@gmail.com> | 2018-02-04 09:04:55 +0200 |
|---|---|---|
| committer | Roy <roy.mail.net@gmail.com> | 2018-02-04 09:04:55 +0200 |
| commit | ffba68ef988743f3b70f3cd85fa16eab2abc7030 (patch) | |
| tree | a60800adb4ac35bcda26461b92018790c613068b /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls | |
| parent | 9fa032b7aea6f2fbfdae05d21c3c10db174e1662 (diff) | |
| download | Tango-ffba68ef988743f3b70f3cd85fa16eab2abc7030.tar.gz Tango-ffba68ef988743f3b70f3cd85fa16eab2abc7030.zip | |
Modified video frame.
Modified developer module configuration design.
Implemented graph full-screen.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls')
3 files changed, 82 insertions, 14 deletions
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. /// </summary> GraphControllerBase Controller { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether to enable toolbar buttons. + /// </summary> + 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 /// </summary> public partial class RealTimeGraphControl : UserControl, IRealTimeGraph { + private Grid headerGrid; + #region Properties /// <summary> @@ -58,6 +60,32 @@ namespace Tango.MachineStudio.Common.Controls /// </summary> public GraphControllerBase Controller { get; set; } + + private bool _enableToolbar; + /// <summary> + /// Gets or sets a value indicating whether to enable toolbar buttons. + /// </summary> + 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<Grid>().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<Grid>().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<Grid>().ToList().First(); + headerGrid = mainGrid.Children.OfType<Grid>().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 /// </summary> public partial class RealTimeGraphMultiControl : UserControl , IRealTimeGraph { + private Grid headerGrid; + #region Properties /// <summary> @@ -58,6 +60,30 @@ namespace Tango.MachineStudio.Common.Controls /// </summary> public GraphControllerBase Controller { get; set; } + private bool _enableToolbar; + /// <summary> + /// Gets or sets a value indicating whether to enable toolbar buttons. + /// </summary> + 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<Grid>().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<Grid>().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<Grid>().ToList().First(); + headerGrid = mainGrid.Children.OfType<Grid>().ToList().First(); ThicknessAnimation ani = new ThicknessAnimation(); ani.To = new Thickness(0, -35, 0, 0); ani.Duration = TimeSpan.FromSeconds(0.2); |
