From 7344b90fcaa64759114e66cd9645f9e8ea4e073a Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Thu, 18 Jun 2020 18:32:59 +0300 Subject: Demo Mode. --- .../Connection/IMachineProvider.cs | 2 +- .../Tango.FSE.Common/DemoMode/DemoModeCommand.cs | 26 ++++++ .../Tango.FSE.Common/DemoMode/IDemoModeManager.cs | 16 ++++ .../FSEApplication/IFSEApplicationManager.cs | 5 ++ .../FSE/Tango.FSE.Common/FSEViewModel.cs | 7 ++ .../Tango.FSE.Common/INotifyApplicationReady.cs | 20 +++++ .../Tango.FSE.Common/INotifyApplicationStarted.cs | 8 +- .../Notifications/INotificationProvider.cs | 2 +- .../FSE/Tango.FSE.Common/Tango.FSE.Common.csproj | 3 + .../Tango.FSE.Common/Tiles/IDashboardManager.cs | 2 +- .../Tango.FSE.Common/Updates/IUpdatesManager.cs | 2 +- .../Connection/DefaultMachineProvider.cs | 13 +-- .../DemoMode/DefaultDemoModeManager.cs | 25 ++++++ .../FSE/Tango.FSE.UI/DemoMode/DemoModeWindow.xaml | 47 +++++++++++ .../Tango.FSE.UI/DemoMode/DemoModeWindow.xaml.cs | 28 +++++++ .../FSE/Tango.FSE.UI/DemoMode/DemoModeWindowVM.cs | 14 ++++ .../FSEApplication/DefaultFSEApplicationManager.cs | 17 +++- .../FSE/Tango.FSE.UI/MainWindow.xaml.cs | 10 +++ .../Notifications/DefaultNotificationProvider.cs | 93 ++++++++++++++++++++++ .../RemoteJob/DefaultRemoteJobProvider.cs | 8 +- .../FSE/Tango.FSE.UI/Tango.FSE.UI.csproj | 9 +++ .../Tango.FSE.UI/Tiles/DefaultDashboardManager.cs | 5 +- .../Tango.FSE.UI/Updates/DefaultUpdatesManager.cs | 10 +-- .../FSE/Tango.FSE.UI/ViewModelLocator.cs | 13 +++ 24 files changed, 345 insertions(+), 40 deletions(-) create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.Common/DemoMode/DemoModeCommand.cs create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.Common/DemoMode/IDemoModeManager.cs create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.Common/INotifyApplicationReady.cs create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/DemoMode/DefaultDemoModeManager.cs create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/DemoMode/DemoModeWindow.xaml create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/DemoMode/DemoModeWindow.xaml.cs create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/DemoMode/DemoModeWindowVM.cs (limited to 'Software/Visual_Studio') diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Connection/IMachineProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Connection/IMachineProvider.cs index 14dbe2f99..4d552d856 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Connection/IMachineProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Connection/IMachineProvider.cs @@ -13,7 +13,7 @@ namespace Tango.FSE.Common.Connection /// /// Represents the machine connection provider. /// - public interface IMachineProvider : INotifyApplicationStarted + public interface IMachineProvider : INotifyApplicationReady { /// /// Occurs when machine operator has connected. diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/DemoMode/DemoModeCommand.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/DemoMode/DemoModeCommand.cs new file mode 100644 index 000000000..abb7b25e6 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/DemoMode/DemoModeCommand.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; + +namespace Tango.FSE.Common.DemoMode +{ + public class DemoModeCommand + { + public String Name { get; set; } + public String Description { get; set; } + public RelayCommand Command { get; set; } + + public static DemoModeCommand Create(Action action, String name, String description) + { + return new DemoModeCommand() + { + Command = new RelayCommand(action), + Name = name, + Description = description + }; + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/DemoMode/IDemoModeManager.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/DemoMode/IDemoModeManager.cs new file mode 100644 index 000000000..b5afd9c1b --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/DemoMode/IDemoModeManager.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.FSE.Common.DemoMode +{ + public interface IDemoModeManager + { + ObservableCollection DemoCommands { get; } + + void InsertCommand(Action action, String name, String description); + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/FSEApplication/IFSEApplicationManager.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/FSEApplication/IFSEApplicationManager.cs index bbfc618a3..c3f54d0e2 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/FSEApplication/IFSEApplicationManager.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/FSEApplication/IFSEApplicationManager.cs @@ -97,5 +97,10 @@ namespace Tango.FSE.Common.FSEApplication /// Gets or sets the state of the application main window. /// WindowState WindowState { get; set; } + + /// + /// Gets a value indicating whether the application is currently running in demo mode. + /// + bool DemoMode { get; } } } diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/FSEViewModel.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/FSEViewModel.cs index 4299e6b82..7dcfcb3c8 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/FSEViewModel.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/FSEViewModel.cs @@ -42,6 +42,7 @@ using Tango.FSE.Common.Events; using Tango.FSE.Common.Tiles; using Tango.FSE.Common.RemoteJob; using Tango.FSE.Common.WindowsManager; +using Tango.FSE.Common.DemoMode; namespace Tango.FSE.Common { @@ -221,6 +222,12 @@ namespace Tango.FSE.Common [TangoInject] public IWindowsManager WindowsManager { get; set; } + /// + /// Gets or sets the demo mode manager. + /// + [TangoInject] + public IDemoModeManager DemoModeManager { get; set; } + /// /// Gets or sets the FSE service. /// diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/INotifyApplicationReady.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/INotifyApplicationReady.cs new file mode 100644 index 000000000..00858f070 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/INotifyApplicationReady.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.FSE.Common.FSEApplication; + +namespace Tango.FSE.Common +{ + /// + /// Represents an object that supports receiving application started/ready from the application manager. + /// + public interface INotifyApplicationReady + { + /// + /// Called when is ready and user is logged-in. (happens every time a user logs-in) + /// + void OnApplicationReady(IFSEApplicationManager applicationManager); + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/INotifyApplicationStarted.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/INotifyApplicationStarted.cs index 3a79e0b72..52479e8c1 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/INotifyApplicationStarted.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/INotifyApplicationStarted.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.FSE.Common.FSEApplication; namespace Tango.FSE.Common { @@ -14,11 +15,6 @@ namespace Tango.FSE.Common /// /// Called when the application has started (once before user login). /// - void OnApplicationStarted(); - - /// - /// Called when is ready and user is logged-in. (happens every time a user logs-in) - /// - void OnApplicationReady(); + void OnApplicationStarted(IFSEApplicationManager applicationManager); } } diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Notifications/INotificationProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Notifications/INotificationProvider.cs index c37222727..5fff158fd 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Notifications/INotificationProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Notifications/INotificationProvider.cs @@ -16,7 +16,7 @@ namespace Tango.FSE.Common.Notifications /// /// Represents the PPC user notification provider responsible for displaying information, alerts and dialogs to the user. /// - public interface INotificationProvider + public interface INotificationProvider : INotifyApplicationReady { /// /// Gets the collection of notification items. 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 5b7746ac4..a07897758 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 @@ -153,6 +153,8 @@ + + @@ -186,6 +188,7 @@ + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tiles/IDashboardManager.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tiles/IDashboardManager.cs index 297da27c0..0700a5976 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tiles/IDashboardManager.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tiles/IDashboardManager.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; namespace Tango.FSE.Common.Tiles { - public interface IDashboardManager: INotifyApplicationStarted + public interface IDashboardManager : INotifyApplicationStarted, INotifyApplicationReady { ObservableCollection Tiles { get; } } diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Updates/IUpdatesManager.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Updates/IUpdatesManager.cs index 3dfe067ce..4e7aa857b 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Updates/IUpdatesManager.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Updates/IUpdatesManager.cs @@ -10,7 +10,7 @@ namespace Tango.FSE.Common.Updates /// /// Represents an FSE software updates manager. /// - public interface IUpdatesManager : INotifyApplicationStarted + public interface IUpdatesManager : INotifyApplicationReady { /// /// Gets or sets a value indicating whether to perform an automatic update checks. diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs index c707bbe60..759bcb4d5 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs @@ -18,6 +18,7 @@ using Tango.FSE.BL; using Tango.FSE.Common; using Tango.FSE.Common.Authentication; using Tango.FSE.Common.Connection; +using Tango.FSE.Common.FSEApplication; using Tango.FSE.Common.Notifications; using Tango.FSE.UI.Dialogs; using Tango.Integration.ExternalBridge; @@ -672,20 +673,12 @@ namespace Tango.FSE.UI.Connection #endregion - #region Application Started - - /// - /// Called when the application has started (once before user login). - /// - public void OnApplicationStarted() - { - - } + #region Application Ready /// /// Called when is ready and user is logged-in. (happens every time a user logs-in) /// - public void OnApplicationReady() + public void OnApplicationReady(IFSEApplicationManager applicationManager) { _machineEventsStateProvider.Init(); } diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/DemoMode/DefaultDemoModeManager.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/DemoMode/DefaultDemoModeManager.cs new file mode 100644 index 000000000..5f0ae1c0b --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/DemoMode/DefaultDemoModeManager.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.FSE.Common.DemoMode; + +namespace Tango.FSE.UI.DemoMode +{ + public class DefaultDemoModeManager : IDemoModeManager + { + public ObservableCollection DemoCommands { get; private set; } + + public DefaultDemoModeManager() + { + DemoCommands = new ObservableCollection(); + } + + public void InsertCommand(Action action, string name, string description) + { + DemoCommands.Add(DemoModeCommand.Create(action, name, description)); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/DemoMode/DemoModeWindow.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/DemoMode/DemoModeWindow.xaml new file mode 100644 index 000000000..2edbe69c5 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/DemoMode/DemoModeWindow.xaml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/DemoMode/DemoModeWindow.xaml.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/DemoMode/DemoModeWindow.xaml.cs new file mode 100644 index 000000000..eea87323b --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/DemoMode/DemoModeWindow.xaml.cs @@ -0,0 +1,28 @@ +using MahApps.Metro.Controls; +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.Shapes; + +namespace Tango.FSE.UI.DemoMode +{ + /// + /// Interaction logic for DemoModeWindow.xaml + /// + public partial class DemoModeWindow : MetroWindow + { + public DemoModeWindow() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/DemoMode/DemoModeWindowVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/DemoMode/DemoModeWindowVM.cs new file mode 100644 index 000000000..2d613a8b1 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/DemoMode/DemoModeWindowVM.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.FSE.Common; + +namespace Tango.FSE.UI.DemoMode +{ + public class DemoModeWindowVM : FSEViewModel + { + + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/FSEApplication/DefaultFSEApplicationManager.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/FSEApplication/DefaultFSEApplicationManager.cs index e0465d307..1c1a7ae00 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/FSEApplication/DefaultFSEApplicationManager.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/FSEApplication/DefaultFSEApplicationManager.cs @@ -241,7 +241,7 @@ namespace Tango.FSE.UI.FSEApplication foreach (var instance in TangoIOC.Default.GetAllInstancesByBase()) { LogManager.Log($"Invoking {instance.GetType().Name}.OnApplicationStarted..."); - instance.OnApplicationStarted(); + instance.OnApplicationStarted(this); } var internalModules = this.GetType().Assembly.GetTypes().Where(xx => typeof(FSEModuleBase).IsAssignableFrom(xx)).ToList(); @@ -354,10 +354,10 @@ namespace Tango.FSE.UI.FSEApplication } LogManager.Log("OnApplicationReady methods for all INotifyApplicationStarted services..."); - foreach (var instance in TangoIOC.Default.GetAllInstancesByBase()) + foreach (var instance in TangoIOC.Default.GetAllInstancesByBase()) { LogManager.Log($"Invoking {instance.GetType().Name}.OnApplicationReady..."); - instance.OnApplicationReady(); + instance.OnApplicationReady(this); } }); } @@ -437,5 +437,16 @@ namespace Tango.FSE.UI.FSEApplication Process.Start(Application.ResourceAssembly.Location); Environment.Exit(0); } + + /// + /// Gets a value indicating whether the application is currently running in demo mode. + /// + public bool DemoMode + { + get + { + return StartupArgs.Contains("-demo"); + } + } } } diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/MainWindow.xaml.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/MainWindow.xaml.cs index 75e27d586..07534dd8e 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/MainWindow.xaml.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/MainWindow.xaml.cs @@ -17,6 +17,7 @@ using Tango.Core.DI; using Tango.FSE.Common; using Tango.FSE.Common.FSEApplication; using Tango.FSE.Common.Resolution; +using Tango.FSE.UI.DemoMode; using Tango.Settings; namespace Tango.FSE.UI @@ -43,6 +44,15 @@ namespace Tango.FSE.UI IFSEApplicationManager appManager = TangoIOC.Default.GetInstance(); + ContentRendered += (_, __) => + { + if (appManager.DemoMode) + { + DemoModeWindow demoWindow = new DemoModeWindow(); + demoWindow.Show(); + } + }; + Closing += (x, e) => { e.Cancel = true; diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Notifications/DefaultNotificationProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Notifications/DefaultNotificationProvider.cs index 5c17b9f9a..ce64bd0f1 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Notifications/DefaultNotificationProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Notifications/DefaultNotificationProvider.cs @@ -21,6 +21,10 @@ using System.Windows.Data; using MaterialDesignThemes.Wpf; using Tango.FSE.Common.Core; using Tango.FSE.Common.BugReporting; +using Tango.FSE.Common.FSEApplication; +using Tango.FSE.Common.DemoMode; +using Tango.FSE.Common; +using System.Threading; namespace Tango.FSE.UI.Notifications { @@ -39,6 +43,9 @@ namespace Tango.FSE.UI.Notifications [TangoInject(TangoInjectMode.WhenAvailable)] public IBugReporter BugReporter { get; set; } + [TangoInject(TangoInjectMode.WhenAvailable)] + private IDemoModeManager DemoModeManager { get; set; } + private bool _notificationsVisible; /// /// Gets or sets a value indicating whether to allow notifications visibility. @@ -811,5 +818,91 @@ namespace Tango.FSE.UI.Notifications RaisePropertyChanged(nameof(HasSnackbarItems)); }); } + + /// + /// Called when is ready and user is logged-in. (happens every time a user logs-in) + /// + /// + public void OnApplicationReady(IFSEApplicationManager applicationManager) + { + if (applicationManager.DemoMode) + { + DemoModeManager.InsertCommand(() => + { + ShowInfo("This is a standard information message."); + }, "Emulate Info Message", "Emulates a standard information message box."); + + DemoModeManager.InsertCommand(() => + { + ShowWarning("Something bad is about to happen."); + }, "Emulate Warning Message", "Emulates a standard warning message box."); + + DemoModeManager.InsertCommand(() => + { + ShowWarningQuestion("Something bad is about to happen. Are you sure?"); + }, "Emulate Warning Question Message", "Emulates a standard warning question message box."); + + DemoModeManager.InsertCommand(() => + { + ShowError("Something bad happened."); + }, "Emulate Error Message", "Emulates a standard error message box."); + + DemoModeManager.InsertCommand(() => + { + ShowSuccess("The operation completed successfully."); + }, "Emulate Success Message", "Emulates a standard success message box."); + + DemoModeManager.InsertCommand(() => + { + PushSnackbarItem(MessageType.Info, "Some Information", true, "This is a standard information message.\nTap to see more details.", TimeSpan.FromSeconds(5), null, () => + { + ShowInfo("This is a standard information message."); + }); + }, "Emulate Info Snackbar", "Creates an information snackbar with timeout and press action."); + + DemoModeManager.InsertCommand(() => + { + PushSnackbarItem(MessageType.Warning, "Some Warning", true, "This is a standard warning message.\nTap to see more details.", TimeSpan.FromSeconds(5), null, () => + { + ShowWarning("This is a standard warning message."); + }); + }, "Emulate Warning Snackbar", "Creates a warning snackbar with timeout and press action."); + + DemoModeManager.InsertCommand(() => + { + PushSnackbarItem(MessageType.Error, "Fake Error Occurred", false, "This is a standard error message.\nTap to see more details.", null, null, () => + { + ShowError("This is a standard warning message."); + }); + }, "Emulate Error Snackbar", "Creates an error snackbar with no timeout and no ability to close."); + + DemoModeManager.InsertCommand(() => + { + PushSnackbarItem(MessageType.Success, "Operation Completed", true, "This is a standard success message.\nTap to close", TimeSpan.FromSeconds(5)); + }, "Emulate Success Snackbar", "Creates a success snackbar with timeout and close press action."); + + DemoModeManager.InsertCommand(() => + { + var snackbar = PushProgressSnackbar("Background Operation", "The application is doing stuff in the background..."); + + Task.Factory.StartNew(() => + { + for (int i = 0; i < 100; i++) + { + snackbar.Message = $"The application is doing stuff in the background ({i}/100)..."; + Thread.Sleep(50); + } + + snackbar.ProgressCompleted("Operation completed.", TimeSpan.FromSeconds(2)); + }); + + }, "Emulate Progress Snackbar", "Creates a success snackbar with timeout and close press action."); + + DemoModeManager.InsertCommand(() => + { + PushErrorReportingSnackbar(new TimeoutException("This is a demo exception"), "Test Error", "This is a demo exception."); + }, "Emulate Bug Reporting Error", "Creates a snackbar notification with a fake error and bug reporting option."); + } + } } } diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/RemoteJob/DefaultRemoteJobProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/RemoteJob/DefaultRemoteJobProvider.cs index d67328bcd..55bf614f3 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/RemoteJob/DefaultRemoteJobProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/RemoteJob/DefaultRemoteJobProvider.cs @@ -7,6 +7,7 @@ using System.Threading.Tasks; using Tango.Core; using Tango.Core.DI; using Tango.FSE.Common.Connection; +using Tango.FSE.Common.FSEApplication; using Tango.FSE.Common.Notifications; using Tango.FSE.Common.RemoteJob; using Tango.Integration.Operation; @@ -31,7 +32,7 @@ namespace Tango.FSE.UI.RemoteJob [TangoInject] private INotificationProvider NotificationProvider { get; set; } - public void OnApplicationStarted() + public void OnApplicationStarted(IFSEApplicationManager applicationManager) { MachineProvider.MachineConnected += MachineProvider_MachineConnected; } @@ -129,10 +130,5 @@ namespace Tango.FSE.UI.RemoteJob } } } - - public void OnApplicationReady() - { - //Do Nothing. - } } } 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 0772159b9..dce2cbb9e 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 @@ -224,6 +224,11 @@ + + + DemoModeWindow.xaml + + ApplicationUpdateView.xaml @@ -381,6 +386,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/DefaultDashboardManager.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/DefaultDashboardManager.cs index f2620fc6e..d03087ee2 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/DefaultDashboardManager.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/DefaultDashboardManager.cs @@ -6,6 +6,7 @@ using System.Text; using System.Threading.Tasks; using Tango.Core.DI; using Tango.FSE.Common; +using Tango.FSE.Common.FSEApplication; using Tango.FSE.Common.Navigation; using Tango.FSE.Common.Tiles; using Tango.FSE.UI.ViewModels; @@ -38,14 +39,14 @@ namespace Tango.FSE.UI.Tiles } } - public async void OnApplicationStarted() + public async void OnApplicationStarted(IFSEApplicationManager applicationManager) { await Task.Delay(100); Tiles.ToList().ForEach(x => TangoIOC.Default.Inject(x)); Tiles.ToList().ForEach(x => x.OnApplicationStarted()); } - public async void OnApplicationReady() + public async void OnApplicationReady(IFSEApplicationManager applicationManager) { await Task.Delay(100); Tiles.ToList().ForEach(x => x.OnApplicationReady()); diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Updates/DefaultUpdatesManager.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Updates/DefaultUpdatesManager.cs index 4c4592c89..164886078 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Updates/DefaultUpdatesManager.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Updates/DefaultUpdatesManager.cs @@ -93,18 +93,10 @@ namespace Tango.FSE.UI.Updates } } - /// - /// Called when the application has started (once before user login). - /// - public void OnApplicationStarted() - { - //Do nothing. - } - /// /// Called when is ready and user is logged-in. (happens every time a user logs-in) /// - public async void OnApplicationReady() + public async void OnApplicationReady(IFSEApplicationManager applicationManager) { if (!_performedFirstCheck) { diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModelLocator.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModelLocator.cs index 159f6326b..862ade549 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModelLocator.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModelLocator.cs @@ -60,6 +60,8 @@ using Tango.FSE.Common.RemoteJob; using Tango.FSE.UI.RemoteJob; using Tango.FSE.Common.WindowsManager; using Tango.FSE.UI.WindowsManager; +using Tango.FSE.Common.DemoMode; +using Tango.FSE.UI.DemoMode; namespace Tango.FSE.UI { @@ -95,6 +97,7 @@ namespace Tango.FSE.UI TangoIOC.Default.Unregister(); TangoIOC.Default.Unregister(); TangoIOC.Default.Unregister(); + TangoIOC.Default.Unregister(); //TangoIOC.Default.Unregister(); //TangoIOC.Default.Unregister(); //TangoIOC.Default.Unregister(); @@ -130,6 +133,7 @@ namespace Tango.FSE.UI TangoIOC.Default.Register(); TangoIOC.Default.Register(); TangoIOC.Default.Register(); + TangoIOC.Default.Register(); TangoIOC.Default.Register(); @@ -142,6 +146,7 @@ namespace Tango.FSE.UI TangoIOC.Default.Register(); TangoIOC.Default.Register(); TangoIOC.Default.Register(); + TangoIOC.Default.Register(); } public static MainWindowVM MainWindowVM @@ -223,5 +228,13 @@ namespace Tango.FSE.UI return TangoIOC.Default.GetInstance(); } } + + public static DemoModeWindowVM DemoModeWindowVM + { + get + { + return TangoIOC.Default.GetInstance(); + } + } } } -- cgit v1.3.1