From 449cc62b5bd91e5233edc5c0042d5792c8aa2972 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Wed, 22 Jul 2020 17:32:49 +0300 Subject: Added job outline logs to machine operator. Fixed navigation button disabled on PPC. --- .../Navigation/DefaultNavigationManager.cs | 25 +++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs index 7c71ef3d0..8d3618fee 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs @@ -203,12 +203,15 @@ namespace Tango.PPC.UI.Navigation { try { + IsNavigating = true; + String[] path = fullPath.Split('.'); var module = _moduleLoader.UserModules.SingleOrDefault(x => x.GetType().Name == path[0] || x.Name == path[0]); if (module == null) { await _notificationProvider.ShowError("The specified module was not loaded."); + IsNavigating = false; return false; } @@ -224,6 +227,7 @@ namespace Tango.PPC.UI.Navigation { if (!await (_currentVM as INavigationBlocker).OnNavigateBackRequest()) { + IsNavigating = false; return false; } } @@ -231,6 +235,7 @@ namespace Tango.PPC.UI.Navigation { if (!await (_currentVM as INavigationBlocker).OnNavigateOutRequest()) { + IsNavigating = false; return false; } } @@ -334,6 +339,8 @@ namespace Tango.PPC.UI.Navigation } catch (Exception ex) { + IsNavigating = false; + LogManager.Log(ex, $"Error navigating to '{fullPath}'."); await _notificationProvider.ShowError($"Error navigating to '{fullPath}'."); return false; } @@ -430,6 +437,20 @@ namespace Tango.PPC.UI.Navigation set { _isBackEnabled = value; RaisePropertyChangedAuto(); } } + private bool _isNavigating; + /// + /// Gets or sets a value indicating whether the navigation system is currently navigating. + /// + public bool IsNavigating + { + get { return _isNavigating; } + set + { + _isNavigating = value; + RaisePropertyChangedAuto(); + } + } + /// /// Navigates to the previous view if is true. /// @@ -502,8 +523,6 @@ namespace Tango.PPC.UI.Navigation private void NotifyOnBeforeNavigated(object fromVM, object toVM) { - IsBackEnabled = false; - if (fromVM == toVM) return; if (fromVM is PPCViewModel) @@ -519,7 +538,7 @@ namespace Tango.PPC.UI.Navigation private void NotifyOnNavigated(object fromVM, object toVM) { - IsBackEnabled = true; + IsNavigating = false; if (fromVM == toVM) return; -- cgit v1.3.1