From 529d8938db258e7162b7776a5b5180a9675a7f70 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 12 Nov 2018 17:24:59 +0200 Subject: Some improvements to PPC. --- .../PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs | 1 + .../PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs | 35 ++++++++++++++++++++++ 2 files changed, 36 insertions(+) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs index fd36d0d13..7ac7db47d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Threading; using Tango.Core.Commands; using Tango.Core.DI; using Tango.Integration.Operation; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs index e207c30b3..b01be3734 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Threading; using Tango.Core.DI; using Tango.Integration.ExternalBridge; using Tango.PPC.Common; @@ -22,11 +23,45 @@ namespace Tango.PPC.UI.ViewModels /// public class MainViewVM : PPCViewModel { + private DispatcherTimer _date_timer; + + private DateTime _currentDateTime; + /// + /// Gets or sets the current date time. + /// + public DateTime CurrentDateTime + { + get { return _currentDateTime; } + set { _currentDateTime = value; RaisePropertyChangedAuto(); } + } + + public MainViewVM() + { + _date_timer = new DispatcherTimer(); + _date_timer.Interval = TimeSpan.FromSeconds(1); + _date_timer.Tick += _date_timer_Tick; + _date_timer.Start(); + } + /// /// Called when the application has been started. /// public override void OnApplicationStarted() { } + + #region Event Handlers + + /// + /// Handles the Tick event of the _date_timer. + /// + /// The source of the event. + /// The instance containing the event data. + private void _date_timer_Tick(object sender, EventArgs e) + { + CurrentDateTime = DateTime.Now; + } + + #endregion } } -- cgit v1.3.1 From a9c3aaed4d5c007f138bfc16f05aecdee73f1268 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 21 Nov 2018 16:24:37 +0200 Subject: Working on PPC Storage Provider !!! --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 15400960 -> 15400960 bytes Software/Graphics/Mobile/flash-drive.png | Bin 0 -> 1377 bytes .../Tango.PPC.Common/Navigation/NavigationView.cs | 1 + .../PPC/Tango.PPC.Common/PPCViewModel.cs | 7 ++ .../Storage/DefaultStorageProvider.cs | 111 +++++++++++++++++++++ .../Tango.PPC.Common/Storage/IStorageProvider.cs | 35 +++++++ .../PPC/Tango.PPC.Common/Tango.PPC.Common.csproj | 4 +- .../PPC/Tango.PPC.UI/Images/flash-drive.png | Bin 0 -> 1377 bytes .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 15 ++- .../PPC/Tango.PPC.UI/ViewModelLocator.cs | 12 +++ .../PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs | 12 +++ .../PPC/Tango.PPC.UI/ViewModels/StorageViewVM.cs | 97 ++++++++++++++++++ .../PPC/Tango.PPC.UI/Views/LayoutView.xaml | 24 +++-- .../PPC/Tango.PPC.UI/Views/MainView.xaml | 13 +++ .../PPC/Tango.PPC.UI/Views/StorageView.xaml | 33 ++++++ .../PPC/Tango.PPC.UI/Views/StorageView.xaml.cs | 28 ++++++ .../Tango.Explorer/ExplorerControl.cs | 23 ++++- 18 files changed, 403 insertions(+), 12 deletions(-) create mode 100644 Software/Graphics/Mobile/flash-drive.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/DefaultStorageProvider.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/IStorageProvider.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/flash-drive.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/StorageViewVM.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Views/StorageView.xaml create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Views/StorageView.xaml.cs (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 775d76141..7a6f9c9b5 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index 2907879e7..d6d01a0ab 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Graphics/Mobile/flash-drive.png b/Software/Graphics/Mobile/flash-drive.png new file mode 100644 index 000000000..252e42e38 Binary files /dev/null and b/Software/Graphics/Mobile/flash-drive.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Navigation/NavigationView.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Navigation/NavigationView.cs index ef8f1c2ad..c86cf148b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Navigation/NavigationView.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Navigation/NavigationView.cs @@ -17,6 +17,7 @@ namespace Tango.PPC.Common.Navigation MachineSetupView, MachineUpdateView, ExternalBridgeView, + StorageView, HomeModule, ShutdownView, } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs index fdcaa9830..3393689d1 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs @@ -13,6 +13,7 @@ using Tango.PPC.Common.ExternalBridge; using Tango.PPC.Common.Navigation; using Tango.PPC.Common.Notifications; using Tango.PPC.Common.Printing; +using Tango.PPC.Common.Storage; using Tango.Settings; using Tango.SharedUI; using static Tango.SharedUI.Controls.NavigationControl; @@ -81,6 +82,12 @@ namespace Tango.PPC.Common [TangoInject] public IConnectivityProvider ConnectivityProvider { get; set; } + /// + /// Gets or sets the storage provider. + /// + [TangoInject] + public IStorageProvider StorageProvider { get; set; } + private PPCSettings _settings; /// diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/DefaultStorageProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/DefaultStorageProvider.cs new file mode 100644 index 000000000..5714f5dfb --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/DefaultStorageProvider.cs @@ -0,0 +1,111 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Tango.Core; +using Tango.Core.DI; +using Tango.PPC.Common.Application; +using Tango.PPC.Common.Threading; + +namespace Tango.PPC.Common.Storage +{ + /// + /// Represents the default . + /// + /// + /// + public class DefaultStorageProvider : ExtendedObject, IStorageProvider + { + private Thread _scanThread; + + /// + /// Occurs when a new storage drive has been inserted. + /// + public event EventHandler StorageConnected; + + /// + /// Occurs when a storage drive has been removed. + /// + public event EventHandler StorageDisconnected; + + private bool _isConnected; + /// + /// Gets a value indicating whether a storage drive is currently inserted. + /// + public bool IsConnected + { + get { return _isConnected; } + set { _isConnected = value; RaisePropertyChangedAuto(); } + } + + private DriveInfo _drive; + /// + /// Gets the inserted storage drive information. + /// + public DriveInfo Drive + { + get { return _drive; } + set { _drive = value; RaisePropertyChangedAuto(); } + } + + /// + /// Initializes a new instance of the class. + /// + public DefaultStorageProvider(IPPCApplicationManager applicationManager) + { + var drives = DriveInfo.GetDrives().Where(x => x.DriveType == DriveType.Removable).ToList(); + + if (drives.Count > 0) + { + IsConnected = true; + Drive = drives.FirstOrDefault(); + } + + applicationManager.ApplicationReady += ApplicationManager_ApplicationReady; + } + + /// + /// Handles the ApplicationReady event of the ApplicationManager. + /// + /// The source of the event. + /// The instance containing the event data. + private void ApplicationManager_ApplicationReady(object sender, EventArgs e) + { + Initialize(); + } + + private void Initialize() + { + _scanThread = new Thread(ScanThreadMethod); + _scanThread.IsBackground = true; + _scanThread.Start(); + } + + private void ScanThreadMethod() + { + while (true) + { + var drives = DriveInfo.GetDrives().Where(x => x.DriveType == DriveType.Removable).ToList(); + + if (IsConnected && !drives.Exists(x => x.RootDirectory.FullName == Drive.RootDirectory.FullName)) + { + StorageDisconnected?.Invoke(this, Drive); + Drive = null; + IsConnected = false; + } + + if (!IsConnected && drives.Count > 0) + { + Drive = drives.FirstOrDefault(); + IsConnected = true; + StorageConnected?.Invoke(this, Drive); + } + + Thread.Sleep(5000); + } + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/IStorageProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/IStorageProvider.cs new file mode 100644 index 000000000..164cdfe0a --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/IStorageProvider.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Common.Storage +{ + /// + /// Represents a storage provider responsible of notifying about flash drives connection/disconnection. + /// + public interface IStorageProvider + { + /// + /// Occurs when a new storage drive has been inserted. + /// + event EventHandler StorageConnected; + + /// + /// Occurs when a storage drive has been removed. + /// + event EventHandler StorageDisconnected; + + /// + /// Gets a value indicating whether a storage drive is currently inserted. + /// + bool IsConnected { get; } + + /// + /// Gets the inserted storage drive information. + /// + DriveInfo Drive { get; } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj index fbb0a048b..eb90bfd77 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj @@ -153,6 +153,8 @@ + + @@ -314,7 +316,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/flash-drive.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/flash-drive.png new file mode 100644 index 000000000..252e42e38 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/flash-drive.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj index 5e5d5aac2..466ff0587 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj @@ -135,6 +135,7 @@ + @@ -159,6 +160,9 @@ MachineUpdateView.xaml + + StorageView.xaml + Designer MSBuild:Compile @@ -215,6 +219,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + @@ -263,6 +271,10 @@ {b112d89a-a106-41ae-a0c1-4abc84c477f5} Tango.DragAndDrop + + {4399af76-db52-4cfb-8020-6f85bdb29fd5} + Tango.Explorer + {4206ac58-3b57-4699-8835-90bf6db01a61} Tango.Integration @@ -365,6 +377,7 @@ Tango.ColorLib.dll PreserveNewest + @@ -432,7 +445,7 @@ copy /Y "$(SolutionDir)Referenced Assemblies\vcruntime140d.dll" "$(TargetDir)" - + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs index 57fae7791..47f4409f5 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs @@ -16,6 +16,7 @@ using Tango.PPC.Common.Modules; using Tango.PPC.Common.Navigation; using Tango.PPC.Common.Notifications; using Tango.PPC.Common.Printing; +using Tango.PPC.Common.Storage; using Tango.PPC.Common.Threading; using Tango.PPC.UI.Authentication; using Tango.PPC.UI.Connectivity; @@ -59,6 +60,7 @@ namespace Tango.PPC.UI TangoIOC.Default.Unregister(); TangoIOC.Default.Unregister(); TangoIOC.Default.Unregister(); + TangoIOC.Default.Unregister(); TangoIOC.Default.Register(new DefaultDispatcherProvider(Application.Current.Dispatcher)); TangoIOC.Default.Register(); @@ -75,6 +77,7 @@ namespace Tango.PPC.UI TangoIOC.Default.Register(); TangoIOC.Default.Register(); TangoIOC.Default.Register(); + TangoIOC.Default.Register(); //TangoIOC.Default.Register(new TeamFoundationServiceExtendedClient("https://twinetfs.visualstudio.com", String.Empty, "szzfokrceo4rhd4eqi5qpmxn3pa5iwl3q7tlqd36l2m7smz2ynoa")); @@ -85,6 +88,7 @@ namespace Tango.PPC.UI TangoIOC.Default.Register(); TangoIOC.Default.Register(); TangoIOC.Default.Register(); + TangoIOC.Default.Register(); TangoIOC.Default.GetInstance().ContentRendered += (_, __) => @@ -158,5 +162,13 @@ namespace Tango.PPC.UI return TangoIOC.Default.GetInstance(); } } + + public static StorageViewVM StorageViewVM + { + get + { + return TangoIOC.Default.GetInstance(); + } + } } } \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs index 7ac7db47d..76eda9ac0 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -89,6 +89,11 @@ namespace Tango.PPC.UI.ViewModels /// Gets or sets the update command. /// public RelayCommand UpdateCommand { get; set; } + + /// + /// Gets or sets the storage command. + /// + public RelayCommand StorageCommand { get; set; } #endregion #region Constructors @@ -109,6 +114,13 @@ namespace Tango.PPC.UI.ViewModels { NavigationManager.NavigateTo(NavigationView.MachineUpdateView); TangoIOC.Default.GetInstance().CheckForUpdates(); + IsMenuOpened = false; + }); + + StorageCommand = new RelayCommand(() => + { + NavigationManager.NavigateTo(NavigationView.StorageView); + IsMenuOpened = false; }); } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/StorageViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/StorageViewVM.cs new file mode 100644 index 000000000..5b5167393 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/StorageViewVM.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.Explorer; +using Tango.PPC.Common; + +namespace Tango.PPC.UI.ViewModels +{ + public class StorageViewVM : PPCViewModel + { + private String _currentPath; + public String CurrentPath + { + get { return _currentPath; } + set { _currentPath = value; RaisePropertyChangedAuto(); } + } + + public RelayCommand CloseCommand { get; set; } + + public RelayCommand FileSelectedCommand { get; set; } + + public StorageViewVM() + { + CloseCommand = new RelayCommand(Close); + FileSelectedCommand = new RelayCommand(OnFileSelected); + } + + public override void OnApplicationStarted() + { + + } + + public override void OnApplicationReady() + { + base.OnApplicationReady(); + + StorageProvider.StorageConnected += StorageProvider_StorageConnected; + StorageProvider.StorageDisconnected += StorageProvider_StorageDisconnected; + } + + public override void OnNavigatedTo() + { + base.OnNavigatedTo(); + + if (StorageProvider.Drive != null) + { + CurrentPath = StorageProvider.Drive.RootDirectory.FullName; + } + } + + private async void Close() + { + await NavigationManager.NavigateTo(Common.Navigation.NavigationView.LayoutView); + } + + /// + /// Handles the storage connected event. + /// + /// The sender. + /// The drive info. + private void StorageProvider_StorageConnected(object sender, System.IO.DriveInfo e) + { + InvokeUI(async () => + { + if (await NotificationProvider.ShowQuestion("Disk Inserted. Do you want to browse?")) + { + await NavigationManager.NavigateTo(Common.Navigation.NavigationView.StorageView); + } + }); + } + + /// + /// Handles the storage disconnected event. + /// + /// The sender. + /// The drive info. + private void StorageProvider_StorageDisconnected(object sender, System.IO.DriveInfo e) + { + InvokeUI(async () => + { + if (IsVisible) + { + await NavigationManager.NavigateTo(Common.Navigation.NavigationView.LayoutView); + } + }); + } + + private async void OnFileSelected(ExplorerFileItem fileItem) + { + await NavigationManager.NavigateTo(Common.Navigation.NavigationView.LayoutView); + await NotificationProvider.ShowInfo($"File Selected: {fileItem.Name}"); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml index 2db5f12b6..44a66d7f0 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml @@ -62,12 +62,24 @@ - - - - Update - - + + + + + + Storage + + + + + + + + + Update + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml index 4c3d38811..690022e64 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml @@ -57,6 +57,18 @@ + + + + + @@ -69,6 +81,7 @@ + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/StorageView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/StorageView.xaml new file mode 100644 index 000000000..aa7bdcf7d --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/StorageView.xaml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/StorageView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/StorageView.xaml.cs new file mode 100644 index 000000000..d558d08bf --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/StorageView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.PPC.UI.Views +{ + /// + /// Interaction logic for StorageView.xaml + /// + public partial class StorageView : UserControl + { + public StorageView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/Tango.Explorer/ExplorerControl.cs b/Software/Visual_Studio/Tango.Explorer/ExplorerControl.cs index 6f276f184..0c713a7db 100644 --- a/Software/Visual_Studio/Tango.Explorer/ExplorerControl.cs +++ b/Software/Visual_Studio/Tango.Explorer/ExplorerControl.cs @@ -53,6 +53,14 @@ namespace Tango.Explorer public static readonly DependencyProperty BackCommandProperty = DependencyProperty.Register("BackCommand", typeof(RelayCommand), typeof(ExplorerControl), new PropertyMetadata(null)); + public RelayCommand FileSelectedCommand + { + get { return (RelayCommand)GetValue(FileSelectedCommandProperty); } + set { SetValue(FileSelectedCommandProperty, value); } + } + public static readonly DependencyProperty FileSelectedCommandProperty = + DependencyProperty.Register("FileSelectedCommand", typeof(RelayCommand), typeof(ExplorerControl), new PropertyMetadata(null)); + static ExplorerControl() { DefaultStyleKeyProperty.OverrideMetadata(typeof(ExplorerControl), new FrameworkPropertyMetadata(typeof(ExplorerControl))); @@ -99,16 +107,23 @@ namespace Tango.Explorer CurrentFolder = folder; SelectedItem = null; } + else if (SelectedItem is ExplorerFileItem) + { + FileSelectedCommand?.Execute(SelectedItem); + } } } private void NavigateBack() { - var parentPath = CurrentFolder.GetParentPath(); - - if (parentPath != null) + if (CurrentFolder != null) { - CurrentFolder = ExplorerFolderItem.LoadFromPath(parentPath); + var parentPath = CurrentFolder.GetParentPath(); + + if (parentPath != null) + { + CurrentFolder = ExplorerFolderItem.LoadFromPath(parentPath); + } } } } -- cgit v1.3.1 From c02a988bda6724dcbd1d689be2010ce55de59368 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sun, 25 Nov 2018 08:51:51 +0200 Subject: Storage Module! --- .../Notes/Tango.Notes/PPC/Virtual Flash Drive.txt | 5 + .../Notes/Tango.Notes/Tango.Notes.csproj | 3 +- .../Tango.PPC.Jobs/Properties/AssemblyInfo.cs | 2 +- .../Properties/AssemblyInfo.cs | 2 +- .../PPC/Modules/Tango.PPC.Storage/App.xaml | 11 ++ .../Tango.PPC.Storage/Images/storage-module.png | Bin 0 -> 1377 bytes .../Tango.PPC.Storage/Properties/AssemblyInfo.cs | 20 +++ .../Properties/Resources.Designer.cs | 62 ++++++++++ .../Tango.PPC.Storage/Properties/Resources.resx | 117 ++++++++++++++++++ .../Properties/Settings.Designer.cs | 30 +++++ .../Tango.PPC.Storage/Properties/Settings.settings | 7 ++ .../PPC/Modules/Tango.PPC.Storage/StorageModule.cs | 84 +++++++++++++ .../Tango.PPC.Storage/Tango.PPC.Storage.csproj | 130 ++++++++++++++++++++ .../TaskBarItems/StorageTaskBarItem.cs | 24 ++++ .../TaskBarItems/StorageTaskBarItemView.xaml | 24 ++++ .../TaskBarItems/StorageTaskBarItemView.xaml.cs | 28 +++++ .../Tango.PPC.Storage/ViewContracts/IMainView.cs | 15 +++ .../Modules/Tango.PPC.Storage/ViewModelLocator.cs | 32 +++++ .../Tango.PPC.Storage/ViewModels/MainViewVM.cs | 135 +++++++++++++++++++++ .../Modules/Tango.PPC.Storage/Views/MainView.xaml | 18 +++ .../Tango.PPC.Storage/Views/MainView.xaml.cs | 37 ++++++ .../Notifications/INotificationProvider.cs | 25 ++++ .../Tango.PPC.Common/Notifications/TaskBarItem.cs | 13 ++ .../Storage/DefaultStorageProvider.cs | 48 +++++++- .../Tango.PPC.Common/Storage/IStorageProvider.cs | 20 +++ .../PPC/Tango.PPC.Common/Tango.PPC.Common.csproj | 7 +- .../Tango.PPC.UI/Converters/ItemBaseConverter.cs | 41 +++++++ .../Converters/NotificationItemConverter.cs | 41 ------- .../Notifications/DefaultNotificationProvider.cs | 36 ++++++ .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 16 +-- .../PPC/Tango.PPC.UI/ViewModelLocator.cs | 9 -- .../PPC/Tango.PPC.UI/ViewModels/StorageViewVM.cs | 97 --------------- .../PPC/Tango.PPC.UI/Views/LayoutView.xaml | 11 +- .../PPC/Tango.PPC.UI/Views/MainView.xaml | 30 ++--- .../PPC/Tango.PPC.UI/Views/StorageView.xaml | 33 ----- .../PPC/Tango.PPC.UI/Views/StorageView.xaml.cs | 28 ----- .../Tango.BL/EntitiesExtensions/LiquidTypesRml.cs | 4 + .../Tango.Explorer/ExplorerControl.cs | 2 +- Software/Visual_Studio/Tango.sln | 55 ++++++++- 39 files changed, 1047 insertions(+), 255 deletions(-) create mode 100644 Software/Visual_Studio/Notes/Tango.Notes/PPC/Virtual Flash Drive.txt create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/App.xaml create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Images/storage-module.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Properties/AssemblyInfo.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Properties/Resources.Designer.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Properties/Resources.resx create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Properties/Settings.Designer.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Properties/Settings.settings create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/StorageModule.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Tango.PPC.Storage.csproj create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/TaskBarItems/StorageTaskBarItem.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/TaskBarItems/StorageTaskBarItemView.xaml create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/TaskBarItems/StorageTaskBarItemView.xaml.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewContracts/IMainView.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModelLocator.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/TaskBarItem.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ItemBaseConverter.cs delete mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/NotificationItemConverter.cs delete mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/StorageViewVM.cs delete mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Views/StorageView.xaml delete mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Views/StorageView.xaml.cs (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels') diff --git a/Software/Visual_Studio/Notes/Tango.Notes/PPC/Virtual Flash Drive.txt b/Software/Visual_Studio/Notes/Tango.Notes/PPC/Virtual Flash Drive.txt new file mode 100644 index 000000000..2f92bf6f0 --- /dev/null +++ b/Software/Visual_Studio/Notes/Tango.Notes/PPC/Virtual Flash Drive.txt @@ -0,0 +1,5 @@ +#Create Virtual Removable Drive +imdisk -a -s 10M -m R: -o rem -p "/fs:ntfs /q /y" + +#Remove Virtual Drive +imdisk -D -m R: \ No newline at end of file diff --git a/Software/Visual_Studio/Notes/Tango.Notes/Tango.Notes.csproj b/Software/Visual_Studio/Notes/Tango.Notes/Tango.Notes.csproj index 66f30b1a4..e21ec34aa 100644 --- a/Software/Visual_Studio/Notes/Tango.Notes/Tango.Notes.csproj +++ b/Software/Visual_Studio/Notes/Tango.Notes/Tango.Notes.csproj @@ -45,6 +45,7 @@ + @@ -52,7 +53,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/AssemblyInfo.cs index 657d58fa3..095f10d3b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/AssemblyInfo.cs @@ -7,7 +7,7 @@ using System.Windows; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Tango Panel PC Jobs Module")] +[assembly: AssemblyTitle("Tango PPC Jobs Module")] [assembly: AssemblyVersion("2.0.7.1119")] [assembly:ThemeInfo( diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Properties/AssemblyInfo.cs index 8e6777b64..d07b99ec8 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Properties/AssemblyInfo.cs @@ -7,7 +7,7 @@ using System.Windows; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Tango Module")] +[assembly: AssemblyTitle("Tango PPC Settings Module")] [assembly: AssemblyVersion("2.0.4.1119")] [assembly: ThemeInfo( diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/App.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/App.xaml new file mode 100644 index 000000000..3a30cbc37 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/App.xaml @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Images/storage-module.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Images/storage-module.png new file mode 100644 index 000000000..252e42e38 Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Images/storage-module.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..201341ef7 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Properties/AssemblyInfo.cs @@ -0,0 +1,20 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Tango PPC Storage Module")] +[assembly: AssemblyVersion("2.0.2.1119")] + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Properties/Resources.Designer.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Properties/Resources.Designer.cs new file mode 100644 index 000000000..8d882d6ad --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Properties/Resources.Designer.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.PPC.Storage.Properties { + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if ((resourceMan == null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.PPC.Storage.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Properties/Resources.resx b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Properties/Settings.Designer.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Properties/Settings.Designer.cs new file mode 100644 index 000000000..8e95a1b27 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.PPC.Storage.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Properties/Settings.settings b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/StorageModule.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/StorageModule.cs new file mode 100644 index 000000000..a589e35bd --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/StorageModule.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; +using Tango.BL.Enumerations; +using Tango.PPC.Common; +using Tango.PPC.Storage.Views; +using Tango.SharedUI.Helpers; + +namespace Tango.PPC.Storage +{ + /// + /// Represents a PPC . + /// + /// + [PPCModule(3)] + public class StorageModule : PPCModuleBase + { + /// + /// Gets the module name. + /// + public override string Name + { + get + { + return "Storage"; + } + } + + /// + /// Gets the module description. + /// + public override string Description + { + get + { + return "Tango PPC Removable Drive Storage Module."; + } + } + + /// + /// Gets the module cover image. + /// + public override BitmapSource Image + { + get + { + return ResourceHelper.GetImageFromResources("Images/storage-module.png"); + } + } + + /// + /// Gets the module entry point view type. + /// + public override Type MainViewType + { + get + { + return typeof(MainView); + } + } + + /// + /// Gets the permission required to see and load this module. + /// + public override Permissions Permission + { + get + { + return Permissions.RunMachineStudio; + } + } + + /// + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// + public override void Dispose() + { + //Dispose module here... + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Tango.PPC.Storage.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Tango.PPC.Storage.csproj new file mode 100644 index 000000000..b6a2c885b --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Tango.PPC.Storage.csproj @@ -0,0 +1,130 @@ + + + + + Debug + AnyCPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE} + library + Tango.PPC.Storage + Tango.PPC.Storage + v4.6.1 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + true + full + false + ..\..\..\Build\PPC\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\..\Build\PPC\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + 4.0 + + + + + + + + GlobalVersionInfo.cs + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + StorageTaskBarItemView.xaml + + + + + + MainView.xaml + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + {f441feee-322a-4943-b566-110e12fd3b72} + Tango.BL + + + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} + Tango.Core + + + {4399af76-db52-4cfb-8020-6f85bdb29fd5} + Tango.Explorer + + + {8491d07b-c1f6-4b62-a412-41b9fd2d6538} + Tango.SharedUI + + + {fd86424c-6e84-491b-8df9-3d0f5c236a2a} + Tango.Touch + + + {0be74eee-22cb-4dba-b896-793b9e1a3ac0} + Tango.PPC.Common + + + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/TaskBarItems/StorageTaskBarItem.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/TaskBarItems/StorageTaskBarItem.cs new file mode 100644 index 000000000..a77d47713 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/TaskBarItems/StorageTaskBarItem.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.DI; +using Tango.PPC.Common.Notifications; +using Tango.PPC.Common.Storage; + +namespace Tango.PPC.Storage.TaskBarItems +{ + public class StorageTaskBarItem : TaskBarItem + { + public override Type ViewType => typeof(StorageTaskBarItemView); + + [TangoInject] + public IStorageProvider StorageProvider { get; set; } + + public StorageTaskBarItem() + { + TangoIOC.Default.Inject(this); + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/TaskBarItems/StorageTaskBarItemView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/TaskBarItems/StorageTaskBarItemView.xaml new file mode 100644 index 000000000..dc63949a0 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/TaskBarItems/StorageTaskBarItemView.xaml @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/TaskBarItems/StorageTaskBarItemView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/TaskBarItems/StorageTaskBarItemView.xaml.cs new file mode 100644 index 000000000..f66cf4465 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/TaskBarItems/StorageTaskBarItemView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.PPC.Storage.TaskBarItems +{ + /// + /// Interaction logic for StorageTaskBarItem.xaml + /// + public partial class StorageTaskBarItemView : UserControl + { + public StorageTaskBarItemView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewContracts/IMainView.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewContracts/IMainView.cs new file mode 100644 index 000000000..8c08f5a28 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewContracts/IMainView.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.PPC.Common; +using Tango.SharedUI; + +namespace Tango.PPC.Storage.ViewContracts +{ + public interface IMainView : IPPCView + { + void NavigateBack(); + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModelLocator.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModelLocator.cs new file mode 100644 index 000000000..8634b8179 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModelLocator.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.DI; +using Tango.PPC.Storage.ViewModels; + +namespace Tango.PPC.Storage +{ + public static class ViewModelLocator + { + /// + /// Initializes a new instance of the ViewModelLocator class. + /// + static ViewModelLocator() + { + TangoIOC.Default.Register(); + } + + /// + /// Gets the main view VM. + /// + public static MainViewVM MainViewVM + { + get + { + return TangoIOC.Default.GetInstance(); + } + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs new file mode 100644 index 000000000..cb48958dd --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs @@ -0,0 +1,135 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.Explorer; +using Tango.PPC.Common; +using Tango.PPC.Common.Navigation; +using Tango.PPC.Storage.TaskBarItems; +using Tango.PPC.Storage.ViewContracts; + +namespace Tango.PPC.Storage.ViewModels +{ + /// + /// Represents the main view VM and entry point for . + /// + /// + public class MainViewVM : PPCViewModel, INavigationResultProvider + { + private bool _allow_exit; + private ExplorerFileItem _selectedItem; + + private String _currentPath; + public String CurrentPath + { + get { return _currentPath; } + set { _currentPath = value; RaisePropertyChangedAuto(); } + } + + public RelayCommand CloseCommand { get; set; } + + public RelayCommand FileSelectedCommand { get; set; } + + public MainViewVM() + { + CloseCommand = new RelayCommand(Close); + FileSelectedCommand = new RelayCommand(OnFileSelected); + } + + public override void OnApplicationStarted() + { + + } + + public override void OnApplicationReady() + { + base.OnApplicationReady(); + + NotificationProvider.PushTaskBarItem(); + StorageProvider.StorageConnected += StorageProvider_StorageConnected; + StorageProvider.StorageDisconnected += StorageProvider_StorageDisconnected; + } + + public override void OnNavigatedTo() + { + base.OnNavigatedTo(); + + _allow_exit = false; + _selectedItem = null; + + if (StorageProvider.Drive != null) + { + CurrentPath = StorageProvider.Drive.RootDirectory.FullName; + } + } + + private async void Close() + { + await NavigationManager.NavigateBack(); + } + + /// + /// Handles the storage connected event. + /// + /// The sender. + /// The drive info. + private void StorageProvider_StorageConnected(object sender, System.IO.DriveInfo e) + { + InvokeUI(async () => + { + if (await NotificationProvider.ShowQuestion("Disk Inserted. Do you want to browse?")) + { + await NavigationManager.NavigateTo(Common.Navigation.NavigationView.StorageView); + } + }); + } + + /// + /// Handles the storage disconnected event. + /// + /// The sender. + /// The drive info. + private void StorageProvider_StorageDisconnected(object sender, System.IO.DriveInfo e) + { + InvokeUI(async () => + { + if (IsVisible) + { + await NavigationManager.NavigateBack(); + } + }); + } + + public override Task OnNavigateBackRequest() + { + if (CurrentPath == StorageProvider.Drive.RootDirectory.FullName || _allow_exit) + { + return Task.FromResult(true); + } + else + { + View.NavigateBack(); + return Task.FromResult(false); + } + } + + private async void OnFileSelected(ExplorerFileItem fileItem) + { + _allow_exit = true; + await NavigationManager.NavigateBack(); + await NotificationProvider.ShowInfo($"File Selected: {fileItem.Name}"); + } + + public ExplorerFileItem GetNavigationResult() + { + return _selectedItem; + } + + public void OnNavigationObjectReceived(string extension) + { + + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml new file mode 100644 index 000000000..2fea4ce20 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml.cs new file mode 100644 index 000000000..f77eaa401 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.Core.DI; +using Tango.PPC.Storage.ViewContracts; + +namespace Tango.PPC.Storage.Views +{ + /// + /// Interaction logic for MainView.xaml + /// + public partial class MainView : UserControl, IMainView + { + public MainView() + { + InitializeComponent(); + + TangoIOC.Default.Register(this); + } + + public void NavigateBack() + { + explorer.NavigateBack(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs index 39cf2879f..dc693e305 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs @@ -22,6 +22,11 @@ namespace Tango.PPC.Common.Notifications /// ObservableCollection NotificationItems { get; } + /// + /// Gets the collection of taskbar items. + /// + ObservableCollection TaskBarItems { get; } + /// /// Gets the current application bar item. /// @@ -167,5 +172,25 @@ namespace Tango.PPC.Common.Notifications /// /// The application bar item. void PopAppBarItem(AppBarItem appBarItem); + + /// + /// Pushes the task bar item. + /// + /// The task bar item. + /// + TaskBarItem PushTaskBarItem(TaskBarItem taskBarItem); + + /// + /// Handles the Push Task Bar Item event. + /// + /// + /// + TaskBarItem PushTaskBarItem() where T : TaskBarItem; + + /// + /// Pops the task bar item. + /// + /// The task bar item. + void PopTaskBarItem(TaskBarItem taskBarItem); } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/TaskBarItem.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/TaskBarItem.cs new file mode 100644 index 000000000..2d6a90317 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/TaskBarItem.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Common.Notifications +{ + public abstract class TaskBarItem : ItemBase + { + + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/DefaultStorageProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/DefaultStorageProvider.cs index 5714f5dfb..46315e4b8 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/DefaultStorageProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/DefaultStorageProvider.cs @@ -7,6 +7,7 @@ using System.Threading; using System.Threading.Tasks; using Tango.Core; using Tango.Core.DI; +using Tango.Explorer; using Tango.PPC.Common.Application; using Tango.PPC.Common.Threading; @@ -20,6 +21,7 @@ namespace Tango.PPC.Common.Storage public class DefaultStorageProvider : ExtendedObject, IStorageProvider { private Thread _scanThread; + private Dictionary> _fileHandlers; /// /// Occurs when a new storage drive has been inserted. @@ -56,8 +58,9 @@ namespace Tango.PPC.Common.Storage /// public DefaultStorageProvider(IPPCApplicationManager applicationManager) { + _fileHandlers = new Dictionary>(); var drives = DriveInfo.GetDrives().Where(x => x.DriveType == DriveType.Removable).ToList(); - + if (drives.Count > 0) { IsConnected = true; @@ -77,6 +80,49 @@ namespace Tango.PPC.Common.Storage Initialize(); } + /// + /// Registers a method for handling a file selection. + /// + /// The file extension. + /// The handler. + /// Cannot register multiple file handlers for the same extension. + public void RegisterFileHandler(string extension, Action handler) + { + if (_fileHandlers.ContainsKey(extension)) + { + throw new InvalidOperationException("Cannot register multiple file handlers for the same extension."); + } + _fileHandlers.Add(extension, handler); + } + + /// + /// Unregisters the file handler. + /// + /// The handler. + public void UnregisterFileHandler(Action handler) + { + var h = _fileHandlers.SingleOrDefault(x => x.Value == handler); + + if (h.Key != null) + { + _fileHandlers.Remove(h.Key); + } + } + + /// + /// Submits a file selection. + /// + /// The file item. + public void SubmitFileSelection(ExplorerFileItem fileItem) + { + String extension = Path.GetExtension(fileItem.Path); + + if (_fileHandlers.ContainsKey(extension)) + { + _fileHandlers[extension].Invoke(fileItem); + } + } + private void Initialize() { _scanThread = new Thread(ScanThreadMethod); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/IStorageProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/IStorageProvider.cs index 164cdfe0a..902021002 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/IStorageProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/IStorageProvider.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.Explorer; namespace Tango.PPC.Common.Storage { @@ -31,5 +32,24 @@ namespace Tango.PPC.Common.Storage /// Gets the inserted storage drive information. /// DriveInfo Drive { get; } + + /// + /// Registers a method for handling a file selection. + /// + /// The file extension. + /// The handler. + void RegisterFileHandler(String extension, Action handler); + + /// + /// Unregisters the file handler. + /// + /// The handler. + void UnregisterFileHandler(Action handler); + + /// + /// Submits a file selection. + /// + /// The file item. + void SubmitFileSelection(ExplorerFileItem fileItem); } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj index eb90bfd77..d09acd30a 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj @@ -150,6 +150,7 @@ MessageNotificationItemView.xaml + @@ -256,6 +257,10 @@ {63561e19-ff5a-414b-a5ef-e30711543e1d} Tango.Emulations + + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5} + Tango.Explorer + {4206ac58-3b57-4699-8835-90bf6db01a61} Tango.Integration @@ -316,7 +321,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ItemBaseConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ItemBaseConverter.cs new file mode 100644 index 000000000..cddfea894 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ItemBaseConverter.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Data; +using Tango.PPC.Common.Notifications; + +namespace Tango.PPC.UI.Converters +{ + public class ItemBaseConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + ItemBase item = value as ItemBase; + + if (item != null) + { + var view = Activator.CreateInstance(item.ViewType) as FrameworkElement; + + if (view == null) + { + throw new InvalidOperationException("The type " + item.ViewType + " is not a framework element."); + } + + view.DataContext = item; + return view; + } + + return null; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/NotificationItemConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/NotificationItemConverter.cs deleted file mode 100644 index 4e3291b97..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/NotificationItemConverter.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Data; -using Tango.PPC.Common.Notifications; - -namespace Tango.PPC.UI.Converters -{ - public class NotificationItemConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - NotificationItem item = value as NotificationItem; - - if (item != null) - { - var view = Activator.CreateInstance(item.ViewType) as FrameworkElement; - - if (view == null) - { - throw new InvalidOperationException("The type " + item.ViewType + " is not a framework element."); - } - - view.DataContext = item; - return view; - } - - return null; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs index f03d9accd..f68d57805 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs @@ -35,12 +35,18 @@ namespace Tango.PPC.UI.Notifications /// public ObservableCollection NotificationItems { get; private set; } + /// + /// Gets the collection of taskbar items. + /// + public ObservableCollection TaskBarItems { get; private set; } + /// /// Initializes a new instance of the class. /// public DefaultNotificationProvider() { NotificationItems = new ObservableCollection(); + TaskBarItems = new ObservableCollection(); _pendingMessageBoxes = new ConcurrentQueue>(); _pendingDialogs = new ConcurrentQueue>(); @@ -441,5 +447,35 @@ namespace Tango.PPC.UI.Notifications LogManager.Log($"Popping out AppBarItem '{appBarItem.GetType().Name}'."); CurrentAppBarItem = null; } + + /// + /// Pushes the task bar item. + /// + /// The task bar item. + /// + public TaskBarItem PushTaskBarItem(TaskBarItem taskBarItem) + { + TaskBarItems.Add(taskBarItem); + return taskBarItem; + } + + /// + /// Handles the Push Task Bar Item event. + /// + /// + /// + public TaskBarItem PushTaskBarItem() where T : TaskBarItem + { + return PushTaskBarItem(Activator.CreateInstance()); + } + + /// + /// Pops the task bar item. + /// + /// + public void PopTaskBarItem(TaskBarItem taskBarItem) + { + TaskBarItems.Remove(taskBarItem); + } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj index 466ff0587..f615f25e0 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj @@ -118,7 +118,7 @@ - + @@ -135,7 +135,6 @@ - @@ -160,9 +159,6 @@ MachineUpdateView.xaml - - StorageView.xaml - Designer MSBuild:Compile @@ -219,10 +215,6 @@ Designer MSBuild:Compile - - Designer - MSBuild:Compile - @@ -327,6 +319,10 @@ {91b70e9b-66a7-4873-ae10-400e71cf404f} Tango.PPC.MachineSettings + + {04febb02-f782-4b96-b47d-f6902afa43be} + Tango.PPC.Storage + {0be74eee-22cb-4dba-b896-793b9e1a3ac0} Tango.PPC.Common @@ -445,7 +441,7 @@ copy /Y "$(SolutionDir)Referenced Assemblies\vcruntime140d.dll" "$(TargetDir)" - + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs index 47f4409f5..703a2f6ae 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs @@ -88,7 +88,6 @@ namespace Tango.PPC.UI TangoIOC.Default.Register(); TangoIOC.Default.Register(); TangoIOC.Default.Register(); - TangoIOC.Default.Register(); TangoIOC.Default.GetInstance().ContentRendered += (_, __) => @@ -162,13 +161,5 @@ namespace Tango.PPC.UI return TangoIOC.Default.GetInstance(); } } - - public static StorageViewVM StorageViewVM - { - get - { - return TangoIOC.Default.GetInstance(); - } - } } } \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/StorageViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/StorageViewVM.cs deleted file mode 100644 index 5b5167393..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/StorageViewVM.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.Core.Commands; -using Tango.Explorer; -using Tango.PPC.Common; - -namespace Tango.PPC.UI.ViewModels -{ - public class StorageViewVM : PPCViewModel - { - private String _currentPath; - public String CurrentPath - { - get { return _currentPath; } - set { _currentPath = value; RaisePropertyChangedAuto(); } - } - - public RelayCommand CloseCommand { get; set; } - - public RelayCommand FileSelectedCommand { get; set; } - - public StorageViewVM() - { - CloseCommand = new RelayCommand(Close); - FileSelectedCommand = new RelayCommand(OnFileSelected); - } - - public override void OnApplicationStarted() - { - - } - - public override void OnApplicationReady() - { - base.OnApplicationReady(); - - StorageProvider.StorageConnected += StorageProvider_StorageConnected; - StorageProvider.StorageDisconnected += StorageProvider_StorageDisconnected; - } - - public override void OnNavigatedTo() - { - base.OnNavigatedTo(); - - if (StorageProvider.Drive != null) - { - CurrentPath = StorageProvider.Drive.RootDirectory.FullName; - } - } - - private async void Close() - { - await NavigationManager.NavigateTo(Common.Navigation.NavigationView.LayoutView); - } - - /// - /// Handles the storage connected event. - /// - /// The sender. - /// The drive info. - private void StorageProvider_StorageConnected(object sender, System.IO.DriveInfo e) - { - InvokeUI(async () => - { - if (await NotificationProvider.ShowQuestion("Disk Inserted. Do you want to browse?")) - { - await NavigationManager.NavigateTo(Common.Navigation.NavigationView.StorageView); - } - }); - } - - /// - /// Handles the storage disconnected event. - /// - /// The sender. - /// The drive info. - private void StorageProvider_StorageDisconnected(object sender, System.IO.DriveInfo e) - { - InvokeUI(async () => - { - if (IsVisible) - { - await NavigationManager.NavigateTo(Common.Navigation.NavigationView.LayoutView); - } - }); - } - - private async void OnFileSelected(ExplorerFileItem fileItem) - { - await NavigationManager.NavigateTo(Common.Navigation.NavigationView.LayoutView); - await NotificationProvider.ShowInfo($"File Selected: {fileItem.Name}"); - } - } -} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml index 44a66d7f0..076cd09e4 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml @@ -18,7 +18,7 @@ d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:LayoutViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.LayoutViewVM}"> - + @@ -63,15 +63,6 @@ - - - - - Storage - - - - diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml index 690022e64..7eca6dba6 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml @@ -16,7 +16,7 @@ d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> - + @@ -33,7 +33,7 @@ - + @@ -57,18 +57,19 @@ - - - - - + + + + + + + + + + + + + @@ -81,7 +82,6 @@ - diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/StorageView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/StorageView.xaml deleted file mode 100644 index aa7bdcf7d..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/StorageView.xaml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/StorageView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/StorageView.xaml.cs deleted file mode 100644 index d558d08bf..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/StorageView.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace Tango.PPC.UI.Views -{ - /// - /// Interaction logic for StorageView.xaml - /// - public partial class StorageView : UserControl - { - public StorageView() - { - InitializeComponent(); - } - } -} diff --git a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/LiquidTypesRml.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/LiquidTypesRml.cs index c4ccb4ab6..ef00cb5a8 100644 --- a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/LiquidTypesRml.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/LiquidTypesRml.cs @@ -11,6 +11,10 @@ namespace Tango.BL.Entities { public CalibrationData GetCalibrationData() { + if (DefaultCatData == null) + { + throw LogManager.Log(new NullReferenceException("The default RML calibration data is null.")); + } return CalibrationData.Parser.ParseFrom(DefaultCatData); } diff --git a/Software/Visual_Studio/Tango.Explorer/ExplorerControl.cs b/Software/Visual_Studio/Tango.Explorer/ExplorerControl.cs index 0c713a7db..197380475 100644 --- a/Software/Visual_Studio/Tango.Explorer/ExplorerControl.cs +++ b/Software/Visual_Studio/Tango.Explorer/ExplorerControl.cs @@ -114,7 +114,7 @@ namespace Tango.Explorer } } - private void NavigateBack() + public void NavigateBack() { if (CurrentFolder != null) { diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln index 490ea56b3..fe2f0a90c 100644 --- a/Software/Visual_Studio/Tango.sln +++ b/Software/Visual_Studio/Tango.sln @@ -236,6 +236,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Explorer", "Tango.Exp EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.JobRunsGenerator", "Utilities\Tango.JobRunsGenerator\Tango.JobRunsGenerator.csproj", "{4EDCF067-E377-42CB-A18C-8368CF484577}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.PPC.Storage", "PPC\Modules\Tango.PPC.Storage\Tango.PPC.Storage.csproj", "{04FEBB02-F782-4B96-B47D-F6902AFA43BE}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution AppVeyor|Any CPU = AppVeyor|Any CPU @@ -4199,6 +4201,46 @@ Global {4EDCF067-E377-42CB-A18C-8368CF484577}.Release|x64.Build.0 = Release|Any CPU {4EDCF067-E377-42CB-A18C-8368CF484577}.Release|x86.ActiveCfg = Release|Any CPU {4EDCF067-E377-42CB-A18C-8368CF484577}.Release|x86.Build.0 = Release|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.AppVeyor|Any CPU.ActiveCfg = Release|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.AppVeyor|Any CPU.Build.0 = Release|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.AppVeyor|ARM.ActiveCfg = Release|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.AppVeyor|ARM.Build.0 = Release|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.AppVeyor|ARM64.ActiveCfg = Release|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.AppVeyor|ARM64.Build.0 = Release|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.AppVeyor|x64.ActiveCfg = Release|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.AppVeyor|x64.Build.0 = Release|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.AppVeyor|x86.ActiveCfg = Release|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.AppVeyor|x86.Build.0 = Release|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.Debug|ARM.ActiveCfg = Debug|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.Debug|ARM.Build.0 = Debug|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.Debug|ARM64.Build.0 = Debug|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.Debug|x64.ActiveCfg = Debug|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.Debug|x64.Build.0 = Debug|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.Debug|x86.ActiveCfg = Debug|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.Debug|x86.Build.0 = Debug|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.DefaultBuild|Any CPU.ActiveCfg = Debug|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.DefaultBuild|Any CPU.Build.0 = Debug|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.DefaultBuild|ARM.ActiveCfg = Debug|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.DefaultBuild|ARM.Build.0 = Debug|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.DefaultBuild|ARM64.ActiveCfg = Debug|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.DefaultBuild|ARM64.Build.0 = Debug|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.DefaultBuild|x64.ActiveCfg = Debug|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.DefaultBuild|x64.Build.0 = Debug|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.DefaultBuild|x86.ActiveCfg = Debug|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.DefaultBuild|x86.Build.0 = Debug|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.Release|Any CPU.Build.0 = Release|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.Release|ARM.ActiveCfg = Release|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.Release|ARM.Build.0 = Release|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.Release|ARM64.ActiveCfg = Release|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.Release|ARM64.Build.0 = Release|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.Release|x64.ActiveCfg = Release|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.Release|x64.Build.0 = Release|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.Release|x86.ActiveCfg = Release|Any CPU + {04FEBB02-F782-4B96-B47D-F6902AFA43BE}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -4271,14 +4313,15 @@ Global {72E591D6-8F83-4D8C-8F67-9C325E623234} = {EC62BC9C-F2FE-4333-B7E4-110E38D43958} {8A65AD6A-A9B4-48C0-9301-4B7434B712F8} = {B2AF4F3F-2828-47C3-8F3E-A0EA0BD66FF8} {4EDCF067-E377-42CB-A18C-8368CF484577} = {5F6BBAA8-EAD0-4B18-97E5-55B4F56DD760} + {04FEBB02-F782-4B96-B47D-F6902AFA43BE} = {0048447D-1D94-4E60-9DAD-7349C777CB4E} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {7986F7F4-A86A-4994-B1B6-0988D7F057B6} - BuildVersion_BuildVersioningStyle = None.None.Increment.DeltaBaseYearDayOfYear - BuildVersion_UpdateAssemblyVersion = True - BuildVersion_UpdateFileVersion = False - BuildVersion_StartDate = 2000/1/1 - BuildVersion_AssemblyInfoFilename = Properties\AssemblyInfo.cs BuildVersion_UseGlobalSettings = False + BuildVersion_AssemblyInfoFilename = Properties\AssemblyInfo.cs + BuildVersion_StartDate = 2000/1/1 + BuildVersion_UpdateFileVersion = False + BuildVersion_UpdateAssemblyVersion = True + BuildVersion_BuildVersioningStyle = None.None.Increment.DeltaBaseYearDayOfYear + SolutionGuid = {7986F7F4-A86A-4994-B1B6-0988D7F057B6} EndGlobalSection EndGlobal -- cgit v1.3.1