From bd3cb640be12621ac37253e8a8c627ae40692e4d Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 7 Feb 2019 15:39:12 +0200 Subject: Some fixes and improvements for PPC & Machine Studio. --- .../Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs | 12 +++++++++++- .../Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs | 21 ++++++++++++++------- .../PPC/Tango.PPC.UI/Views/LayoutView.xaml | 4 ++-- .../PPC/Tango.PPC.UI/Views/LoadingView.xaml | 6 ++++-- .../PPC/Tango.PPC.UI/Views/MachineSetupView.xaml | 2 +- .../PPC/Tango.PPC.UI/Views/MainView.xaml | 14 -------------- 6 files changed, 32 insertions(+), 27 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs index f5c6f43b9..ee1b39ca6 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs @@ -142,6 +142,13 @@ namespace Tango.PPC.UI.ViewModels set { _deploymentSlot = value; RaisePropertyChangedAuto(); } } + private MachineSetupView _currentView; + public MachineSetupView CurrentView + { + get { return _currentView; } + set { _currentView = value; RaisePropertyChangedAuto(); } + } + #endregion #region Commands @@ -284,6 +291,7 @@ namespace Tango.PPC.UI.ViewModels /// The view. private Task NavigateTo(MachineSetupView view) { + CurrentView = view; return View.NavigateTo(view); } @@ -312,11 +320,13 @@ namespace Tango.PPC.UI.ViewModels } } - private void ConnectivityProvider_ConnectionStateChanged(object sender, Common.Connectivity.ConnectionStateEventArgs e) + private async void ConnectivityProvider_ConnectionStateChanged(object sender, Common.Connectivity.ConnectionStateEventArgs e) { if (e.IsConnected) { ConnectivityProvider.ConnectionStateChanged -= ConnectivityProvider_ConnectionStateChanged; + await NavigateTo(MachineSetupView.WiFiTestView); + await Task.Delay(5000); EnsureWiFi(); } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs index a553f3a18..07d034964 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs @@ -213,13 +213,20 @@ namespace Tango.PPC.UI.ViewModels private void CompleteUpdate() { - String updater_exe = Path.Combine(_update_result.UpdatePackagePath, "Tango.PPC.Updater.exe"); - - LogManager.Log("Completing machine setup..."); - LogManager.Log($"Executing '{updater_exe}' with arguments '{PathHelper.GetStartupPath()}'..."); - Process.Start(updater_exe, PathHelper.GetStartupPath()); - LogManager.Log("Terminating application process!"); - Environment.Exit(0); + if (!IsDbUpdate) + { + String updater_exe = Path.Combine(_update_result.UpdatePackagePath, "Tango.PPC.Updater.exe"); + LogManager.Log("Completing machine setup..."); + LogManager.Log($"Executing '{updater_exe}' with arguments '{PathHelper.GetStartupPath()}'..."); + Process.Start(updater_exe, PathHelper.GetStartupPath()); + LogManager.Log("Terminating application process!"); + Environment.Exit(0); + } + else + { + LogManager.Log("Restarting Application..."); + ApplicationManager.Restart(); + } } #endregion 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 0b3e0b1ee..bf3a85543 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml @@ -151,7 +151,7 @@ - + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml index 895619807..57793a9b3 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml @@ -13,7 +13,7 @@ d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:LoadingViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.LoadingView}"> - + + + v diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml index 13f163ef5..30b99dbbf 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml @@ -65,7 +65,7 @@ Checking internet connection, please wait... - + 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 9df92bbcc..6d1bde59d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml @@ -91,19 +91,5 @@ - - -- cgit v1.3.1