From 1d7dbc075ecf63d583702d9fab2096164bdc4dea Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Mon, 24 Feb 2020 01:37:08 +0200 Subject: FSE menu.. --- Software/Graphics/FSE/Modules/account.png | Bin 0 -> 1140 bytes Software/Graphics/FSE/Modules/diagnostics.png | Bin 0 -> 2342 bytes Software/Graphics/FSE/Modules/settings.png | Bin 0 -> 2598 bytes .../Tango.FSE.Diagnostics/DiagnosticsModule.cs | 3 +- .../Tango.FSE.Diagnostics/Images/diagnostics.png | Bin 0 -> 2342 bytes .../Tango.FSE.Diagnostics.csproj | 50 +++++++ .../Tango.FSE.Diagnostics/ViewModels/MainViewVM.cs | 17 ++- .../Modules/Tango.FSE.Diagnostics/packages.config | 5 + .../Navigation/INavigationManager.cs | 6 + .../Navigation/NavigationMenuItem.cs | 43 ++++++ .../FSE/Tango.FSE.Common/Tango.FSE.Common.csproj | 1 + .../FSE/Tango.FSE.UI/Images/Menu/account.png | Bin 0 -> 1140 bytes .../FSE/Tango.FSE.UI/Images/Menu/settings.png | Bin 0 -> 2598 bytes .../Navigation/DefaultNavigationManager.cs | 14 ++ .../FSE/Tango.FSE.UI/Tango.FSE.UI.csproj | 4 + .../FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs | 24 ++++ .../FSE/Tango.FSE.UI/ViewModels/MainViewVM.cs | 2 - .../FSE/Tango.FSE.UI/Views/LayoutView.xaml | 154 ++++++++++++++++++++- .../FSE/Tango.FSE.UI/Views/LayoutView.xaml.cs | 5 +- 19 files changed, 316 insertions(+), 12 deletions(-) create mode 100644 Software/Graphics/FSE/Modules/account.png create mode 100644 Software/Graphics/FSE/Modules/diagnostics.png create mode 100644 Software/Graphics/FSE/Modules/settings.png create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/Images/diagnostics.png create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.Common/Navigation/NavigationMenuItem.cs create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Menu/account.png create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Menu/settings.png diff --git a/Software/Graphics/FSE/Modules/account.png b/Software/Graphics/FSE/Modules/account.png new file mode 100644 index 000000000..0f0dae3cb Binary files /dev/null and b/Software/Graphics/FSE/Modules/account.png differ diff --git a/Software/Graphics/FSE/Modules/diagnostics.png b/Software/Graphics/FSE/Modules/diagnostics.png new file mode 100644 index 000000000..33fbdd923 Binary files /dev/null and b/Software/Graphics/FSE/Modules/diagnostics.png differ diff --git a/Software/Graphics/FSE/Modules/settings.png b/Software/Graphics/FSE/Modules/settings.png new file mode 100644 index 000000000..a9d0314d1 Binary files /dev/null and b/Software/Graphics/FSE/Modules/settings.png differ diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/DiagnosticsModule.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/DiagnosticsModule.cs index cfa1b81ca..3a09962f5 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/DiagnosticsModule.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/DiagnosticsModule.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media.Imaging; +using Tango.BL.Enumerations; using Tango.FSE.Common; using Tango.FSE.Diagnostics.Views; @@ -16,7 +17,7 @@ namespace Tango.FSE.Diagnostics public override string Description { get; } = "Diagnostics module"; public override BitmapSource Image { get; } public override Type MainViewType { get; } = typeof(MainView); - public override Tango.BL.Enumerations.Permissions Permission { get; } = BL.Enumerations.Permissions.RunPPC; + public override Tango.BL.Enumerations.Permissions Permission { get; } = Permissions.RunPPC; public override void Dispose() { diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/Images/diagnostics.png b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/Images/diagnostics.png new file mode 100644 index 000000000..33fbdd923 Binary files /dev/null and b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/Images/diagnostics.png differ diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/Tango.FSE.Diagnostics.csproj b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/Tango.FSE.Diagnostics.csproj index 5fea87812..db2ea7ce5 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/Tango.FSE.Diagnostics.csproj +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/Tango.FSE.Diagnostics.csproj @@ -13,6 +13,8 @@ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 true + + true @@ -32,6 +34,9 @@ 4 + + ..\..\..\packages\ControlzEx.3.0.2.4\lib\net45\ControlzEx.dll + ..\..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll @@ -41,9 +46,24 @@ ..\..\..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll + + ..\..\..\packages\MahApps.Metro.1.6.5\lib\net46\MahApps.Metro.dll + + + ..\..\..\packages\MaterialDesignColors.1.2.2\lib\net45\MaterialDesignColors.dll + + + ..\..\..\packages\MaterialDesignThemes.3.0.1\lib\net45\MaterialDesignThemes.Wpf.dll + + + ..\..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll + + + ..\..\..\packages\ControlzEx.3.0.2.4\lib\net45\System.Windows.Interactivity.dll + @@ -91,6 +111,10 @@ + + {bb2abb74-ba58-4812-83aa-ec8171f42df4} + Tango.AutoComplete + {f441feee-322a-4943-b566-110e12fd3b72} Tango.BL @@ -99,10 +123,18 @@ {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core + + {4206ac58-3b57-4699-8835-90bf6db01a61} + Tango.Integration + {bc932dbd-7cdb-488c-99e4-f02cf441f55e} Tango.Logging + + {e4927038-348d-4295-aaf4-861c58cb3943} + Tango.PMR + {d8f1ad85-526a-4f50-b6dc-d437af63d8d8} Tango.Settings @@ -111,6 +143,14 @@ {8491d07b-c1f6-4b62-a412-41b9fd2d6538} Tango.SharedUI + + {74e700b0-1156-4126-be40-ee450d3c3026} + Tango.Transport + + + {834c81c3-09b5-45d7-be12-e7d1e6655a7c} + Tango.FSE.BL + {bc37cccb-7392-4f78-8d1c-e9629e6e046e} Tango.FSE.Common @@ -122,5 +162,15 @@ MSBuild:Compile + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + \ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/ViewModels/MainViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/ViewModels/MainViewVM.cs index 6e2e888a0..da3d79b67 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/ViewModels/MainViewVM.cs @@ -1,9 +1,12 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.FSE.Common; +using Tango.FSE.Common.Navigation; +using Tango.SharedUI.Helpers; namespace Tango.FSE.Diagnostics.ViewModels { @@ -11,7 +14,19 @@ namespace Tango.FSE.Diagnostics.ViewModels { public override void OnApplicationStarted() { - + InvokeUI(() => + { + NavigationManager.MenuItems.Add(new NavigationMenuItem(() => + { + Debug.WriteLine("Pressed"); + }) + { + Name = "Diagnostics", + Index = 1, + Description = "Examine the machine", + Image = ResourceHelper.GetImageFromResources("Images/diagnostics.png"), + }); + }); } } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/packages.config b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/packages.config index 08b9dd27c..dd8c723e4 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/packages.config +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/packages.config @@ -1,5 +1,10 @@  + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Navigation/INavigationManager.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Navigation/INavigationManager.cs index 0939516d6..f22a2f931 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Navigation/INavigationManager.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Navigation/INavigationManager.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -12,6 +13,11 @@ namespace Tango.FSE.Common.Navigation /// public interface INavigationManager { + /// + /// Gets the menu items. + /// + ObservableCollection MenuItems { get; } + /// /// Gets the current module. /// diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Navigation/NavigationMenuItem.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Navigation/NavigationMenuItem.cs new file mode 100644 index 000000000..2f72f8771 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Navigation/NavigationMenuItem.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; +using Tango.Core; +using Tango.Core.Commands; + +namespace Tango.FSE.Common.Navigation +{ + public class NavigationMenuItem : ExtendedObject + { + private Action _pressAction; + + public String Name { get; set; } + + public String Description { get; set; } + + public BitmapSource Image { get; set; } + + public bool IsVisible { get; set; } + + public bool IsEnabled { get; set; } + + public RelayCommand PressCommand { get; set; } + + public int Index { get; set; } + + public NavigationMenuItem(Action pressAction) + { + IsVisible = true; + IsEnabled = true; + + _pressAction = pressAction; + + PressCommand = new RelayCommand(() => + { + _pressAction?.Invoke(); + }); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj index a1f3e3678..c08685a46 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj @@ -99,6 +99,7 @@ + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Menu/account.png b/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Menu/account.png new file mode 100644 index 000000000..0f0dae3cb Binary files /dev/null and b/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Menu/account.png differ diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Menu/settings.png b/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Menu/settings.png new file mode 100644 index 000000000..a9d0314d1 Binary files /dev/null and b/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Menu/settings.png differ diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Navigation/DefaultNavigationManager.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Navigation/DefaultNavigationManager.cs index dab12fdb7..845049f54 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Navigation/DefaultNavigationManager.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Navigation/DefaultNavigationManager.cs @@ -1,11 +1,14 @@ using System; using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; using System.Windows; +using System.Windows.Data; using System.Windows.Media; using Tango.Core; using Tango.Core.Commands; @@ -45,6 +48,11 @@ namespace Tango.FSE.UI.Navigation private Stack _navigationHistory; + /// + /// Gets the menu items. + /// + public ObservableCollection MenuItems { get; private set; } + /// /// Gets the current view model. /// @@ -80,6 +88,12 @@ namespace Tango.FSE.UI.Navigation public DefaultNavigationManager(IFSEModuleLoader moduleLoader, IDispatcherProvider dispatcherProvider, INotificationProvider notificationProvider) { IsBackEnabled = true; + + MenuItems = new ObservableCollection(); + MenuItems.EnableCrossThreadOperations(); + ICollectionView collection = CollectionViewSource.GetDefaultView(MenuItems); + collection.SortDescriptions.Add(new SortDescription("Index", ListSortDirection.Ascending)); + _awaitingVMResults = new List(); _navigationHistory = new Stack(); _moduleLoader = moduleLoader; diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj index fc27d51e6..31205b520 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj @@ -358,6 +358,10 @@ + + + + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs index feeaabaa6..98710e23a 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs @@ -6,9 +6,11 @@ using System.Text; using System.Threading.Tasks; using Tango.Core.Commands; using Tango.FSE.Common; +using Tango.FSE.Common.Navigation; using Tango.FSE.Common.Notifications; using Tango.FSE.UI.Panes; using Tango.Integration.ExternalBridge; +using Tango.SharedUI.Helpers; namespace Tango.FSE.UI.ViewModels { @@ -93,6 +95,28 @@ namespace Tango.FSE.UI.ViewModels public override void OnApplicationStarted() { DiagnosticsProvider.FrameReceived += DiagnosticsProvider_FrameReceived; + + NavigationManager.MenuItems.Add(new NavigationMenuItem(() => + { + Debug.WriteLine("Pressed"); + }) + { + Name = "Account", + Index = -1, + Description = "Examine the machine", + Image = ResourceHelper.GetImageFromResources("Images/Menu/account.png"), + }); + + NavigationManager.MenuItems.Add(new NavigationMenuItem(() => + { + Debug.WriteLine("Pressed"); + }) + { + Name = "Settings", + Index = 2, + Description = "Examine the machine", + Image = ResourceHelper.GetImageFromResources("Images/Menu/settings.png"), + }); } private void DiagnosticsProvider_FrameReceived(object sender, Common.Diagnostics.DiagnosticsFrameReceivedEventArgs e) diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/MainViewVM.cs index 4d88a8967..5c333ac81 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/MainViewVM.cs @@ -9,8 +9,6 @@ namespace Tango.FSE.UI.ViewModels { public class MainViewVM : FSEViewModel { - public String Text { get; set; } = "This is a simple text binding"; - public override void OnApplicationStarted() { diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml index f35505519..3d78479e3 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml @@ -108,7 +108,7 @@ - + @@ -284,7 +284,7 @@ - + @@ -304,7 +304,35 @@ - + + + + + @@ -318,8 +346,124 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml.cs index 2ec734c71..f25e85e0c 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml.cs @@ -50,9 +50,8 @@ namespace Tango.FSE.UI.Views private void GridMenu_MouseEnter(object sender, MouseEventArgs e) { _vm.IsMenuOpened = true; - - StartPointAnimation(polyTopRight, new Point(200, 0)); - StartPointAnimation(polyBottomRight, new Point(200, 400)); + StartPointAnimation(polyTopRight, new Point(300, 0)); + StartPointAnimation(polyBottomRight, new Point(300, 400)); } private void StartPointAnimation(LineSegment segment, Point to) -- cgit v1.3.1