From 38ed93f95bb5af92bc84599ebb9c0c6895b0b989 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Sun, 2 Jul 2023 13:37:17 +0300 Subject: Job running progress bar. Set running background in progress bar by unit from right to left as auto reverse ( not animation). Bug in current segment in JobHandler. --- .../PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs index 103084e11..653c2368f 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -571,17 +571,17 @@ namespace Tango.PPC.UI.ViewModels IsDyeingProcess = (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null); if (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null) { - var segment = Job.Segments.FirstOrDefault(x => x.SegmentIndex == _runningJobStatus.CurrentSegment.SegmentIndex); + var currentSegmentIndex = Math.Max(_runningJobStatus.CurrentSegment.SegmentIndex - (Job.Segments.Count * RunningJobStatus.CurrentUnit), 0); + var segment = Job.Segments.FirstOrDefault(x => x.SegmentIndex == currentSegmentIndex); + // var segment = Job.Segments.FirstOrDefault(x => x.SegmentIndex == _runningJobStatus.CurrentSegment.SegmentIndex); if (segment != null) { - if (_handler.JobTicket.Segments.Count > 0) { JobBrushStop = _handler.JobTicket.Segments[Job.OrderedSegments.IndexOf(segment)].BrushStops.First(); - } - - CurrentBrushStop = segment.FirstBrushStop; + } } + CurrentBrushStop = RunningJobStatus.CurrentSegment.FirstBrushStop; } } -- cgit v1.3.1 From 167252d9517377a4169cd389ca7187509b5a0c1d Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Sun, 2 Jul 2023 15:26:42 +0300 Subject: UI Power options: Close application and minimize. Related Work Items: #8675 --- .../PPC/Tango.PPC.UI/Dialogs/PowerEurekaView.xaml | 32 ++++++++++++++------- .../PPC/Tango.PPC.UI/Dialogs/PowerEurekaViewVM.cs | 18 +++++++++++- .../Tango.PPC.UI/Images/Menu/AppPower_image.png | Bin 0 -> 799 bytes .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 1 + .../PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs | 11 +++++++ 5 files changed, 50 insertions(+), 12 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/AppPower_image.png (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaView.xaml index f5b1116c0..3ef594046 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaView.xaml @@ -6,7 +6,7 @@ xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" xmlns:local="clr-namespace:Tango.PPC.UI.Dialogs" mc:Ignorable="d" - Width="500" Height="462" + Width="500" Height="625" Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="500" d:DataContext="{d:DesignInstance Type=local:PowerEurekaViewVM, IsDesignTimeCreatable=False}"> @@ -36,17 +36,27 @@ Power - - - Turn off - - - Restart + + + + Minimize + + Restart UI + Close + + - - - Restart - + + + + + Power Save + + Restart FW + + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaViewVM.cs index 2dc8f7b6e..292c4b2d6 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaViewVM.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows; using Tango.Core.Commands; using Tango.SharedUI; @@ -10,7 +11,7 @@ namespace Tango.PPC.UI.Dialogs { public class PowerEurekaViewVM : DialogViewVM { - public enum PowerActionEnum { TurnOff, StandBy, Restart, RestartT }; + public enum PowerActionEnum { TurnOff, StandBy, Restart, RestartT, CloseApp }; private PowerActionEnum _powerAction; @@ -26,6 +27,8 @@ namespace Tango.PPC.UI.Dialogs public RelayCommand StandByCommand { get; set;} public RelayCommand RestartCommand { get; set; } public RelayCommand RestartTabletCommand { get; set; } + public RelayCommand MinimizeCommand { get; set; } + public RelayCommand CloseAppCommand { get; set; } public PowerEurekaViewVM() @@ -35,6 +38,19 @@ namespace Tango.PPC.UI.Dialogs StandByCommand = new RelayCommand(OnStandBy); RestartCommand = new RelayCommand(OnRestart); RestartTabletCommand = new RelayCommand(OnRestartTablet); + MinimizeCommand = new RelayCommand(OnMinimize); + CloseAppCommand = new RelayCommand(OnCloseApp); + } + + private void OnCloseApp(object obj) + { + PowerAction = PowerActionEnum.CloseApp; + base.Accept(); + } + + private void OnMinimize(object obj) + { + Application.Current.MainWindow.WindowState = WindowState.Minimized; } private void OnRestartTablet(object obj) diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/AppPower_image.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/AppPower_image.png new file mode 100644 index 000000000..e81b56d37 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/AppPower_image.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj index f5d3502c0..e364c530c 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj @@ -644,6 +644,7 @@ + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs index f40a89f42..17b676499 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -361,6 +361,9 @@ namespace Tango.PPC.UI.ViewModels if (MachineProvider.MachineOperator.Status != MachineStatuses.Disconnected) ResetMachine(); return; + case PowerEurekaViewVM.PowerActionEnum.CloseApp: + CloseApplication(); + return; default: return; } @@ -455,6 +458,14 @@ namespace Tango.PPC.UI.ViewModels } } + private async void CloseApplication() + { + if (await NotificationProvider.ShowQuestion("Are you sure you want to close the application?")) + { + ApplicationManager.ShutDown(); + } + } + /// /// Powers off the machine. /// -- cgit v1.3.1