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 ++++++++++++++------- 2 files changed, 25 insertions(+), 8 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels') 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 -- cgit v1.3.1