diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-07-22 17:32:49 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-07-22 17:32:49 +0300 |
| commit | 449cc62b5bd91e5233edc5c0042d5792c8aa2972 (patch) | |
| tree | 45b5b82f9300bf81da6930523817fac2f809717b | |
| parent | 8f082608ed86c6027cb88539d40d005189fa1cf6 (diff) | |
| download | Tango-449cc62b5bd91e5233edc5c0042d5792c8aa2972.tar.gz Tango-449cc62b5bd91e5233edc5c0042d5792c8aa2972.zip | |
Added job outline logs to machine operator.
Fixed navigation button disabled on PPC.
5 files changed, 51 insertions, 8 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Navigation/INavigationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Navigation/INavigationManager.cs index bf55534c0..f792c5e02 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Navigation/INavigationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Navigation/INavigationManager.cs @@ -33,6 +33,11 @@ namespace Tango.PPC.Common.Navigation bool IsBackEnabled { get; set; } /// <summary> + /// Gets or sets a value indicating whether the navigation system is currently navigating. + /// </summary> + bool IsNavigating { get; set; } + + /// <summary> /// Navigates to the previous view if <see cref="CanNavigateBack"/> is true. /// </summary> Task<bool> NavigateBack(); 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; + /// <summary> + /// Gets or sets a value indicating whether the navigation system is currently navigating. + /// </summary> + public bool IsNavigating + { + get { return _isNavigating; } + set + { + _isNavigating = value; + RaisePropertyChangedAuto(); + } + } + /// <summary> /// Navigates to the previous view if <see cref="P:Tango.PPC.Common.Navigation.INavigationManager.CanNavigateBack" /> is true. /// </summary> @@ -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; 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 21cc90f2d..b2a267b19 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml @@ -268,7 +268,7 @@ <Border BorderThickness="0 0 0 1" BorderBrush="{StaticResource TangoDividerBrush}" DockPanel.Dock="Top"> <DockPanel> <Border BorderThickness="0 0 1 0" BorderBrush="{StaticResource TangoDividerBrush}"> - <touch:TouchHamburgerButton IsEnabled="{Binding NavigationManager.IsBackEnabled}" Width="100" Height="100" Padding="15" Command="{Binding MenuOrBackCommand}" EnableDropShadow="False" Foreground="{StaticResource TangoPrimaryAccentBrush}" IsBack="{Binding NavigationManager.CanNavigateBack}"> + <touch:TouchHamburgerButton IsHitTestVisible="{Binding NavigationManager.IsNavigating,Converter={StaticResource BooleanInverseConverter}}" IsEnabled="{Binding NavigationManager.IsBackEnabled}" Width="100" Height="100" Padding="15" Command="{Binding MenuOrBackCommand}" EnableDropShadow="False" Foreground="{StaticResource TangoPrimaryAccentBrush}" IsBack="{Binding NavigationManager.CanNavigateBack}"> </touch:TouchHamburgerButton> </Border> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest index d72e75011..efc5f8179 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest @@ -16,7 +16,7 @@ Remove this element if your application requires this virtualization for backwards compatibility. --> - <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> + <!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />--> </requestedPrivileges> </security> </trustInfo> diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index a967b79ee..68bba48e6 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -2570,6 +2570,28 @@ namespace Tango.Integration.Operation } } + //Log Job Outline (Only first and last brush stops if gradient). + var ticketToLog = ticket.Clone(); + ticketToLog.UploadStrategy = JobUploadStrategy; + ticketToLog.Segments.Clear(); + + foreach (var seg in ticket.Segments) + { + JobSegment segmentToLog = new JobSegment(); + + segmentToLog.Length = seg.Length; + segmentToLog.BrushStops.Add(seg.BrushStops.First()); + + if (seg.BrushStops.Count > 1) + { + segmentToLog.BrushStops.Add(seg.BrushStops.Last()); + } + + ticketToLog.Segments.Add(segmentToLog); + } + + LogManager.Log($"Job outline for '{job.Name}':\n{ticketToLog.ToJsonString()}"); + if (handler.IsCanceled) { Status = MachineStatuses.ReadyToDye; @@ -2607,9 +2629,6 @@ namespace Tango.Integration.Operation request.JobTicket = ticket.Clone(); request.JobTicket.UploadStrategy = JobUploadStrategy; - //Use this if you want to log the entire job... - var logRequest = request.Clone(); - LogManager.Log($"Job upload method is set to {JobUploadStrategy}..."); if (handler.IsCanceled) |
