From f35fea4ffd1219e844f94a0b72c12cc91af2c94e Mon Sep 17 00:00:00 2001 From: Roy Date: Sun, 22 Oct 2023 16:40:33 +0300 Subject: factory reset for eureka --- .../ViewModels/SystemViewVM.cs | 41 +++++++++++++--------- 1 file changed, 25 insertions(+), 16 deletions(-) (limited to 'Software/Visual_Studio/PPC/Modules') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs index e3f695514..143cfe875 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs @@ -16,6 +16,7 @@ using Tango.Settings; using System.Data.Entity; using Tango.PPC.Common.UWF; using Tango.BL.Entities; +using Tango.PPC.Common.Build; namespace Tango.PPC.Technician.ViewModels { @@ -134,25 +135,33 @@ namespace Tango.PPC.Technician.ViewModels { Settings.ApplicationState = ApplicationStates.FactoryRestore; Settings.Save(); - try - { - NotificationProvider.SetGlobalBusyMessage("Disabling write filter protection..."); - await _uwf.Disable(); - await Task.Delay(2000); - NotificationProvider.ReleaseGlobalBusyMessage(); - await NavigationManager.NavigateTo(Common.Navigation.NavigationView.RestartingSystemView); - await Task.Delay(4000); - _os.Restart(); - } - catch (Exception ex) + + if (BuildProvider.BuildType == BuildType.TS1800) { - LogManager.Log(ex, "Error executing factory reset."); - NotificationProvider.ReleaseGlobalBusyMessage(); - await NotificationProvider.ShowError($"Error executing factory reset.\n{ex.FlattenMessage()}"); + try + { + NotificationProvider.SetGlobalBusyMessage("Disabling write filter protection..."); + await _uwf.Disable(); + await Task.Delay(2000); + NotificationProvider.ReleaseGlobalBusyMessage(); + await NavigationManager.NavigateTo(Common.Navigation.NavigationView.RestartingSystemView); + await Task.Delay(4000); + _os.Restart(); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error executing factory reset."); + NotificationProvider.ReleaseGlobalBusyMessage(); + await NotificationProvider.ShowError($"Error executing factory reset.\n{ex.FlattenMessage()}"); + } + finally + { + NotificationProvider.ReleaseGlobalBusyMessage(); + } } - finally + else { - NotificationProvider.ReleaseGlobalBusyMessage(); + ApplicationManager.Restart(); } } } -- cgit v1.3.1