From a47bbe8211c4b7a02c6974cba017d77ea31ffc37 Mon Sep 17 00:00:00 2001 From: Roy Date: Sun, 5 Mar 2023 22:47:23 +0200 Subject: Dialog Adaptations. Separate Job View. Machine Status View Start. EurekaTouchPanel. --- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 101 +++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs new file mode 100644 index 000000000..a0d6e2955 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.Core.Commands; +using Tango.Integration.Operation; +using Tango.PPC.Common; + +namespace Tango.PPC.UI.ViewModels +{ + public class MachineStatusViewVM : PPCViewModel + { + private JobHandler _handler; + + private Job _job; + /// + /// Gets or sets the job. + /// + public Job Job + { + get { return _job; } + set { _job = value; RaisePropertyChangedAuto(); } + } + + private RunningJobStatus _runningJobStatus; + /// + /// Gets or sets the running job status. + /// + public RunningJobStatus RunningJobStatus + { + get { return _runningJobStatus; } + set { _runningJobStatus = value; RaisePropertyChangedAuto(); } + } + + public RelayCommand StopCommand { get; set; } + + public MachineStatusViewVM() + { + StopCommand = new RelayCommand(StopJob); + } + + public override void OnApplicationStarted() + { + MachineProvider.MachineOperator.PrintingStarted += MachineOperator_PrintingStarted; + } + + private void MachineOperator_PrintingStarted(object sender, PrintingEventArgs e) + { + _handler = e.JobHandler; + Job = e.Job; + e.JobHandler.StatusChanged += JobHandler_StatusChanged; + //e.JobHandler.SpoolChangeRequired += JobHandler_SpoolChangeRequired; + e.JobHandler.Stopped += JobHandler_Stopped; + //e.JobHandler.CanCancelChanged += JobHandler_CanCancelChanged; + } + + private void JobHandler_Stopped(object sender, EventArgs e) + { + if (_handler != null) + { + _handler.StatusChanged -= JobHandler_StatusChanged; + //_handler.SpoolChangeRequired -= JobHandler_SpoolChangeRequired; + _handler.Stopped -= JobHandler_Stopped; + } + } + + private void JobHandler_StatusChanged(object sender, RunningJobStatus e) + { + InvokeUI(() => + { + RunningJobStatus = e; + }); + } + + #region Public Methods + + /// + /// Toggles the application technician mode. + /// + public void ToggleTechnicianMode() + { + if (!ApplicationManager.IsInTechnicianMode) + { + ApplicationManager.EnterTechnicianMode(); + } + else + { + ApplicationManager.ExitTechnicianMode(); + } + } + + private void StopJob() + { + _handler?.Cancel(); + } + + #endregion + } +} -- cgit v1.3.1 From 3283eca8d5cb327779d53b6e1744e3440098bb35 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Thu, 16 Mar 2023 18:17:48 +0200 Subject: Eurika UI. Changes in Job details according to figma. Created Job Status page - only GUI. --- .../Dialogs/ColorSelectionView.xaml | 2 +- .../Modules/Tango.PPC.JobsV2/Models/JobModel.cs | 18 + .../Tango.PPC.JobsV2/ViewModels/JobViewVM.cs | 16 + .../Tango.PPC.JobsV2/Views/JobEurekaView.xaml | 234 ++++++--- .../Controls/RunningJobViewerEureka.xaml | 119 +++++ .../Controls/RunningJobViewerEureka.xaml.cs | 77 +++ .../PPC/Tango.PPC.UI/Images/Job Issues/Events.png | Bin 0 -> 646 bytes .../PPC/Tango.PPC.UI/Images/Job Issues/Thread.png | Bin 0 -> 1239 bytes .../PPC/Tango.PPC.UI/Images/Job Issues/input.png | Bin 0 -> 1011 bytes .../Tango.PPC.UI/Images/Job Issues/job_copies.png | Bin 0 -> 978 bytes .../Tango.PPC.UI/Images/Job Issues/job_length.png | Bin 0 -> 1150 bytes .../Tango.PPC.UI/Images/Job Issues/job_weight.png | Bin 0 -> 1192 bytes .../PPC/Tango.PPC.UI/Images/Job Issues/output.png | Bin 0 -> 995 bytes .../PPC/Tango.PPC.UI/Images/Job Issues/spools.png | Bin 0 -> 1177 bytes .../Tango.PPC.UI/Images/Job Issues/thread_type.png | Bin 0 -> 1223 bytes .../Tango.PPC.UI/Images/Job Issues/ttime_left.png | Bin 0 -> 906 bytes .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 17 + .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 43 +- .../PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml | 11 +- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 569 +++++++++++++++++---- .../Tango.Touch/Controls/TouchToggleSlider.xaml | 27 + .../Visual_Studio/Tango.Touch/Resources/Fonts.xaml | 1 + 22 files changed, 927 insertions(+), 207 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/Events.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/Thread.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/input.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/job_copies.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/job_length.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/job_weight.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/output.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/spools.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/thread_type.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/ttime_left.png (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionView.xaml index d020e13ac..d8b3d535b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionView.xaml @@ -667,7 +667,7 @@ - + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs index d2ad7e96b..0009fce24 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs @@ -335,6 +335,24 @@ namespace Tango.PPC.Jobs.Models get { return SpoolType.Guid; } } + private int _copies; + + public int Copies + { + get { return _copies; } + set { _copies = value; RaisePropertyChangedAuto(); } + } + + private int _devidedBySpools; + + public int DevidedBySpools + { + get { return _devidedBySpools; } + set { _devidedBySpools = value; RaisePropertyChangedAuto(); } + } + + + protected User _user; /// diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs index 19e6a22b2..788b1eca3 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs @@ -286,6 +286,8 @@ namespace Tango.PPC.Jobs.ViewModels public RelayCommand DeleteSegmentsGroupCommand { get; set; } public RelayCommand RepeatSegmentsGroupCommand { get; set; } + public RelayCommand NavigateBackToJobs { get; set; } + #endregion #region collapsed mode commands @@ -359,6 +361,7 @@ namespace Tango.PPC.Jobs.ViewModels UndoCommand = new RelayCommand(Undo);//(x) => { return UndoRedoManager.Instance.IsEnableUndoOperation(); } RedoCommand = new RelayCommand(Redo);//(x) => { return UndoRedoManager.Instance.IsEnableRedoOperation();} + NavigateBackToJobs = new RelayCommand(NavigateBack); IsFullMode = true; IsSummaryOpened = true; _not_show_warning = false; @@ -1281,6 +1284,19 @@ namespace Tango.PPC.Jobs.ViewModels } } + private async void NavigateBack() + { + if (IsFree ) + { + if(await OnNavigateBackRequest()) + { + LogManager.Log("Back command to Jobs pressed."); + await NavigationManager.NavigateTo(nameof(JobsView)); + } + + } + } + public override void OnApplicationReady() { base.OnApplicationReady(); diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml index 6999c54d7..f8e881df7 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml @@ -790,12 +790,66 @@ + + + + + + + + + + + + General Settings + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + - @@ -827,32 +881,90 @@ - - - + - + --> + - + + - - + + + + + + + + + + + + + + + + + + Color Properties + + + Select All + + + + + Advanced Options + + + + + + + + + + + + + + + + + + + + + - + - + - + @@ -885,7 +997,7 @@ - + - + - - - - - - - - - - + --> - - - - - - + @@ -1062,10 +1111,27 @@ - + + + + + + + + + + + + + + + - + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml new file mode 100644 index 000000000..72a7660ad --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs new file mode 100644 index 000000000..db6a8c178 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.BL.Entities; +using Tango.Integration.Operation; + +namespace Tango.PPC.UI.Controls +{ + /// + /// Interaction logic for RunningJobViewerEureka.xaml + /// + public partial class RunningJobViewerEureka : UserControl + { + /// + /// Maybe not necessary! + /// + public bool IsActive + { + get { return (bool)GetValue(IsActiveProperty); } + set { SetValue(IsActiveProperty, value); } + } + public static readonly DependencyProperty IsActiveProperty = + DependencyProperty.Register("IsActive", typeof(bool), typeof(RunningJobViewerEureka), new PropertyMetadata(false)); + + /// + /// Gets or sets a value indicating whether summary markers. + /// + public bool DisplayMarkers + { + get { return (bool)GetValue(DisplayMarkersProperty); } + set { SetValue(DisplayMarkersProperty, value); } + } + public static readonly DependencyProperty DisplayMarkersProperty = + DependencyProperty.Register("DisplayMarkers", typeof(bool), typeof(RunningJobViewerEureka), new PropertyMetadata(true)); + + /// + /// Gets or sets the job. + /// + public Job Job + { + get { return (Job)GetValue(JobProperty); } + set { SetValue(JobProperty, value); } + } + public static readonly DependencyProperty JobProperty = + DependencyProperty.Register("Job", typeof(Job), typeof(RunningJobViewerEureka), new PropertyMetadata(null)); + + /// + /// Gets or sets the running job status. + /// + public RunningJobStatus RunningJobStatus + { + get { return (RunningJobStatus)GetValue(RunningJobStatusProperty); } + set { SetValue(RunningJobStatusProperty, value); } + } + public static readonly DependencyProperty RunningJobStatusProperty = + DependencyProperty.Register("RunningJobStatus", typeof(RunningJobStatus), typeof(RunningJobViewerEureka), new PropertyMetadata(null)); + + /// + /// Initializes a new instance of the class. + /// + public RunningJobViewerEureka() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/Events.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/Events.png new file mode 100644 index 000000000..4f76e1c11 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/Events.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/Thread.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/Thread.png new file mode 100644 index 000000000..85d0718f0 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/Thread.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/input.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/input.png new file mode 100644 index 000000000..77dbab1c9 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/input.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/job_copies.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/job_copies.png new file mode 100644 index 000000000..dc3cbf124 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/job_copies.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/job_length.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/job_length.png new file mode 100644 index 000000000..97a177ef4 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/job_length.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/job_weight.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/job_weight.png new file mode 100644 index 000000000..6eb0a6194 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/job_weight.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/output.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/output.png new file mode 100644 index 000000000..53b317042 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/output.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/spools.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/spools.png new file mode 100644 index 000000000..8bb977473 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/spools.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/thread_type.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/thread_type.png new file mode 100644 index 000000000..1e2523a56 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/thread_type.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/ttime_left.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/ttime_left.png new file mode 100644 index 000000000..55622f20f Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/ttime_left.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 14a4d02c1..6249447c4 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 @@ -136,6 +136,9 @@ MachineStatusControl.xaml + + RunningJobViewerEureka.xaml + @@ -292,6 +295,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -534,6 +541,16 @@ + + + + + + + + + + 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 a0d6e2955..594f418a7 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -12,6 +12,8 @@ namespace Tango.PPC.UI.ViewModels { public class MachineStatusViewVM : PPCViewModel { + #region Properties + private JobHandler _handler; private Job _job; @@ -34,11 +36,39 @@ namespace Tango.PPC.UI.ViewModels set { _runningJobStatus = value; RaisePropertyChangedAuto(); } } + private bool _isJobStatusViewEnable; + + public bool IsJobStatusViewEnable + { + get { return _isJobStatusViewEnable; } + set { _isJobStatusViewEnable = value; RaisePropertyChangedAuto(); } + } + + #endregion + + #region Commands + public RelayCommand StopCommand { get; set; } + /// + /// Gets or sets the job status view command. + /// + public RelayCommand JobStatusViewCommand { get; set; } + + /// + /// Gets or sets the overview view command. + /// + public RelayCommand OverviewViewCommand { get; set; } + + #endregion + public MachineStatusViewVM() { StopCommand = new RelayCommand(StopJob); + JobStatusViewCommand = new RelayCommand(JobStatusView); + OverviewViewCommand = new RelayCommand(OverviewView); + + IsJobStatusViewEnable = true; } public override void OnApplicationStarted() @@ -73,7 +103,7 @@ namespace Tango.PPC.UI.ViewModels RunningJobStatus = e; }); } - + #region Public Methods /// @@ -96,6 +126,17 @@ namespace Tango.PPC.UI.ViewModels _handler?.Cancel(); } + protected void JobStatusView() + { + IsJobStatusViewEnable = true; + } + + protected void OverviewView() + { + IsJobStatusViewEnable = false; + } + + #endregion } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml index d496d4d14..f81b493ff 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml @@ -48,13 +48,6 @@ - - - - - @@ -216,9 +209,9 @@ - + - + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index 0879fcaab..ca7aa957b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -9,141 +9,486 @@ xmlns:global="clr-namespace:Tango.PPC.UI" xmlns:local="clr-namespace:Tango.PPC.UI.Views" mc:Ignorable="d" - d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MachineStatusViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MachineStatusViewVM}"> - - - - - - - - - - - - - + d:DesignHeight="1280" d:DesignWidth="932" d:DataContext="{d:DesignInstance Type=vm:MachineStatusViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MachineStatusViewVM}"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Go To Job + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Thread Type + + + + + + + + Job Length + + + + + + + Job Weight + + + + + + + Copies + + + + + + + Spools + + + + + + + + + + + - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - Completed - + + + + + - + + + + + + Completed + + + m - - + + - - - - Getting Ready... + + + + Getting Ready... + - - + - - - Time Left - + + + Time Left + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Job Length + + + + + + + Job Weight + + + + + + + Copies + + + + + + + Time Left + + + + - + + + + + + + + + + + + Input + + + + + L + 86 + + + + A + 86 + + + + B + 86 + + + + + + + Output + + + + + C + 86 + + + + M + 86 + + + + Y + 86 + + + + K + 86 + + + + - + 86 + + + + - + 86 + + + + - + 86 + + + + + + - + + + + + + diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchToggleSlider.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchToggleSlider.xaml index 2f758ec8c..7d26fdcff 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchToggleSlider.xaml +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchToggleSlider.xaml @@ -132,4 +132,31 @@ + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml b/Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml index f8db0094f..e1f249008 100644 --- a/Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml +++ b/Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml @@ -29,4 +29,5 @@ 27 46 + 42 \ No newline at end of file -- cgit v1.3.1 From c61d12100372054de07f6201c27c7755c7be35e8 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Wed, 29 Mar 2023 17:51:32 +0300 Subject: Eureka PPC. Added weight of job by length and RML. --- .../Modules/Tango.PPC.JobsV2/Models/JobModel.cs | 7 +- .../Tango.PPC.JobsV2/Models/SegmentModel.cs | 127 +++++++++---- .../Tango.PPC.JobsV2/ViewModels/JobViewVM.cs | 24 ++- .../Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs | 23 ++- .../Tango.PPC.JobsV2/Views/JobEurekaView.xaml | 108 +++++++---- .../Controls/RunningJobViewerEureka.xaml | 197 +++++++++++---------- .../Converters/LengthToWeightConverter.cs | 35 ++++ .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 1 + .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 100 ++++++++++- .../PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml | 18 +- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 145 +++++++-------- Software/Visual_Studio/Tango.BL/Entities/Job.cs | 112 ++++++++++++ Software/Visual_Studio/Tango.BL/Entities/Rml.cs | 24 +++ .../Tango.Touch/Resources/Colors.xaml | 2 + .../Tango.Touch/Styles/TouchScrollViewer.xaml | 43 +++++ 15 files changed, 694 insertions(+), 272 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs index 22ea1c7f1..42817daaa 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs @@ -131,6 +131,7 @@ namespace Tango.PPC.Jobs.Models _numberofunits = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(LengthIncludingNumberOfUnits)); + RaisePropertyChanged(nameof(LengthIncludingNumberOfUnitsAndSpools)); RaisePropertyChanged(nameof(GetEstimatedDuration)); } } @@ -659,6 +660,9 @@ namespace Tango.PPC.Jobs.Models } } + + + [JsonIgnore] public bool IsEureka { get; set; } @@ -1045,7 +1049,8 @@ namespace Tango.PPC.Jobs.Models } RaisePropertyChanged(nameof(Length)); RaisePropertyChanged(nameof(LengthIncludingNumberOfUnits)); - + RaisePropertyChanged(nameof(LengthIncludingNumberOfUnitsAndSpools)); + } RaisePropertyChanged(nameof(GetEstimatedDuration)); } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/SegmentModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/SegmentModel.cs index 40450c001..5d6c53c59 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/SegmentModel.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/SegmentModel.cs @@ -96,7 +96,23 @@ namespace Tango.PPC.Jobs.Models UndoRedoManager.Instance.InsertAndExecuteCommand(new ChangeLengthCommand(this, _lastLength, value)); _lastLength = Length; } - + + private double _weight; + + public double Weight + { + get { return _weight; } + set + { + if(_weight != value) + { + _weight = value; + OnWeightChanged(); + RaisePropertyChangedAuto(); + } + } + } + protected Int32 _segmentindex; /// /// Gets or sets the index of the segment. @@ -813,19 +829,45 @@ namespace Tango.PPC.Jobs.Models /// /// Called when the Length has changed. - /// - /// protected void OnLengthChanged(double length) { - //if (_lastLength != length) + if (Job != null && Job.Rml != null) { + var gramPerlength = Job.Rml.GetGramPer1000mLength; + var weight = (Length * gramPerlength)/( 1000 *1000);//(kg) + _weight = weight; + RaisePropertyChanged(nameof(Weight)); + //if (_lastLength != length) + { + BrushStops.ToList().ForEach(x => x.RaiseOffsetChanged()); + //_lastLength = Length; + //RaisePropertyChanged(nameof(LengthWithFactor)); + RaisePropertyChanged(nameof(LengthWithInterSegment)); + RaisePropertyChanged(nameof(LeftOffsetLabel)); + RaisePropertyChanged(nameof(MiddleOffsetLabel)); + RaisePropertyChanged(nameof(RightOffsetLabel)); + } + } + } + + /// + /// Called when [weight changed]. + /// + private void OnWeightChanged() + { + if (Job != null && Job.Rml != null) + { + var gramPerlength = Job.Rml.GetGramPer1000mLength; + var length = (Weight * 1000 * 1000)/ gramPerlength;//(m) + _length = length; + RaisePropertyChanged(nameof(Length)); + BrushStops.ToList().ForEach(x => x.RaiseOffsetChanged()); - //_lastLength = Length; - //RaisePropertyChanged(nameof(LengthWithFactor)); RaisePropertyChanged(nameof(LengthWithInterSegment)); RaisePropertyChanged(nameof(LeftOffsetLabel)); RaisePropertyChanged(nameof(MiddleOffsetLabel)); RaisePropertyChanged(nameof(RightOffsetLabel)); + } } @@ -834,49 +876,62 @@ namespace Tango.PPC.Jobs.Models /// /// protected void OnBrushStopsChanged(SynchronizedObservableCollection brushstops) - { - if (brushstops != null) { - brushstops.CollectionChanged -= BrushStops_CollectionChanged; - brushstops.CollectionChanged += BrushStops_CollectionChanged; - - foreach (var stop in brushstops.ToList()) + if (brushstops != null) { - stop.RaiseOffsetChanged(); + brushstops.CollectionChanged -= BrushStops_CollectionChanged; + brushstops.CollectionChanged += BrushStops_CollectionChanged; + + foreach (var stop in brushstops.ToList()) + { + stop.RaiseOffsetChanged(); + } + + RaiseSegmentBrushChanged(); } + } - RaiseSegmentBrushChanged(); + private void AddGap() + { + EnableInterSegment = true; } - } - private void AddGap() - { - EnableInterSegment = true; - } + private void DeleteGap() + { + EnableInterSegment = false; + } - private void DeleteGap() - { - EnableInterSegment = false; - } + public void UpdateBrushStops() + { + foreach (var stop in BrushStops.Where(x => x.ColorSpace == BL.Enumerations.ColorSpaces.RGB || x.ColorSpace == BL.Enumerations.ColorSpaces.LAB).ToList()) + { + try + { + stop.OnBrushStopFieldValueChanged(); + stop.InitColorsFromBestmatch(); + //TODO ASK ROY!!!!!! + //output.ApplyOnBrushStopVolumesOnly(stop); + } + catch (Exception ex) + { + LogManager.Log(ex, $"Error updating stop volumes after changing thread on segment {stop.SegmentModel.SegmentIndex}, stop {stop.StopIndex}."); + } + } + } - public void UpdateBrushStops() - { - foreach (var stop in BrushStops.Where(x => x.ColorSpace == BL.Enumerations.ColorSpaces.RGB || x.ColorSpace == BL.Enumerations.ColorSpaces.LAB).ToList()) + public void UpdateWeightOnRMLChange( bool isWeightView) { - try + if(isWeightView) { - stop.OnBrushStopFieldValueChanged(); - stop.InitColorsFromBestmatch(); - //TODO ASK ROY!!!!!! - //output.ApplyOnBrushStopVolumesOnly(stop); + OnWeightChanged(); } - catch (Exception ex) + else { - LogManager.Log(ex, $"Error updating stop volumes after changing thread on segment {stop.SegmentModel.SegmentIndex}, stop {stop.StopIndex}."); + OnLengthChanged(Length); } } + + + #endregion } - - #endregion } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs index 7dcc349c1..02ed4d27d 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs @@ -255,7 +255,21 @@ namespace Tango.PPC.Jobs.ViewModels RaisePropertyChangedAuto(); } } + private bool _isWeigthView; + public bool IsWeightView + { + get { return _isWeigthView; } + set { + if(_isWeigthView != value) + { + _isWeigthView = value; + + RaisePropertyChangedAuto(); + } + } + } + #endregion #region Commands @@ -463,8 +477,8 @@ namespace Tango.PPC.Jobs.ViewModels //await SetSpoolTension(Job.Rml); LogManager.Log("Loading RMLS..."); - Rmls = (await new RmlsCollectionBuilder(_db).SetAll().WithSpools().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildAsync()).OrderBy(x => x.FinalName).ToList(); - //Rmls = (await new RmlsCollectionBuilder(_db).SetAll().WithSpools().BuildAsync()).OrderBy(x => x.FinalName).ToList(); + //Rmls = (await new RmlsCollectionBuilder(_db).SetAll().WithSpools().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildAsync()).OrderBy(x => x.FinalName).ToList(); + Rmls = (await new RmlsCollectionBuilder(_db).SetAll().WithSpools().BuildAsync()).OrderBy(x => x.FinalName).ToList(); LogManager.Log("Loading Color Spaces..."); ColorSpaces = await _db.ColorSpaces.Where(x => x.Code != (int)BL.Enumerations.ColorSpaces.CMYK).ToListAsync(); LogManager.Log("Loading Spool Types..."); @@ -483,6 +497,7 @@ namespace Tango.PPC.Jobs.ViewModels IsBasicMode = true; } else IsBasicMode = false; + IsWeightView = false; LoadJobModel(); @@ -891,7 +906,9 @@ namespace Tango.PPC.Jobs.ViewModels .WithSpools() .BuildAsync(); if (JobModel != null) + { JobModel.Rml = Job.Rml; + } if (updateRML && JobModel != null) { @@ -900,12 +917,15 @@ namespace Tango.PPC.Jobs.ViewModels { if (segment is SegmentModel innerSegment) { + innerSegment.UpdateWeightOnRMLChange(IsWeightView); innerSegment.UpdateBrushStops(); + } else if (segment is SegmentsGroupModel group) { foreach (var segm in group.Segments) { + segm.UpdateWeightOnRMLChange(IsWeightView); segm.UpdateBrushStops(); } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs index 448ba7a57..ebc396a39 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs @@ -542,11 +542,22 @@ namespace Tango.PPC.Jobs.ViewModels await Task.Delay(200); - await NavigationManager.NavigateWithObject(new JobNavigationObject() + if(BuildProvider.IsEureka) { - Job = job, - Intent = JobNavigationIntent.NewJob - }); + await NavigationManager.NavigateWithObject(new JobNavigationObject() + { + Job = job, + Intent = JobNavigationIntent.NewJob + }); + } + else + { + await NavigationManager.NavigateWithObject(new JobNavigationObject() + { + Job = job, + Intent = JobNavigationIntent.NewJob + }); + } } catch (Exception ex) { @@ -694,8 +705,8 @@ namespace Tango.PPC.Jobs.ViewModels using (ObservablesContext db = ObservablesContext.CreateDefault()) { _catalogs = await new CatalogsCollectionBuilder(db).SetAll().ForSite(MachineProvider.Machine.SiteGuid).BuildAsync(); - _rmls = await new RmlsCollectionBuilder(db).SetAll().WithSpools().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildAsync(); - //_rmls = (await new RmlsCollectionBuilder(db).SetAll().WithSpools().BuildAsync()).OrderBy(x => x.FinalName).ToObservableCollection(); + //_rmls = await new RmlsCollectionBuilder(db).SetAll().WithSpools().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildAsync(); + _rmls = (await new RmlsCollectionBuilder(db).SetAll().WithSpools().BuildAsync()).OrderBy(x => x.FinalName).ToObservableCollection(); _spoolTypes = db.SpoolTypes.ToObservableCollection(); } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml index 979bca54c..7e042c82c 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml @@ -209,14 +209,15 @@ - + + - + @@ -238,9 +239,21 @@ - - - + + + + + + + + + + @@ -409,10 +430,11 @@ - + + - + + --> - + - + + @@ -554,7 +577,9 @@ - + + + + --> - + @@ -808,7 +833,7 @@ - + @@ -911,7 +936,7 @@ - + @@ -963,7 +988,7 @@ - @@ -984,22 +1009,39 @@ - - - - - - + + + + + + + - - - - + + + + + + + @@ -1151,12 +1193,12 @@ - + - + @@ -1195,7 +1237,7 @@ - + @@ -1204,7 +1246,7 @@ - + @@ -1220,7 +1262,7 @@ - + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml index 72a7660ad..559266d28 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml @@ -3,117 +3,124 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" xmlns:local="clr-namespace:Tango.PPC.UI.Controls" xmlns:enumerations="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL" mc:Ignorable="d" d:DesignHeight="60" d:DesignWidth="500" Height="38" d:DataContext="{d:DesignInstance Type=local:RunningJobViewerEureka, IsDesignTimeCreatable=False}"> + + + + - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - + + + + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs new file mode 100644 index 000000000..32ba01ad2 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Data; + +namespace Tango.PPC.UI.Converters +{ + public class LengthToWeightConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + try + { + double length = System.Convert.ToDouble(values[0]); + double coef = System.Convert.ToDouble(values[1]); + var weight = ((double)length * coef) / (1000 * 1000);//(kg) + + return weight; + } + catch + { + return 0d; + } + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} 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 6249447c4..88bbcc92e 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 @@ -141,6 +141,7 @@ + BitResultsView.xaml 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 594f418a7..f22d43b19 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -7,6 +7,9 @@ using Tango.BL.Entities; using Tango.Core.Commands; using Tango.Integration.Operation; using Tango.PPC.Common; +using Tango.PPC.Jobs; +using Tango.PPC.Jobs.NavigationObjects; +using Tango.PPC.Jobs.Views; namespace Tango.PPC.UI.ViewModels { @@ -44,12 +47,37 @@ namespace Tango.PPC.UI.ViewModels set { _isJobStatusViewEnable = value; RaisePropertyChangedAuto(); } } + private bool _isEnabledStopButton; + /// + /// Gets or sets a value indicating whether this instance is enabled stop button. + /// + public bool IsEnabledStopButton + { + get { return _isEnabledStopButton; } + set { _isEnabledStopButton = value; RaisePropertyChangedAuto(); } + } + + private bool _isSpoolView; + /// + /// Gets or sets a value indicating whether this instance is spool view. + /// + public bool IsSpoolView + { + get { return _isSpoolView; } + set { _isSpoolView = value; RaisePropertyChangedAuto(); } + } + + #endregion #region Commands public RelayCommand StopCommand { get; set; } + public RelayCommand AbortCommand { get; set; } + + public RelayCommand GoToJobCommand { get; set; } + /// /// Gets or sets the job status view command. /// @@ -64,16 +92,26 @@ namespace Tango.PPC.UI.ViewModels public MachineStatusViewVM() { - StopCommand = new RelayCommand(StopJob); + StopCommand = new RelayCommand(StopJob, ()=>CanStopped()); + AbortCommand = new RelayCommand(AbortJob, () => CanStopped()); + GoToJobCommand = new RelayCommand(GoToJob); JobStatusViewCommand = new RelayCommand(JobStatusView); OverviewViewCommand = new RelayCommand(OverviewView); IsJobStatusViewEnable = true; + IsEnabledStopButton = false; + IsSpoolView = false; } - + public override void OnApplicationStarted() { MachineProvider.MachineOperator.PrintingStarted += MachineOperator_PrintingStarted; + MachineProvider.MachineOperator.PrintingEnded += MachineOperator_PrintingEnded; + } + + private bool CanStopped() + { + return IsEnabledStopButton; } private void MachineOperator_PrintingStarted(object sender, PrintingEventArgs e) @@ -83,7 +121,15 @@ namespace Tango.PPC.UI.ViewModels e.JobHandler.StatusChanged += JobHandler_StatusChanged; //e.JobHandler.SpoolChangeRequired += JobHandler_SpoolChangeRequired; e.JobHandler.Stopped += JobHandler_Stopped; - //e.JobHandler.CanCancelChanged += JobHandler_CanCancelChanged; + e.JobHandler.CanCancelChanged += JobHandler_CanCancelChanged; + InvokeUI(() => + { + IsEnabledStopButton = true; + StopCommand.RaiseCanExecuteChanged(); + AbortCommand.RaiseCanExecuteChanged(); + }); + + } private void JobHandler_Stopped(object sender, EventArgs e) @@ -93,9 +139,22 @@ namespace Tango.PPC.UI.ViewModels _handler.StatusChanged -= JobHandler_StatusChanged; //_handler.SpoolChangeRequired -= JobHandler_SpoolChangeRequired; _handler.Stopped -= JobHandler_Stopped; + _handler.StatusChanged -= JobHandler_StatusChanged; + _handler.CanCancelChanged -= JobHandler_CanCancelChanged; } } + private void MachineOperator_PrintingEnded(object sender, PrintingEventArgs e) + { + LogManager.Log("Printing ended"); + InvokeUI(() => + { + IsEnabledStopButton = false; + StopCommand.RaiseCanExecuteChanged(); + AbortCommand.RaiseCanExecuteChanged(); + }); + } + private void JobHandler_StatusChanged(object sender, RunningJobStatus e) { InvokeUI(() => @@ -103,7 +162,35 @@ namespace Tango.PPC.UI.ViewModels RunningJobStatus = e; }); } - + + private void JobHandler_CanCancelChanged(object sender, EventArgs e) + { + InvokeUI( () => + { + IsEnabledStopButton = _handler.CanCancel; + StopCommand.RaiseCanExecuteChanged(); + AbortCommand.RaiseCanExecuteChanged(); + }); + } + + private void StopJob() + { + _handler?.Cancel(); + } + + private void AbortJob() + { + _handler?.Cancel(); + Job = null; + } + + private void GoToJob() + { + + // NavigationManager.NavigateWithObject(new JobNavigationObject() { Job = _handler.Job }); + // NavigationManager.ClearHistoryExcept(); + + } #region Public Methods /// @@ -121,10 +208,7 @@ namespace Tango.PPC.UI.ViewModels } } - private void StopJob() - { - _handler?.Cancel(); - } + protected void JobStatusView() { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml index 402af001c..097245990 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml @@ -35,9 +35,9 @@ - + - + @@ -59,10 +59,10 @@ - + - + @@ -73,10 +73,10 @@ - + - Update + Update @@ -84,7 +84,7 @@ - + - + - Power + Power diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index 243fa8584..f681a5112 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -6,12 +6,15 @@ xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels" xmlns:locaControls="clr-namespace:Tango.PPC.UI.Controls" + xmlns:locaConverters="clr-namespace:Tango.PPC.UI.Converters" xmlns:global="clr-namespace:Tango.PPC.UI" xmlns:local="clr-namespace:Tango.PPC.UI.Views" mc:Ignorable="d" d:DesignHeight="1280" d:DesignWidth="932" d:DataContext="{d:DesignInstance Type=vm:MachineStatusViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MachineStatusViewVM}"> - + + + - - - - - - - - - - - + + + @@ -162,39 +135,10 @@ --> - - - - - - - - - - - - - - + + - - + @@ -207,28 +151,50 @@ Job Length - + + + + + + - Job Weight - + + + + + Copies - + Spools - + @@ -329,7 +295,7 @@ - + + + \ No newline at end of file -- cgit v1.3.1 From 3dcf3242705a7522617d4b5f7ca4d9b918e48ca5 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Thu, 30 Mar 2023 19:41:54 +0300 Subject: Eureka PPC. GoToJob, Notifications, LengthWothSpool. --- .../Tango.PPC.JobsV2/ViewModels/JobViewVM.cs | 28 +- .../Tango.PPC.JobsV2/Views/JobEurekaView.xaml | 2 +- .../Converters/LengthToWeightConverter.cs | 4 +- .../Converters/LengthWithSpoolsConverter.cs | 33 +++ .../Tango.PPC.UI/Modules/DefaultPPCModuleLoader.cs | 6 +- .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 5 +- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 4 +- .../Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs | 6 +- .../PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml | 12 +- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 313 ++++++++++++++------- Software/Visual_Studio/Tango.BL/Entities/Job.cs | 2 +- .../Tango.Integration/Operation/MachineOperator.cs | 10 +- 12 files changed, 290 insertions(+), 135 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthWithSpoolsConverter.cs (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs index 02ed4d27d..da021858c 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs @@ -68,7 +68,6 @@ namespace Tango.PPC.Jobs.ViewModels private string _current_job_string; private bool startingJob = false; private List _catalogs; - private string _jsonJobModelLoaded; #region Properties @@ -88,7 +87,6 @@ namespace Tango.PPC.Jobs.ViewModels } private JobModel _jobModel; - public JobModel JobModel { get { return _jobModel; } @@ -99,6 +97,10 @@ namespace Tango.PPC.Jobs.ViewModels } } + public bool CanEdit + { + get { return !MachineProvider.MachineOperator.IsPrinting || MachineProvider.MachineOperator.RunningJob.Guid != Job.Guid; } + } private ICollectionView _segmentsCollectionView; /// @@ -407,12 +409,12 @@ namespace Tango.PPC.Jobs.ViewModels #endregion - #region Job Management + #region Job Management - /// + /// /// Loads the job. /// - private async void LoadJob() + private async void LoadJob() { try { @@ -468,6 +470,8 @@ namespace Tango.PPC.Jobs.ViewModels .WithSegmentsGroups() .BuildAsync(); + RaisePropertyChanged(nameof(CanEdit)); + Job.NameChanged -= Job_NameChanged; Job.NameChanged += Job_NameChanged; @@ -477,8 +481,8 @@ namespace Tango.PPC.Jobs.ViewModels //await SetSpoolTension(Job.Rml); LogManager.Log("Loading RMLS..."); - //Rmls = (await new RmlsCollectionBuilder(_db).SetAll().WithSpools().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildAsync()).OrderBy(x => x.FinalName).ToList(); - Rmls = (await new RmlsCollectionBuilder(_db).SetAll().WithSpools().BuildAsync()).OrderBy(x => x.FinalName).ToList(); + Rmls = (await new RmlsCollectionBuilder(_db).SetAll().WithSpools().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildAsync()).OrderBy(x => x.FinalName).ToList(); + //Rmls = (await new RmlsCollectionBuilder(_db).SetAll().WithSpools().BuildAsync()).OrderBy(x => x.FinalName).ToList(); LogManager.Log("Loading Color Spaces..."); ColorSpaces = await _db.ColorSpaces.Where(x => x.Code != (int)BL.Enumerations.ColorSpaces.CMYK).ToListAsync(); LogManager.Log("Loading Spool Types..."); @@ -712,6 +716,8 @@ namespace Tango.PPC.Jobs.ViewModels await Save(); var handler = await PrintingManager.Print(Job, _db, new PrintingConfiguration() { }); + RaisePropertyChanged(nameof(CanEdit)); + if (!BuildProvider.IsEureka) { await NavigationManager.NavigateTo(nameof(JobProgressView)); @@ -1255,6 +1261,12 @@ namespace Tango.PPC.Jobs.ViewModels base.OnApplicationStarted(); MachineProvider.MachineOperator.PrintingEnded += MachineOperator_PrintingEnded; + MachineProvider.MachineOperator.PrintingStarted += MachineOperator_PrintingStarted; + } + + private void MachineOperator_PrintingStarted(object sender, PrintingEventArgs e) + { + RaisePropertyChanged(nameof(CanEdit)); } private void MachineOperator_PrintingEnded(object sender, Integration.Operation.PrintingEventArgs e) @@ -1263,6 +1275,8 @@ namespace Tango.PPC.Jobs.ViewModels { _start_printing_btn.Push(); } + + RaisePropertyChanged(nameof(CanEdit)); } /// diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml index 7e042c82c..bbd05ae8e 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml @@ -819,7 +819,7 @@ - + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs index 32ba01ad2..d7e70b881 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs @@ -17,8 +17,8 @@ namespace Tango.PPC.UI.Converters { double length = System.Convert.ToDouble(values[0]); double coef = System.Convert.ToDouble(values[1]); - var weight = ((double)length * coef) / (1000 * 1000);//(kg) - + double spools = System.Convert.ToDouble(values[3]); + var weight = ((double)length * spools * coef) / (1000 * 1000);//(kg) return weight; } catch diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthWithSpoolsConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthWithSpoolsConverter.cs new file mode 100644 index 000000000..48e9bce7b --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthWithSpoolsConverter.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Data; + +namespace Tango.PPC.UI.Converters +{ + public class LengthWithSpoolsConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + try + { + double length = System.Convert.ToDouble(values[0]); + double spools = System.Convert.ToDouble(values[1]); + return length * spools; + } + catch + { + return 0d; + } + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Modules/DefaultPPCModuleLoader.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Modules/DefaultPPCModuleLoader.cs index d0f6484ab..14f9db927 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Modules/DefaultPPCModuleLoader.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Modules/DefaultPPCModuleLoader.cs @@ -97,8 +97,8 @@ namespace Tango.PPC.UI.Modules } else { - LogManager.Log(String.Format("Loading module '{0}'...", nameof(JobsModule))); - AllModules.Add(new JobsModule()); + //LogManager.Log(String.Format("Loading module '{0}'...", nameof(JobsModule))); + //AllModules.Add(new JobsModule()); } //Preloaded @@ -142,7 +142,7 @@ namespace Tango.PPC.UI.Modules if (settings.UseJobsModuleV2) { - var legacyJobsModule = AllModules.SingleOrDefault(x => x.GetType() == typeof(JobsModule)); + var legacyJobsModule = AllModules.SingleOrDefault(x => x.GetType().Name == "JobsModule"); AllModules.Remove(legacyJobsModule); } else 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 88bbcc92e..7ed27a3ce 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 @@ -142,6 +142,7 @@ + BitResultsView.xaml @@ -666,10 +667,6 @@ {dbbd90f4-4135-475d-a8f8-6795d3a8f697} Tango.PPC.JobsV2 - - {096f16c8-6d06-4b5f-9496-b9d2df2d94a3} - Tango.PPC.Jobs - {91b70e9b-66a7-4873-ae10-400e71cf404f} Tango.PPC.MachineSettings 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 f22d43b19..77b883150 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -187,8 +187,8 @@ namespace Tango.PPC.UI.ViewModels private void GoToJob() { - // NavigationManager.NavigateWithObject(new JobNavigationObject() { Job = _handler.Job }); - // NavigationManager.ClearHistoryExcept(); + NavigationManager.NavigateWithObject(new JobNavigationObject() { Job = _handler.Job }); + NavigationManager.ClearHistoryExcept(); } #region Public Methods 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 14b9b76e3..7caabf6a1 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs @@ -566,7 +566,11 @@ namespace Tango.PPC.UI.ViewModels { _updateNotificationItem = null; }; - NotificationProvider.PushNotification(_updateNotificationItem); + + if (!BuildProvider.IsEureka) + { + NotificationProvider.PushNotification(_updateNotificationItem); + } }); } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml index 097245990..fe42576b4 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml @@ -61,8 +61,8 @@ - - + + @@ -75,8 +75,8 @@ - - Update + + Update @@ -192,8 +192,8 @@ - - Power + + Power diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index f681a5112..bbb6127e5 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -14,6 +14,7 @@ + - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - Completed - + - - - m - - + + + + Completed + + + + + + + + + + + + + + + + + + + + + + - - - - Getting Ready... - - + + + + Getting Ready... + + - + - - - Time Left - + + + Time Left + - + - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - @@ -347,8 +363,15 @@ - Job Length - + Job Length + + + + + + + + @@ -357,9 +380,10 @@ Job Weight - - - + + + + @@ -430,33 +454,33 @@ 86 - - M + + LC 86 - - Y + + M 86 - - K + + LM 86 - - - + + Y 86 - - - + + LY 86 - - - + + K 86 @@ -470,6 +494,87 @@ - + + + + + + + + + + + Notifications + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/Tango.BL/Entities/Job.cs b/Software/Visual_Studio/Tango.BL/Entities/Job.cs index bfcd19cb1..f4bde2599 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Job.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Job.cs @@ -405,7 +405,7 @@ namespace Tango.BL.Entities [NotMapped] [JsonIgnore] - public double GramPerLength { get; private set;} + public double GramPerLength { get; set;} #endregion diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index c5841a8b5..92fc9cc1c 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -2884,12 +2884,12 @@ namespace Tango.Integration.Operation await fileUploadHandler.Cancel(); fileUploadHandler = null; LogManager.Log("Job upload canceled."); - OnPrintingAborted(handler, jobForJobRun); - handler.RaiseCanceled(); if (Status != MachineStatuses.Disconnected) { UpdateStatus(MachineStatuses.ReadyToDye); } + OnPrintingAborted(handler, jobForJobRun); + handler.RaiseCanceled(); } else { @@ -2899,12 +2899,14 @@ namespace Tango.Integration.Operation } SaveLastJobLiquidQuantities(clonedJob, originalJob.Machine.Configuration, processParameters, handler); - OnPrintingAborted(handler, jobForJobRun); - handler.RaiseCanceled(); + if (Status != MachineStatuses.Disconnected) { UpdateStatus(MachineStatuses.ReadyToDye); } + + OnPrintingAborted(handler, jobForJobRun); + handler.RaiseCanceled(); } } } -- cgit v1.3.1 From 37f64f8193684ebe99b29bf0ccef2863b69722d1 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Sun, 2 Apr 2023 22:00:15 +0300 Subject: Eureka PPC. Input brush stop content control. Weight in gram. --- .../Tango.PPC.JobsV2/Models/SegmentModel.cs | 4 +- .../Tango.PPC.JobsV2/Views/JobEurekaView.xaml | 10 +- .../Converters/LengthToWeightConverter.cs | 6 +- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 45 +++++- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 169 +++++++++++++++++---- Software/Visual_Studio/Tango.BL/Entities/Job.cs | 4 +- .../Visual_Studio/Tango.BL/Entities/Segment.cs | 10 ++ 7 files changed, 207 insertions(+), 41 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/SegmentModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/SegmentModel.cs index 5d6c53c59..fb4932a2e 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/SegmentModel.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/SegmentModel.cs @@ -834,7 +834,7 @@ namespace Tango.PPC.Jobs.Models if (Job != null && Job.Rml != null) { var gramPerlength = Job.Rml.GetGramPer1000mLength; - var weight = (Length * gramPerlength)/( 1000 *1000);//(kg) + var weight = (Length * gramPerlength)/( 1000 );//(kg) _weight = weight; RaisePropertyChanged(nameof(Weight)); //if (_lastLength != length) @@ -858,7 +858,7 @@ namespace Tango.PPC.Jobs.Models if (Job != null && Job.Rml != null) { var gramPerlength = Job.Rml.GetGramPer1000mLength; - var length = (Weight * 1000 * 1000)/ gramPerlength;//(m) + var length = (Weight * 1000 )/ gramPerlength;//(m) weight in gr _length = length; RaisePropertyChanged(nameof(Length)); diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml index bbd05ae8e..cb26d5a3a 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml @@ -242,7 +242,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -173,10 +262,10 @@ @@ -380,7 +469,7 @@ Job Weight - + @@ -411,7 +500,7 @@ - + @@ -424,24 +513,52 @@ Input - - - - L - 86 - - - - A - 86 - - - - B - 86 - - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -503,9 +620,9 @@ - - Notifications - + + Notifications + diff --git a/Software/Visual_Studio/Tango.BL/Entities/Job.cs b/Software/Visual_Studio/Tango.BL/Entities/Job.cs index f4bde2599..2784dea32 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Job.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Job.cs @@ -118,7 +118,7 @@ namespace Tango.BL.Entities return 0; var gramPerlength = Rml.GetGramPer1000mLength; - var weight = (LengthIncludingNumberOfUnits * gramPerlength) / (1000 * 1000);//(kg) + var weight = (LengthIncludingNumberOfUnits * gramPerlength) / (1000 );//(g) return weight; } } @@ -637,7 +637,7 @@ namespace Tango.BL.Entities double length = GetLength(); - var weight = (length * GramPerLength) / (1000 * 1000);//length in m, return value in kg + var weight = (length * GramPerLength) / (1000 );//length in m, return value in g return weight; } diff --git a/Software/Visual_Studio/Tango.BL/Entities/Segment.cs b/Software/Visual_Studio/Tango.BL/Entities/Segment.cs index be72100a5..5a99442e4 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Segment.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Segment.cs @@ -271,6 +271,16 @@ namespace Tango.BL.Entities } } + public BrushStop FirstBrushStop + { + get { if (BrushStops.Count == 1)//Intersegment?? - null + return BrushStops[0]; + else if(BrushStops.Count >= 5) + return BrushStops[1]; + else + return null; } + } + public static Color GetRelativeRGB(Color first, Color second, double firstOffset, double secondOffset, double offset) { var color = new Color(); -- cgit v1.3.1 From 24b3ae08ee6da1350f31541cf4966958cfde8a74 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Mon, 3 Apr 2023 15:54:50 +0300 Subject: Added font Poppins. Changes in GUI. --- .../Controls/JobModelSummaryViewerControl.xaml | 1 + .../Controls/JobModelSummaryViewerControl.xaml.cs | 11 ++ .../Tango.PPC.JobsV2/Views/JobEurekaView.xaml | 2 +- .../PPC/Tango.PPC.Common/Fonts/Poppins-Black.ttf | Bin 0 -> 151396 bytes .../Tango.PPC.Common/Fonts/Poppins-BlackItalic.ttf | Bin 0 -> 171604 bytes .../PPC/Tango.PPC.Common/Fonts/Poppins-Bold.ttf | Bin 0 -> 153944 bytes .../Tango.PPC.Common/Fonts/Poppins-BoldItalic.ttf | Bin 0 -> 176588 bytes .../Tango.PPC.Common/Fonts/Poppins-ExtraBold.ttf | Bin 0 -> 152764 bytes .../Fonts/Poppins-ExtraBoldItalic.ttf | Bin 0 -> 173916 bytes .../Tango.PPC.Common/Fonts/Poppins-ExtraLight.ttf | Bin 0 -> 161456 bytes .../Fonts/Poppins-ExtraLightItalic.ttf | Bin 0 -> 186168 bytes .../PPC/Tango.PPC.Common/Fonts/Poppins-Italic.ttf | Bin 0 -> 182012 bytes .../PPC/Tango.PPC.Common/Fonts/Poppins-Light.ttf | Bin 0 -> 159892 bytes .../Tango.PPC.Common/Fonts/Poppins-LightItalic.ttf | Bin 0 -> 184460 bytes .../PPC/Tango.PPC.Common/Fonts/Poppins-Medium.ttf | Bin 0 -> 156520 bytes .../Fonts/Poppins-MediumItalic.ttf | Bin 0 -> 180444 bytes .../PPC/Tango.PPC.Common/Fonts/Poppins-Regular.ttf | Bin 0 -> 158240 bytes .../Tango.PPC.Common/Fonts/Poppins-SemiBold.ttf | Bin 0 -> 155232 bytes .../Fonts/Poppins-SemiBoldItalic.ttf | Bin 0 -> 178584 bytes .../PPC/Tango.PPC.Common/Fonts/Poppins-Thin.ttf | Bin 0 -> 161652 bytes .../Tango.PPC.Common/Fonts/Poppins-ThinItalic.ttf | Bin 0 -> 187044 bytes .../PPC/Tango.PPC.Common/Resources/Fonts.xaml | 5 +- .../PPC/Tango.PPC.Common/Tango.PPC.Common.csproj | 20 +++- Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml | 1 + .../Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml | 2 +- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 2 +- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 119 ++++++++++++++------- 27 files changed, 121 insertions(+), 42 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Black.ttf create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-BlackItalic.ttf create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Bold.ttf create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-BoldItalic.ttf create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraBold.ttf create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraBoldItalic.ttf create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraLight.ttf create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraLightItalic.ttf create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Italic.ttf create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Light.ttf create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-LightItalic.ttf create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Medium.ttf create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-MediumItalic.ttf create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Regular.ttf create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-SemiBold.ttf create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-SemiBoldItalic.ttf create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Thin.ttf create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ThinItalic.ttf (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Controls/JobModelSummaryViewerControl.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Controls/JobModelSummaryViewerControl.xaml index afd05e902..4c2e0ba62 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Controls/JobModelSummaryViewerControl.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Controls/JobModelSummaryViewerControl.xaml @@ -104,6 +104,7 @@ + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Controls/JobModelSummaryViewerControl.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Controls/JobModelSummaryViewerControl.xaml.cs index 5bc74e046..6ec36a8fe 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Controls/JobModelSummaryViewerControl.xaml.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Controls/JobModelSummaryViewerControl.xaml.cs @@ -55,6 +55,17 @@ namespace Tango.PPC.Jobs.Controls public static readonly DependencyProperty DisplayMarkersProperty = DependencyProperty.Register("DisplayMarkers", typeof(bool), typeof(JobModelSummaryViewerControl), new PropertyMetadata(true)); + + public bool DisplayUnits + { + get { return (bool)GetValue(DisplayUnitsProperty); } + set { SetValue(DisplayUnitsProperty, value); } + } + + // Using a DependencyProperty as the backing store for DisplayUnits. This enables animation, styling, binding, etc... + public static readonly DependencyProperty DisplayUnitsProperty = + DependencyProperty.Register("DisplayUnits", typeof(bool), typeof(JobModelSummaryViewerControl), new PropertyMetadata(true)); + public JobModelSummaryViewerControl() { InitializeComponent(); diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml index cb26d5a3a..b3610240b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml @@ -1229,7 +1229,7 @@ - + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Black.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Black.ttf new file mode 100644 index 000000000..71c0f995e Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Black.ttf differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-BlackItalic.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-BlackItalic.ttf new file mode 100644 index 000000000..7aeb58bd1 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-BlackItalic.ttf differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Bold.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Bold.ttf new file mode 100644 index 000000000..00559eeb2 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Bold.ttf differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-BoldItalic.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-BoldItalic.ttf new file mode 100644 index 000000000..e61e8e88b Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-BoldItalic.ttf differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraBold.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraBold.ttf new file mode 100644 index 000000000..df7093608 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraBold.ttf differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraBoldItalic.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraBoldItalic.ttf new file mode 100644 index 000000000..14d2b375d Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraBoldItalic.ttf differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraLight.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraLight.ttf new file mode 100644 index 000000000..e76ec69a6 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraLight.ttf differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraLightItalic.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraLightItalic.ttf new file mode 100644 index 000000000..89513d946 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraLightItalic.ttf differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Italic.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Italic.ttf new file mode 100644 index 000000000..12b7b3c40 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Italic.ttf differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Light.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Light.ttf new file mode 100644 index 000000000..bc36bcc24 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Light.ttf differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-LightItalic.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-LightItalic.ttf new file mode 100644 index 000000000..9e70be6a9 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-LightItalic.ttf differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Medium.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Medium.ttf new file mode 100644 index 000000000..6bcdcc27f Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Medium.ttf differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-MediumItalic.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-MediumItalic.ttf new file mode 100644 index 000000000..be67410fd Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-MediumItalic.ttf differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Regular.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Regular.ttf new file mode 100644 index 000000000..9f0c71b70 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Regular.ttf differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-SemiBold.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-SemiBold.ttf new file mode 100644 index 000000000..74c726e32 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-SemiBold.ttf differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-SemiBoldItalic.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-SemiBoldItalic.ttf new file mode 100644 index 000000000..3e6c94223 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-SemiBoldItalic.ttf differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Thin.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Thin.ttf new file mode 100644 index 000000000..03e736613 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Thin.ttf differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ThinItalic.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ThinItalic.ttf new file mode 100644 index 000000000..e26db5dd3 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ThinItalic.ttf differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Fonts.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Fonts.xaml index 356c04749..1f0068c3e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Fonts.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Fonts.xaml @@ -2,5 +2,8 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:local="clr-namespace:Tango.PPC.Common.Resources"> + + ..//Fonts//#Poppins - \ No newline at end of file + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj index ede8bad33..1f4651435 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj @@ -381,6 +381,24 @@ Designer + + + + + + + + + + + + + + + + + + SettingsSingleFileGenerator @@ -593,7 +611,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml index 7addfdd13..bdcf675e3 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml @@ -14,6 +14,7 @@ + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml index 2b73e274c..be53c67fc 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml @@ -7,7 +7,7 @@ xmlns:views="clr-namespace:Tango.PPC.UI.Views" mc:Ignorable="d" Title="Tango - PPC" Height="800" Stylus.IsTapFeedbackEnabled="False" Stylus.IsPressAndHoldEnabled="False" Stylus.IsTouchFeedbackEnabled="False" Width="800" WindowStyle="SingleBorderWindow" ResizeMode="CanResize" WindowStartupLocation="CenterScreen" - FontFamily="{StaticResource TangoFlexoFontFamily}" + FontFamily="{StaticResource Poppins}" FontSize="{StaticResource TangoDefaultFontSize}" Foreground="{StaticResource TangoDarkForegroundBrush}" FontWeight="Medium" RenderOptions.BitmapScalingMode="LowQuality" SnapsToDevicePixels="True" UseLayoutRounding="True"> 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 866a6ddfe..f9bc4cefb 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -133,7 +133,7 @@ namespace Tango.PPC.UI.ViewModels { StopCommand = new RelayCommand(StopJob, ()=>CanStopped()); AbortCommand = new RelayCommand(AbortJob, () => CanStopped()); - GoToJobCommand = new RelayCommand(GoToJob); + GoToJobCommand = new RelayCommand(GoToJob, () => CanStopped()); JobStatusViewCommand = new RelayCommand(JobStatusView); OverviewViewCommand = new RelayCommand(OverviewView); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index 559d81dbe..d98a8823d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -190,41 +190,8 @@ - - - + @@ -607,10 +574,88 @@ - + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + Sensors + + + + + + + + + + + + + + + Waste + + + + Ink Levels + + + + + + -- cgit v1.3.1 From 23f4bd3bb2f7ff5e0814555efe1c6115f32c49c4 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Sun, 9 Apr 2023 20:27:29 +0300 Subject: Notifications list, GUI changes. --- .../Tango.PPC.JobsV2/Views/JobEurekaView.xaml | 2 +- .../Converters/CollectionToCountConverter.cs | 30 +++ .../Images/Job Issues/Machine outline.png | Bin 0 -> 3459 bytes .../Notifications/DefaultNotificationProvider.cs | 2 + .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 4 +- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 126 ++++++++++-- .../PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml | 2 +- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 226 +++++++++++++-------- 8 files changed, 285 insertions(+), 107 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/CollectionToCountConverter.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/Machine outline.png (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml index b3610240b..ab34b33f3 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml @@ -833,7 +833,7 @@ - + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/CollectionToCountConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/CollectionToCountConverter.cs new file mode 100644 index 000000000..b227aa5f8 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/CollectionToCountConverter.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Data; + +namespace Tango.PPC.UI.Converters +{ + public class CollectionToCountConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + var collection = value as System.Collections.ICollection; + if (collection != null) + { + return collection.Count; + } + return 0; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/Machine outline.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/Machine outline.png new file mode 100644 index 000000000..67c89b46e Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/Machine outline.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs index ac1972f5f..cc8f7b4ab 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs @@ -303,6 +303,7 @@ namespace Tango.PPC.UI.Notifications item.RemoveAction = () => { PopNotification(item); }; NotificationItems.Insert(0, item); RaisePropertyChanged(nameof(HasNotificationItems)); + RaisePropertyChanged(nameof(NotificationItems)); return item; } @@ -325,6 +326,7 @@ namespace Tango.PPC.UI.Notifications LogManager.Log($"Popping out NotificationItem '{item.GetType().Name}'."); NotificationItems.Remove(item); RaisePropertyChanged(nameof(HasNotificationItems)); + RaisePropertyChanged(nameof(NotificationItems)); } /// 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 7ed27a3ce..ec2e6b1a0 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 @@ -140,6 +140,7 @@ RunningJobViewerEureka.xaml + @@ -553,6 +554,7 @@ + @@ -877,7 +879,7 @@ if $(ConfigurationName) == Debug "rc.exe" "$(TargetPath)" --set-version-string " - + \ No newline at end of file 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 f9bc4cefb..8e5d3e0f9 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.BL.Entities; +using Tango.BL.Enumerations; using Tango.Core.Commands; using Tango.Integration.Operation; using Tango.PPC.Common; @@ -44,7 +45,9 @@ namespace Tango.PPC.UI.ViewModels IsDyeingProcess = (_runningJobStatus != null && _runningJobStatus.CurrentSegment != null); if(_runningJobStatus != null && _runningJobStatus.CurrentSegment != null) { - CurrentBrushStop = _runningJobStatus.CurrentSegment.FirstBrushStop; + var segment = Job.Segments.FirstOrDefault(x=>x.SegmentIndex == _runningJobStatus.CurrentSegment.SegmentIndex); + if(segment != null) + CurrentBrushStop = segment.FirstBrushStop; } RaisePropertyChangedAuto(); } @@ -101,11 +104,56 @@ namespace Tango.PPC.UI.ViewModels if(_currentBrushStop != value) { _currentBrushStop = value; + OnUpdateCurrentBrush(); RaisePropertyChangedAuto(); } } } + public double CyanOutput + { + get { return GetVolumeLiquidType(LiquidTypes.Cyan); } + } + + public double MagentaOutput + { + get { return GetVolumeLiquidType(LiquidTypes.Magenta); } + } + + public double YellowOutput + { + get { return GetVolumeLiquidType(LiquidTypes.Yellow); } + } + + public double BlackOutput + { + get { return GetVolumeLiquidType(LiquidTypes.Black); } + } + + public double LightCyanOutput + { + get { return GetVolumeLiquidType(LiquidTypes.LightCyan); } + } + + public double LightMagentaOutput + { + get { return GetVolumeLiquidType(LiquidTypes.LightMagenta); } + } + + public double LightYellowOutput + { + get { return GetVolumeLiquidType(LiquidTypes.LightYellow); } + } + + //public double TransparentInkOutput + //{ + // get { return GetVolumeLiquidType(LiquidTypes.TransparentInk); } + //} + + //public double LubricantOutput + //{ + // get { return GetVolumeLiquidType(LiquidTypes.Lubricant); } + //} #endregion @@ -127,6 +175,8 @@ namespace Tango.PPC.UI.ViewModels /// public RelayCommand OverviewViewCommand { get; set; } + public RelayCommand ClearAllNotificationsCommand { get; set; } + #endregion public MachineStatusViewVM() @@ -136,23 +186,21 @@ namespace Tango.PPC.UI.ViewModels GoToJobCommand = new RelayCommand(GoToJob, () => CanStopped()); JobStatusViewCommand = new RelayCommand(JobStatusView); OverviewViewCommand = new RelayCommand(OverviewView); + ClearAllNotificationsCommand = new RelayCommand(ClearAllNotifications); IsJobStatusViewEnable = true; IsEnabledStopButton = false; IsSpoolView = false; } - + + #region printing + public override void OnApplicationStarted() { MachineProvider.MachineOperator.PrintingStarted += MachineOperator_PrintingStarted; MachineProvider.MachineOperator.PrintingEnded += MachineOperator_PrintingEnded; } - - private bool CanStopped() - { - return IsEnabledStopButton; - } - + private void MachineOperator_PrintingStarted(object sender, PrintingEventArgs e) { _handler = e.JobHandler; @@ -211,17 +259,10 @@ namespace Tango.PPC.UI.ViewModels AbortCommand.RaiseCanExecuteChanged(); }); } + + #endregion - private void StopJob() - { - _handler?.Cancel(); - } - - private void AbortJob() - { - _handler?.Cancel(); - Job = null; - } + #region Methods private void GoToJob() { @@ -230,8 +271,6 @@ namespace Tango.PPC.UI.ViewModels NavigationManager.ClearHistoryExcept(); } - #region Public Methods - /// /// Toggles the application technician mode. /// @@ -246,9 +285,7 @@ namespace Tango.PPC.UI.ViewModels ApplicationManager.ExitTechnicianMode(); } } - - protected void JobStatusView() { IsJobStatusViewEnable = true; @@ -259,6 +296,51 @@ namespace Tango.PPC.UI.ViewModels IsJobStatusViewEnable = false; } + private double GetVolumeLiquidType(LiquidTypes liquidType) + { + if(CurrentBrushStop != null && CurrentBrushStop.LiquidVolumes != null && CurrentBrushStop.LiquidVolumes.Count > 0) + { + var lt = CurrentBrushStop.LiquidVolumes.FirstOrDefault(x => x.LiquidType == liquidType); + + if (lt != null) + { + return Math.Round(lt.Volume, 2); + } + } + return 0; + } + + private bool CanStopped() + { + return IsEnabledStopButton; + } + + private void StopJob() + { + _handler?.Cancel(); + } + + private void AbortJob() + { + _handler?.Cancel(); + Job = null; + } + + protected void ClearAllNotifications() + { + NotificationProvider.NotificationItems.Where(x=>x.CanClose).ToList().ForEach(y=> NotificationProvider.PopNotification(y)); + } + + protected void OnUpdateCurrentBrush() + { + RaisePropertyChanged(nameof(CyanOutput)); + RaisePropertyChanged(nameof(LightCyanOutput)); + RaisePropertyChanged(nameof(MagentaOutput)); + RaisePropertyChanged(nameof(LightMagentaOutput)); + RaisePropertyChanged(nameof(YellowOutput)); + RaisePropertyChanged(nameof(LightYellowOutput)); + RaisePropertyChanged(nameof(BlackOutput)); + } #endregion } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml index fe42576b4..10750bba3 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml @@ -208,7 +208,7 @@ - + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index d98a8823d..18c9b3adb 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -7,15 +7,16 @@ xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels" xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" xmlns:locaControls="clr-namespace:Tango.PPC.UI.Controls" - xmlns:locaConverters="clr-namespace:Tango.PPC.UI.Converters" + xmlns:localConverters="clr-namespace:Tango.PPC.UI.Converters" xmlns:global="clr-namespace:Tango.PPC.UI" xmlns:local="clr-namespace:Tango.PPC.UI.Views" mc:Ignorable="d" d:DesignHeight="1280" d:DesignWidth="932" d:DataContext="{d:DesignInstance Type=vm:MachineStatusViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MachineStatusViewVM}"> - - + + + + - + - - - - - - - - - + + + + + + + + + - - - - - - - - + + + - + + + + + + + + + - + -- cgit v1.3.1 From 7c7d1078082c261c820297cb6e4e5cf301872e4f Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Thu, 13 Apr 2023 18:46:26 +0300 Subject: PPC. Machine Status View changes. --- .../Converters/LengthToWeightConverter.cs | 2 +- .../Converters/LengthWithSpoolsConverter.cs | 2 +- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 12 ++++ .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 84 +++++++++++++++------- .../Visual_Studio/Tango.Touch/Resources/Fonts.xaml | 1 + 5 files changed, 74 insertions(+), 27 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs index 910a5238b..82a947e97 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs @@ -23,7 +23,7 @@ namespace Tango.PPC.UI.Converters } catch (Exception ex) { - return 0d; + return "-"; } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthWithSpoolsConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthWithSpoolsConverter.cs index 48e9bce7b..3b42885bd 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthWithSpoolsConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthWithSpoolsConverter.cs @@ -21,7 +21,7 @@ namespace Tango.PPC.UI.Converters } catch { - return 0d; + return "-"; } } 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 8e5d3e0f9..b41dbb0bf 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -81,6 +81,17 @@ namespace Tango.PPC.UI.ViewModels set { _isSpoolView = value; RaisePropertyChangedAuto(); } } + private bool _isWeightView; + /// + /// Gets or sets a value indicating whether this instance is length. Show indicator values in length or weight. + /// + public bool IsWeghtView + { + get { return _isWeightView; } + set { _isWeightView = value; RaisePropertyChangedAuto(); } + } + + private bool _isDyeingProcess; public bool IsDyeingProcess @@ -191,6 +202,7 @@ namespace Tango.PPC.UI.ViewModels IsJobStatusViewEnable = true; IsEnabledStopButton = false; IsSpoolView = false; + IsWeghtView = false; } #region printing diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index 18c9b3adb..370ac1de7 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -195,8 +195,8 @@ - - + + @@ -260,11 +260,10 @@ - + - - - + + - + - - + --> + - + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs index 00473955b..3be7a8818 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs @@ -15,13 +15,11 @@ namespace Tango.PPC.UI.Converters { try { - if (values.Count() == 4) + if (values.Count() == 2) { double length = System.Convert.ToDouble(values[0]); - int spools = System.Convert.ToInt32(values[1]); - int NumberOfUnits = System.Convert.ToInt32(values[2]); - bool forOneSpool = System.Convert.ToBoolean(values[3]); - var totalBy4Spools = (double)length* spools * NumberOfUnits/ 4; + bool forOneSpool = System.Convert.ToBoolean(values[1]); + var totalBy4Spools = (double)length*4;// spools ; if (forOneSpool) { return (double)totalBy4Spools / 4; @@ -29,16 +27,14 @@ namespace Tango.PPC.UI.Converters return totalBy4Spools; } - if (values.Count() == 5) + if (values.Count() == 3) { double length = System.Convert.ToDouble(values[0]); - int spools = System.Convert.ToInt32(values[1]); - int NumberOfUnits = System.Convert.ToInt32(values[2]); - bool forOneSpool = System.Convert.ToBoolean(values[3]); - double currentProgresslength = System.Convert.ToDouble(values[4]) ; + bool forOneSpool = System.Convert.ToBoolean(values[1]); + double currentProgresslength = System.Convert.ToDouble(values[2]) ; - var totalBy4Spools = (double)length * spools * NumberOfUnits / 4; - var currentProgressBy4Spools = (double)currentProgresslength * spools ; + var totalBy4Spools = (double)length * 4; + var currentProgressBy4Spools = (double)currentProgresslength * 4 ; int coeff = (int)currentProgressBy4Spools / (int)totalBy4Spools; var progressCurrent = coeff == 0 ? currentProgressBy4Spools : currentProgressBy4Spools % (coeff * totalBy4Spools);//show for progress diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressWeightSpoolConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressWeightSpoolConverter.cs new file mode 100644 index 000000000..05a41912c --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressWeightSpoolConverter.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Data; + + +namespace Tango.PPC.UI.Converters +{ + public class ProgressWeightSpoolConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + try + { + if (values.Count() == 3) + { + double length = System.Convert.ToDouble(values[0]); + bool forOneSpool = System.Convert.ToBoolean(values[1]); + double coef = System.Convert.ToDouble(values[2]); + var totalBy4Spools = (double)length * 4;// spools ; + + var weight = ((double)totalBy4Spools * coef) / (1000);//(g) + if (forOneSpool) + { + return (double)weight / 4; + } + return weight; + + } + if (values.Count() == 4) + { + double length = System.Convert.ToDouble(values[0]); + bool forOneSpool = System.Convert.ToBoolean(values[1]); + double currentProgresslength = System.Convert.ToDouble(values[2]); + double coef = System.Convert.ToDouble(values[3]); + + var totalBy4Spools = (double)length * 4; + var currentProgressBy4Spools = (double)currentProgresslength * 4; + + int coeff = (int)currentProgressBy4Spools / (int)totalBy4Spools; + var progressCurrent = coeff == 0 ? currentProgressBy4Spools : currentProgressBy4Spools % (coeff * totalBy4Spools);//show for progress + var weight = ((double)progressCurrent * coef) / (1000);//(g) + if (forOneSpool) + { + return (double)weight / 4; + + } + return weight; + } + return "-"; + } + catch + { + return "-"; + } + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} 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 d32900728..1534d8a73 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 @@ -145,6 +145,7 @@ + BitResultsView.xaml 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 d16792ead..95eb22d7a 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -31,6 +31,7 @@ namespace Tango.PPC.UI.ViewModels { private JobHandler _jobHandler; private bool _resettingDevice; + private DispatcherTimer _date_timer; /// /// Gets or sets the module loader. @@ -219,6 +220,16 @@ namespace Tango.PPC.UI.ViewModels set { _cartridges = value; RaisePropertyChangedAuto(); } } + private DateTime _currentDateTime; + /// + /// Gets or sets the current date time. + /// + public DateTime CurrentDateTime + { + get { return _currentDateTime; } + set { _currentDateTime = value; RaisePropertyChangedAuto(); } + } + #endregion #region Commands @@ -306,6 +317,11 @@ namespace Tango.PPC.UI.ViewModels PowerOffCommand = new RelayCommand(PowerOffMachine, () => MachineProvider.MachineOperator.Status != MachineStatuses.Disconnected); ResetCommand = new RelayCommand(ResetMachine, () => MachineProvider.MachineOperator.Status != MachineStatuses.Disconnected); StandByCommand = new RelayCommand(StandBy, () => MachineProvider.MachineOperator.CanPrint); + + _date_timer = new DispatcherTimer(); + _date_timer.Interval = TimeSpan.FromSeconds(1); + _date_timer.Tick += _date_timer_Tick; + _date_timer.Start(); } #endregion @@ -614,6 +630,11 @@ namespace Tango.PPC.UI.ViewModels #region Event Handlers + private void _date_timer_Tick(object sender, EventArgs e) + { + CurrentDateTime = DateTime.Now; + } + /// /// Handles the PrintingStarted event of the MachineOperator. /// 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 b41dbb0bf..95db08dfa 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -194,7 +194,7 @@ namespace Tango.PPC.UI.ViewModels { StopCommand = new RelayCommand(StopJob, ()=>CanStopped()); AbortCommand = new RelayCommand(AbortJob, () => CanStopped()); - GoToJobCommand = new RelayCommand(GoToJob, () => CanStopped()); + GoToJobCommand = new RelayCommand(GoToJob); JobStatusViewCommand = new RelayCommand(JobStatusView); OverviewViewCommand = new RelayCommand(OverviewView); ClearAllNotificationsCommand = new RelayCommand(ClearAllNotifications); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml index 092088ca6..d90ddd962 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml @@ -35,19 +35,19 @@ - + - - - + + + - - + + - + @@ -92,7 +92,7 @@ - + Power @@ -101,119 +101,77 @@ - - - - - - - - - - - + + + + + - - - - - - - + + + + + - Restart - --> - - - - + + + + + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index e69f33514..9230f61c3 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -18,6 +18,7 @@ + - Color Properties + Copy Properties Select All 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 95db08dfa..2a851e007 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -11,6 +11,7 @@ using Tango.PPC.Common; using Tango.PPC.Jobs; using Tango.PPC.Jobs.NavigationObjects; using Tango.PPC.Jobs.Views; +using Tango.PPC.Maintenance.Models; namespace Tango.PPC.UI.ViewModels { @@ -166,6 +167,13 @@ namespace Tango.PPC.UI.ViewModels // get { return GetVolumeLiquidType(LiquidTypes.Lubricant); } //} + private List _midTankLevels; + public List MidTankLevels + { + get { return _midTankLevels; } + set { _midTankLevels = value; RaisePropertyChangedAuto(); } + } + #endregion #region Commands @@ -205,6 +213,17 @@ namespace Tango.PPC.UI.ViewModels IsWeghtView = false; } + public override void OnApplicationReady() + { + base.OnApplicationReady(); + + MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.HasLevelMeasure).OrderBy(x => x.PackIndex).Select(x => new MidTankLevelModel() + { + Max = MachineOperator.MAX_MIDTANK_LITERS, + IDSPack = x, + }).OrderBy(y => y.IDSPack.LiquidType.Code).ToList(); + } + #region printing public override void OnApplicationStarted() diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index 25841cb94..49e18edf5 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -117,6 +117,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -730,44 +759,104 @@ Sensors - + - + 10 Bar Pressure + + - - 10 + + 200 - - - - 10 + + Dryer Zone + + + + + 80/200 - - - 75 + Tunnel + + + + + 200 - - - 200 + Dyeing Head + + + + + 218/200 + Dyeing Head + - - + + + + + + + + + + + + + Winder + + + + + + + + + + + Dancer + + + + + + + + + + + + + BTSR + + + + + + + + + + + Feeder + + - @@ -782,8 +871,15 @@ Ink Levels - - + + + + + + + + + + -- cgit v1.3.1 From 525cb05b5ab2c7168599d01d298d187a763d6b3c Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Thu, 4 May 2023 21:24:11 +0300 Subject: New Job Running control. --- .../Tango.PPC.JobsV2/Views/JobEurekaView.xaml | 6 +- .../Controls/RunningJobViewerEureka.xaml | 136 ++++++--------------- .../Controls/RunningJobViewerEureka.xaml.cs | 72 +++++++++++ .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 17 ++- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 74 +++++------ .../Converters/WidthHeightToRectConverter.cs | 13 +- .../Tango.Touch/Controls/SliderContentControl.cs | 122 ++++++++++++++++++ .../Tango.Touch/Controls/SliderContentControl.xaml | 92 ++++++++++++++ .../Visual_Studio/Tango.Touch/Tango.Touch.csproj | 7 +- .../Visual_Studio/Tango.Touch/Themes/Generic.xaml | 3 + 10 files changed, 399 insertions(+), 143 deletions(-) create mode 100644 Software/Visual_Studio/Tango.Touch/Controls/SliderContentControl.cs create mode 100644 Software/Visual_Studio/Tango.Touch/Controls/SliderContentControl.xaml (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml index 5782d77a2..e52433cfb 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml @@ -1350,13 +1350,13 @@ --> - - + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml index 559266d28..39c032145 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml @@ -11,60 +11,20 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - + + + @@ -73,54 +33,32 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs index db6a8c178..29efaad72 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs @@ -66,6 +66,62 @@ namespace Tango.PPC.UI.Controls public static readonly DependencyProperty RunningJobStatusProperty = DependencyProperty.Register("RunningJobStatus", typeof(RunningJobStatus), typeof(RunningJobViewerEureka), new PropertyMetadata(null)); + public double MinimumValue + { + get { return (double)GetValue(MinimumValueProperty); } + set { SetValue(MinimumValueProperty, value); } + } + /// + /// The minimum value property + /// + public static readonly DependencyProperty MinimumValueProperty = + DependencyProperty.RegisterAttached("MinimumValue", typeof(double), typeof(RunningJobViewerEureka), + new FrameworkPropertyMetadata(0.0)); + public double MaximumValue + { + get { return (double)GetValue(MaximumValueProperty); } + set + { + SetValue(MaximumValueProperty, value); + } + } + /// + /// The maximum value property + /// + public static readonly DependencyProperty MaximumValueProperty = + DependencyProperty.RegisterAttached("MaximumValue", typeof(double), typeof(RunningJobViewerEureka), + new FrameworkPropertyMetadata(100.0, 0)); + + public double SliderValue + { + get { return (double)GetValue(SliderValueProperty); } + set { SetValue(SliderValueProperty, value); } + } + + // Using a DependencyProperty as the backing store for SliderValue. This enables animation, styling, binding, etc... + public static readonly DependencyProperty SliderValueProperty = + DependencyProperty.Register("SliderValue", typeof(double), typeof(RunningJobViewerEureka), new FrameworkPropertyMetadata((double)0.0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, (d, e) => (d as RunningJobViewerEureka).OnSliderValueChanged())); + + public double HeightSlider + { + get { return (double)GetValue(HeightSliderProperty); } + set { SetValue(HeightSliderProperty, value); } + } + + // Using a DependencyProperty as the backing store for HeightSlider. This enables animation, styling, binding, etc... + public static readonly DependencyProperty HeightSliderProperty = + DependencyProperty.Register("HeightSlider", typeof(double), typeof(RunningJobViewerEureka), new FrameworkPropertyMetadata(0.0)); + + public double ThumbHeight + { + get { return (double)GetValue(ThumbHeightProperty); } + set { SetValue(ThumbHeightProperty, value); } + } + + // Using a DependencyProperty as the backing store for ThumbHeight. This enables animation, styling, binding, etc... + public static readonly DependencyProperty ThumbHeightProperty = + DependencyProperty.Register("ThumbHeight", typeof(double), typeof(RunningJobViewerEureka), new FrameworkPropertyMetadata(0.0)); + /// /// Initializes a new instance of the class. /// @@ -73,5 +129,21 @@ namespace Tango.PPC.UI.Controls { InitializeComponent(); } + + private void SliderContentControl_MouseDown(object sender, MouseButtonEventArgs e) + { + e.Handled = true; + } + + private void SliderContentControl_TouchDown(object sender, TouchEventArgs e) + { + e.Handled = true; + } + + private void OnSliderValueChanged() + { + if(slider_control != null) + slider_control.Value = SliderValue; + } } } 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 2a851e007..fba49ced3 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -6,8 +6,10 @@ using System.Threading.Tasks; using Tango.BL.Entities; using Tango.BL.Enumerations; using Tango.Core.Commands; +using Tango.Core.DI; using Tango.Integration.Operation; using Tango.PPC.Common; +using Tango.PPC.Common.Diagnostics; using Tango.PPC.Jobs; using Tango.PPC.Jobs.NavigationObjects; using Tango.PPC.Jobs.Views; @@ -19,7 +21,11 @@ namespace Tango.PPC.UI.ViewModels { #region Properties - private JobHandler _handler; + [TangoInject] + public IDiagnosticsFrameProvider DefaultDiagnosticsFrameProvider { get; set; } + + + private JobHandler _handler; private Job _job; /// @@ -230,8 +236,15 @@ namespace Tango.PPC.UI.ViewModels { MachineProvider.MachineOperator.PrintingStarted += MachineOperator_PrintingStarted; MachineProvider.MachineOperator.PrintingEnded += MachineOperator_PrintingEnded; + + //DefaultDiagnosticsFrameProvider.FrameReceived += DefaultDiagnosticsFrameProvider_FrameReceived; } - + + private void DefaultDiagnosticsFrameProvider_FrameReceived(object sender, PMR.Diagnostics.StartDiagnosticsResponse e) + { + var frame = e; + } + private void MachineOperator_PrintingStarted(object sender, PrintingEventArgs e) { _handler = e.JobHandler; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index 1e528765e..66bc6f580 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -593,19 +593,18 @@ - - - - + + + + - - - + @@ -810,10 +809,34 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -835,27 +858,8 @@ - - - - - - - - - - - - - - - - - - - + + diff --git a/Software/Visual_Studio/Tango.SharedUI/Converters/WidthHeightToRectConverter.cs b/Software/Visual_Studio/Tango.SharedUI/Converters/WidthHeightToRectConverter.cs index 25d7c7579..c7215ad99 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Converters/WidthHeightToRectConverter.cs +++ b/Software/Visual_Studio/Tango.SharedUI/Converters/WidthHeightToRectConverter.cs @@ -13,9 +13,16 @@ namespace Tango.SharedUI.Converters { public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { - double width = (double)values[0]; - double height = (double)values[1]; - return new Rect(new Size(width, height)); + try + { + double width = (double)values[0]; + double height = (double)values[1]; + return new Rect(new Size(width, height)); + } + catch( Exception ex) + { + return null; + } } public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) diff --git a/Software/Visual_Studio/Tango.Touch/Controls/SliderContentControl.cs b/Software/Visual_Studio/Tango.Touch/Controls/SliderContentControl.cs new file mode 100644 index 000000000..a6b05f472 --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Controls/SliderContentControl.cs @@ -0,0 +1,122 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.Touch.Controls +{ + [ContentProperty(nameof(Content))] + public class SliderContentControl : Slider + { + private bool m_isBlocked; + + #region DependencyProperties + + public UIElement Content + { + get { return (UIElement)GetValue(ContentProperty); } + set { SetValue(ContentProperty, value); } + } + public static readonly DependencyProperty ContentProperty = + DependencyProperty.Register("Content", typeof(UIElement), typeof(SliderContentControl), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender, (d, e) => (d as SliderContentControl).OnContentChanged())); + + public static readonly DependencyProperty ThumbHeightProperty = + DependencyProperty.Register("ThumbHeight", typeof(double), typeof(SliderContentControl), new FrameworkPropertyMetadata((double)32, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault)); + + public double ThumbHeight + { + get { return (double)GetValue(ThumbHeightProperty); } + set { SetValue(ThumbHeightProperty, value); } + } + + public Color ThumbColor + { + get { return (Color)GetValue(ThumbColorProperty); } + set { SetValue(ThumbColorProperty, value); } + } + + + + /// + /// The thumb color property + /// + public static readonly DependencyProperty ThumbColorProperty = + DependencyProperty.Register("ThumbColor", typeof(Color), typeof(SliderContentControl), new UIPropertyMetadata(Colors.LightGray, null)); + + + + #endregion + + static SliderContentControl() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(SliderContentControl), new FrameworkPropertyMetadata(typeof(SliderContentControl))); + } + + public override void OnApplyTemplate() + { + base.OnApplyTemplate(); + + TouchDown -= TouchDownSlider; + TouchDown += TouchDownSlider; + OnValueChanged(Double.NaN, Value); + IsMoveToPointEnabled = true; + } + + private void TouchDownSlider(object sender, TouchEventArgs e) + { + e.Handled = true; + } + + private double ValidateValue(double value) + { + if (value >= Minimum && value <= Maximum) + return value; + if ((value) > Maximum) + return Maximum; + if ((value) < Minimum) + return Minimum; + return double.NaN; + } + + private void OnContentChanged() + { + RemoveLogicalChild(Content); + AddLogicalChild(Content); + } + + protected override void OnValueChanged(double oldValue, double newValue) + { + if (m_isBlocked) return; + + m_isBlocked = true; + + var validatedValue = ValidateValue(newValue); + + if (!double.IsNaN(validatedValue)) + { + Value = validatedValue; + + } + + m_isBlocked = false; + + + } + + protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e) + { + e.Handled = true; + } + } +} diff --git a/Software/Visual_Studio/Tango.Touch/Controls/SliderContentControl.xaml b/Software/Visual_Studio/Tango.Touch/Controls/SliderContentControl.xaml new file mode 100644 index 000000000..9e2b85c60 --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Controls/SliderContentControl.xaml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj index 1096ec112..a0a42f3b6 100644 --- a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj +++ b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj @@ -67,6 +67,7 @@ + @@ -133,6 +134,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -502,7 +507,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml b/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml index 8b49ccc6b..14231fb3a 100644 --- a/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml +++ b/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml @@ -67,6 +67,8 @@ + + @@ -75,6 +77,7 @@ + -- cgit v1.3.1 From edd7e8af06fe0e70e78ce2de9423ec49a799b78a Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Wed, 10 May 2023 14:57:24 +0300 Subject: add values to UI dashboard indicators --- .../PPC/Tango.PPC.UI/Models/MachineOverviewItem.cs | 59 +++++++ .../Tango.PPC.UI/Models/MachineOverviewModel.cs | 178 +++++++++++++++++++++ .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 4 +- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 72 +++++---- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 81 +++++++--- .../Tango.Emulations/Emulators/MachineEmulator.cs | 7 + 6 files changed, 350 insertions(+), 51 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewItem.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewItem.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewItem.cs new file mode 100644 index 000000000..ded7e33e8 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewItem.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media; +using Tango.Core; + +namespace Tango.PPC.UI.Models +{ + public class MachineOverviewItem : ExtendedObject + { + private String _displayValue; + public String DisplayValue + { + get { return _displayValue; } + set { _displayValue = value; RaisePropertyChangedAuto(); } + } + + private String _status; + public String Status + { + get { return _status; } + set { _status = value; RaisePropertyChangedAuto(); } + } + + private Color _color; + public Color Color + { + get { return _color; } + set { _color = value; RaisePropertyChangedAuto(); } + } + + private double _maxValue; + + public double MaxValue + { + get { return _maxValue; } + set { _maxValue = value; RaisePropertyChangedAuto(); } + } + + private double _value; + + public double Value + { + get { return _value; } + set { _value = value; RaisePropertyChangedAuto(); } + } + + public MachineOverviewItem() + { + Color = Colors.Gray; + DisplayValue = "--"; + Value = 0; + MaxValue = 100; + } + + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs new file mode 100644 index 000000000..d5d8407b7 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs @@ -0,0 +1,178 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media; +using Tango.BL.Entities; +using Tango.Core; +using Tango.PMR.Diagnostics; +using Tango.PPC.Common; +using Tango.Settings; + +namespace Tango.PPC.UI.Models +{ + public class MachineOverviewModel : ExtendedObject + { + public MachineOverviewItem DryerZone3 { get; set; } + public MachineOverviewItem DryerAir { get; set; } + public MachineOverviewItem Tunnel { get; set; } + public MachineOverviewItem PumpsPressure { get; set; } + public MachineOverviewItem Lubricant { get; set; } + + private PPCSettings _settings; + /// + /// Gets the main PPC settings. + /// + public PPCSettings Settings + { + get + { + if (_settings == null) + { + _settings = SettingsManager.Default.GetOrCreate(); + } + + return _settings; + } + private set { _settings = value; } + } + + public MachineOverviewModel() + { + DryerZone3 = new MachineOverviewItem(); + DryerAir = new MachineOverviewItem(); + DryerAir.MaxValue =140; + Tunnel = new MachineOverviewItem(); + PumpsPressure = new MachineOverviewItem(); + PumpsPressure.MaxValue = 6; + Lubricant = new MachineOverviewItem(); + Lubricant.MaxValue = 100; + Lubricant.Value = 100; + } + + public void Update(StartDiagnosticsResponse diagnostics, Rml rml, ProcessParametersTable processParameters) + { + //Dryer Zone 3 + var dryerZone3State = diagnostics.HeatersStates.FirstOrDefault(x => x.HeaterType == HeaterType.HeaterZone3); + UpdateHeaterItem(DryerZone3, dryerZone3State); + + //Dryer Air + var dryerAirState = diagnostics.Monitors.EuSpare1.FirstOrDefault(); + UpdateDryerAirItem(dryerAirState); + //diagnostics.HeatersStates.FirstOrDefault(x => x.HeaterType == HeaterType.DryerAirHeater); + + + //Tunnel + var tunnelState = diagnostics.HeatersStates.FirstOrDefault(x => x.HeaterType == HeaterType.ETunnelHeater); + UpdateHeaterItem(Tunnel, tunnelState); + + //Pumps Pressure + if (diagnostics.Monitors.EuInkLinesPressure.Count > 0 && diagnostics.Monitors.EuInkLinesPressure.Any(x => x.Data.Count > 0)) + { + var pumpsPressuerValue = diagnostics.Monitors.EuInkLinesPressure.SelectMany(x => x.Data).Max(); + UpdatePumpsPressureItem(pumpsPressuerValue); + } + + //Lubricant + var lubricantValue = diagnostics.Monitors.EuLubricantCurrent.FirstOrDefault(); + UpdateLubricantItem( rml, lubricantValue); + } + + private void UpdateHeaterItem(MachineOverviewItem item, HeaterState state) + { + if (state != null) + { + + if (state.IsRampingUp) + { + item.Status = "Heating Up"; + item.Color = Colors.Orange; + item.DisplayValue = $"{state.CurrentValue} / {state.SetPoint}"; + item.MaxValue = state.SetPoint; + item.Value = state.CurrentValue; + } + else if (state.CurrentValue > state.SetPoint) + { + item.Status = "Over-temperature"; + item.Color = Colors.Red; + item.DisplayValue = $"{state.CurrentValue} / {state.SetPoint}"; + item.MaxValue = state.SetPoint; + item.Value = state.CurrentValue; + } + else if (state.IsInSetPoint) + { + item.Status = "Operational"; + item.Color = Colors.Green; + item.DisplayValue = $" {state.SetPoint}"; + item.MaxValue = state.SetPoint; + item.Value = state.CurrentValue; + } + else + { + item.Color = Colors.Gray; + item.MaxValue = 100; + item.Value = 0; + } + } + } + + private void UpdateDryerAirItem(double currentvalue) + { + if (currentvalue < 140) + { + DryerAir.Status = "Heating Up"; + DryerAir.Color = Colors.Orange; + DryerAir.DisplayValue = $"{currentvalue}"; + } + else if (currentvalue >= 140) + { + DryerAir.Status = "Operational"; + DryerAir.Color = Colors.Green; + DryerAir.DisplayValue = $"{currentvalue}"; + } + DryerAir.Value = currentvalue; + } + + private void UpdatePumpsPressureItem(double maxValue) + { + if (maxValue > 6) + { + PumpsPressure.Status = "Overpressure"; + PumpsPressure.Color = Colors.Red; + PumpsPressure.DisplayValue = maxValue.ToString(); + } + else + { + PumpsPressure.Status = "Operational"; + PumpsPressure.Color = Colors.Green; + PumpsPressure.DisplayValue = maxValue.ToString(); + } + PumpsPressure.Value = maxValue; + } + + private void UpdateLubricantItem(Rml rml, double lubricantValue) + { + if (rml != null) + { + var rmlLubrication = Settings.LubricationLevels.FirstOrDefault(x => x.RmlGuid == rml.Guid); + if (( rml.Lubricant == false) + || (rmlLubrication != null && rmlLubrication.LubricationLevel == Common.Lubrication.LubricationLevel.No)) + { + Lubricant.Status = "NotActive"; + Lubricant.DisplayValue = "None"; + Lubricant.Color = Colors.Gray; + + return; + } + Lubricant.Status = "Active"; + Lubricant.DisplayValue = lubricantValue.ToString(); + Lubricant.Color = Colors.Green; + } + + Lubricant.Status = "NotActive"; + Lubricant.DisplayValue = "None"; + Lubricant.Color = Colors.Gray; + } + } +} 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 7772c1f55..b3dffea5d 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 @@ -229,6 +229,8 @@ + + @@ -937,7 +939,7 @@ if $(ConfigurationName) == Debug "rc.exe" "$(TargetPath)" --set-version-string " - + \ No newline at end of file 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 fba49ced3..6d77ebcb9 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -8,12 +8,14 @@ using Tango.BL.Enumerations; using Tango.Core.Commands; using Tango.Core.DI; using Tango.Integration.Operation; +using Tango.PMR.Diagnostics; using Tango.PPC.Common; using Tango.PPC.Common.Diagnostics; using Tango.PPC.Jobs; using Tango.PPC.Jobs.NavigationObjects; using Tango.PPC.Jobs.Views; using Tango.PPC.Maintenance.Models; +using Tango.PPC.UI.Models; namespace Tango.PPC.UI.ViewModels { @@ -23,9 +25,9 @@ namespace Tango.PPC.UI.ViewModels [TangoInject] public IDiagnosticsFrameProvider DefaultDiagnosticsFrameProvider { get; set; } - - private JobHandler _handler; + + private JobHandler _handler; private Job _job; /// @@ -34,10 +36,13 @@ namespace Tango.PPC.UI.ViewModels public Job Job { get { return _job; } - set { _job = value; - if(_job == null) + set + { + _job = value; + if (_job == null) IsDyeingProcess = false; - RaisePropertyChangedAuto(); } + RaisePropertyChangedAuto(); + } } private RunningJobStatus _runningJobStatus; @@ -47,13 +52,14 @@ namespace Tango.PPC.UI.ViewModels public RunningJobStatus RunningJobStatus { get { return _runningJobStatus; } - set { + set + { _runningJobStatus = value; - IsDyeingProcess = (_runningJobStatus != null && _runningJobStatus.CurrentSegment != null); - if(_runningJobStatus != null && _runningJobStatus.CurrentSegment != null) + IsDyeingProcess = (_runningJobStatus != null && _runningJobStatus.CurrentSegment != null); + if (_runningJobStatus != null && _runningJobStatus.CurrentSegment != null) { - var segment = Job.Segments.FirstOrDefault(x=>x.SegmentIndex == _runningJobStatus.CurrentSegment.SegmentIndex); - if(segment != null) + var segment = Job.Segments.FirstOrDefault(x => x.SegmentIndex == _runningJobStatus.CurrentSegment.SegmentIndex); + if (segment != null) CurrentBrushStop = segment.FirstBrushStop; } RaisePropertyChangedAuto(); @@ -104,8 +110,9 @@ namespace Tango.PPC.UI.ViewModels public bool IsDyeingProcess { get { return _isDyeingProcess; } - set { - if(_isDyeingProcess != value) + set + { + if (_isDyeingProcess != value) { _isDyeingProcess = value; RaisePropertyChangedAuto(); @@ -118,8 +125,9 @@ namespace Tango.PPC.UI.ViewModels public BrushStop CurrentBrushStop { get { return _currentBrushStop; } - set { - if(_currentBrushStop != value) + set + { + if (_currentBrushStop != value) { _currentBrushStop = value; OnUpdateCurrentBrush(); @@ -147,7 +155,7 @@ namespace Tango.PPC.UI.ViewModels { get { return GetVolumeLiquidType(LiquidTypes.Black); } } - + public double LightCyanOutput { get { return GetVolumeLiquidType(LiquidTypes.LightCyan); } @@ -180,6 +188,8 @@ namespace Tango.PPC.UI.ViewModels set { _midTankLevels = value; RaisePropertyChangedAuto(); } } + public MachineOverviewModel OverviewModel { get; set; } + #endregion #region Commands @@ -206,7 +216,7 @@ namespace Tango.PPC.UI.ViewModels public MachineStatusViewVM() { - StopCommand = new RelayCommand(StopJob, ()=>CanStopped()); + StopCommand = new RelayCommand(StopJob, () => CanStopped()); AbortCommand = new RelayCommand(AbortJob, () => CanStopped()); GoToJobCommand = new RelayCommand(GoToJob); JobStatusViewCommand = new RelayCommand(JobStatusView); @@ -217,6 +227,8 @@ namespace Tango.PPC.UI.ViewModels IsEnabledStopButton = false; IsSpoolView = false; IsWeghtView = false; + + OverviewModel = new MachineOverviewModel(); } public override void OnApplicationReady() @@ -237,12 +249,12 @@ namespace Tango.PPC.UI.ViewModels MachineProvider.MachineOperator.PrintingStarted += MachineOperator_PrintingStarted; MachineProvider.MachineOperator.PrintingEnded += MachineOperator_PrintingEnded; - //DefaultDiagnosticsFrameProvider.FrameReceived += DefaultDiagnosticsFrameProvider_FrameReceived; + DefaultDiagnosticsFrameProvider.FrameReceived += DefaultDiagnosticsFrameProvider_FrameReceived; } private void DefaultDiagnosticsFrameProvider_FrameReceived(object sender, PMR.Diagnostics.StartDiagnosticsResponse e) { - var frame = e; + OverviewModel.Update(e, this.Job != null ? Job.Rml : null, null); } private void MachineOperator_PrintingStarted(object sender, PrintingEventArgs e) @@ -296,24 +308,24 @@ namespace Tango.PPC.UI.ViewModels private void JobHandler_CanCancelChanged(object sender, EventArgs e) { - InvokeUI( () => - { - IsEnabledStopButton = _handler.CanCancel; - StopCommand.RaiseCanExecuteChanged(); - AbortCommand.RaiseCanExecuteChanged(); - }); + InvokeUI(() => + { + IsEnabledStopButton = _handler.CanCancel; + StopCommand.RaiseCanExecuteChanged(); + AbortCommand.RaiseCanExecuteChanged(); + }); } - + #endregion #region Methods private void GoToJob() { - + NavigationManager.NavigateWithObject(new JobNavigationObject() { Job = _handler.Job }); NavigationManager.ClearHistoryExcept(); - + } /// /// Toggles the application technician mode. @@ -329,7 +341,7 @@ namespace Tango.PPC.UI.ViewModels ApplicationManager.ExitTechnicianMode(); } } - + protected void JobStatusView() { IsJobStatusViewEnable = true; @@ -342,7 +354,7 @@ namespace Tango.PPC.UI.ViewModels private double GetVolumeLiquidType(LiquidTypes liquidType) { - if(CurrentBrushStop != null && CurrentBrushStop.LiquidVolumes != null && CurrentBrushStop.LiquidVolumes.Count > 0) + if (CurrentBrushStop != null && CurrentBrushStop.LiquidVolumes != null && CurrentBrushStop.LiquidVolumes.Count > 0) { var lt = CurrentBrushStop.LiquidVolumes.FirstOrDefault(x => x.LiquidType == liquidType); @@ -372,7 +384,7 @@ namespace Tango.PPC.UI.ViewModels protected void ClearAllNotifications() { - NotificationProvider.NotificationItems.Where(x=>x.CanClose).ToList().ForEach(y=> NotificationProvider.PopNotification(y)); + NotificationProvider.NotificationItems.Where(x => x.CanClose).ToList().ForEach(y => NotificationProvider.PopNotification(y)); } protected void OnUpdateCurrentBrush() diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index 66bc6f580..6edc90844 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -867,29 +867,54 @@ Sensors - + - - 10 - Bar + + + + + + + + + + + ºC - Pressure + Dryer Zone 3 - - 200 - - - Dryer Zone + + + + + + + + + + + + + + Dryer Air - - 80/200 + + + + + + + + + + @@ -897,21 +922,37 @@ - - 200 - + + + + + + + + + + + - Dyeing Head + Pumps pressure - - 218/200 - + + + + + + + + + + + - Dyeing Head + Lubricant diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index 5bf3b8a9a..ac5e69425 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -620,6 +620,13 @@ namespace Tango.Emulations.Emulators monitors.Dispenser7MotorFrequency.AddRange(dispenserFrequencies[6].Data); monitors.Dispenser8MotorFrequency.AddRange(dispenserFrequencies[7].Data); + res.HeatersStates.Add(new HeaterState() + { + CurrentValue = 50, + IsInSetPoint = false, + SetPoint = 100 + }); + res.DigitalInterfaceStates.AddRange(_digitalOutputPinsStates.Concat(_digitalInputPinsStates)); res.ComponentsStates.AddRange(_componentsStates); res.HeatersStates.AddRange(_heater_states); -- cgit v1.3.1 From b597a69f85fec4f5b5a1aca65228fc840911d314 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Thu, 11 May 2023 20:23:33 +0300 Subject: IMplemented dynamic mid tank capacity on TwineX4 & FSE. --- .../MidTankLevelToElementHeightConverter.cs | 6 +- .../Tiles/MidTankLevels/MidTankLevelsTile.cs | 2 +- .../Tiles/MidTankLevels/MidTankLevelsTileView.xaml | 1 + .../Models/MidTankLevelModel.cs | 36 +++++++++ .../MidTankLevelToElementRectConverter.cs | 5 +- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 87 +++++++++++++++++++++- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 70 +++++++++-------- .../Visual_Studio/PPC/Tango.PPC.UI/app.manifest | 2 +- .../Tango.Emulations/Emulators/MachineEmulator.cs | 2 +- 9 files changed, 169 insertions(+), 42 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Converters/MidTankLevelToElementHeightConverter.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Converters/MidTankLevelToElementHeightConverter.cs index 88a90484d..f96725816 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Converters/MidTankLevelToElementHeightConverter.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Converters/MidTankLevelToElementHeightConverter.cs @@ -16,9 +16,9 @@ namespace Tango.FSE.UI.Converters try { double parentActualHeight = (double)values[0]; - double midTankLevel = Math.Min((double)values[1], MachineOperator.MAX_MIDTANK_LITERS); - //var test = (parentActualHeight - (midTankLevel / MachineOperator.MAX_MIDTANK_LITERS) * parentActualHeight); - return (parentActualHeight - (midTankLevel / MachineOperator.MAX_MIDTANK_LITERS) * parentActualHeight); + double max = (double)values[2]; + double midTankLevel = Math.Min((double)values[1], max); + return (parentActualHeight - (midTankLevel / max) * parentActualHeight); } catch { diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTile.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTile.cs index d8165d8aa..730055872 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTile.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTile.cs @@ -142,7 +142,7 @@ namespace Tango.FSE.UI.Tiles.MidTankLevels { MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.HasLevelMeasure).OrderBy(x => x.PackIndex).Select(x => new MidTankLevelModel() { - Max = MachineOperator.MAX_MIDTANK_LITERS, + Max = x.MidTankType.LiterCapacity, IDSPack = x, }).ToList(); } diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTileView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTileView.xaml index 7465f41c0..5e4f8ed9a 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTileView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTileView.xaml @@ -58,6 +58,7 @@ + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs index 93af310ba..c656db8c0 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs @@ -29,6 +29,42 @@ namespace Tango.PPC.Maintenance.Models { get { return Level <= MachineOperator.EMPTY_MIDTANK_LITERS; } } + + private bool _bJerricanPresent; + + public bool JerricanPresent + { + get { return _bJerricanPresent; } + set { + _bJerricanPresent = value; + RaisePropertyChangedAuto(); + } + } + + private bool _fillingTimeoutError; + + public bool FillingTimeoutError + { + get { return _fillingTimeoutError; } + set { _fillingTimeoutError = value; RaisePropertyChangedAuto(); } + } + + private bool _midTankEmpty; + + public bool MidTankEmpty + { + get { return _midTankEmpty; } + set { _midTankEmpty = value; RaisePropertyChangedAuto();} + } + + private bool _midTankRefillPumpActive; + + public bool MidTankRefillPumpActive + { + get { return _midTankRefillPumpActive; } + set { _midTankRefillPumpActive = value; RaisePropertyChangedAuto(); } + } + public IdsPack IDSPack { get; set; } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/MidTankLevelToElementRectConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/MidTankLevelToElementRectConverter.cs index b82ed2b52..2f0e73e2f 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/MidTankLevelToElementRectConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/MidTankLevelToElementRectConverter.cs @@ -17,9 +17,10 @@ namespace Tango.PPC.UI.Converters { double actualHeight = (double)values[0]; double actualWidth = (double)values[1]; - double midTankLevel = Math.Min((double)values[2], MachineOperator.MAX_MIDTANK_LITERS); + double maxLiters = (double)values[3]; + double midTankLevel = Math.Min((double)values[2], maxLiters); - var offset = (midTankLevel / MachineOperator.MAX_MIDTANK_LITERS) * actualHeight; + var offset = (midTankLevel / maxLiters) * actualHeight; return new System.Windows.Rect(1, offset, actualWidth, actualHeight); } catch 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 6d77ebcb9..1f4040460 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -9,6 +9,7 @@ using Tango.Core.Commands; using Tango.Core.DI; using Tango.Integration.Operation; using Tango.PMR.Diagnostics; +using Tango.PMR.MachineStatus; using Tango.PPC.Common; using Tango.PPC.Common.Diagnostics; using Tango.PPC.Jobs; @@ -16,6 +17,9 @@ using Tango.PPC.Jobs.NavigationObjects; using Tango.PPC.Jobs.Views; using Tango.PPC.Maintenance.Models; using Tango.PPC.UI.Models; +using System.Timers; +using System.Windows.Threading; +using System.Diagnostics; namespace Tango.PPC.UI.ViewModels { @@ -26,6 +30,9 @@ namespace Tango.PPC.UI.ViewModels [TangoInject] public IDiagnosticsFrameProvider DefaultDiagnosticsFrameProvider { get; set; } + private DispatcherTimer _ink_timer; + private Stopwatch _stopwatch; + private JobHandler _handler; @@ -190,6 +197,15 @@ namespace Tango.PPC.UI.ViewModels public MachineOverviewModel OverviewModel { get; set; } + private TimeSpan _timer; + + public TimeSpan FullInkTimer + { + get { return _timer; } + set { _timer = value; RaisePropertyChangedAuto();} + } + + #endregion #region Commands @@ -216,6 +232,10 @@ namespace Tango.PPC.UI.ViewModels public MachineStatusViewVM() { + _ink_timer = new DispatcherTimer(); + _ink_timer.Interval = TimeSpan.FromSeconds(1); + _ink_timer.Tick += _ink_timer_Tick; + StopCommand = new RelayCommand(StopJob, () => CanStopped()); AbortCommand = new RelayCommand(AbortJob, () => CanStopped()); GoToJobCommand = new RelayCommand(GoToJob); @@ -237,11 +257,76 @@ namespace Tango.PPC.UI.ViewModels MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.HasLevelMeasure).OrderBy(x => x.PackIndex).Select(x => new MidTankLevelModel() { - Max = MachineOperator.MAX_MIDTANK_LITERS, + Max = x.MidTankType.LiterCapacity, IDSPack = x, }).OrderBy(y => y.IDSPack.LiquidType.Code).ToList(); + // MachineProvider.MachineOperator.InkFillingStatusChanged += MachineOperator_InkFillingStatusChanged; + MachineProvider.MachineOperator.MachineStatusChanged += MachineOperator_MachineStatusChanged; + } + + #region Events + + private void MachineOperator_MachineStatusChanged(object sender, MachineStatus status) + { + UpdateMidTankLevels(status); + } + private void UpdateMidTankLevels(MachineStatus status) + { + if (!IsJobStatusViewEnable) + { + foreach (var item in status.IDSPacksLevels) + { + var model = MidTankLevels.SingleOrDefault(x => x.IDSPack.PackIndex == item.Index); + + if (model != null) + { + model.Level = item.MidTankLevel; + model.JerricanPresent = item.JerricanPresent; + model.FillingTimeoutError = item.FillingTimeoutError; + model.MidTankEmpty = item.MidTankEmpty; + model.MidTankRefillPumpActive = item.MidTankRefillPumpActive; + if (model.FillingTimeoutError) + { + //StartInkTimer() + } + } + } + } + } + private void StartInkTimer() + { + _stopwatch = Stopwatch.StartNew(); + _ink_timer.Start(); + } + + private void StopInkTimer() + { + if (_stopwatch.IsRunning) + { + _stopwatch.Stop(); + _ink_timer.Stop(); + } } + private void _ink_timer_Tick(object sender, EventArgs e) + { + FullInkTimer = _stopwatch.Elapsed; + } + private void MachineOperator_InkFillingStatusChanged(object sender, InkFillingStatusChangedEventArgs e) + { + //foreach (var cartridge in e.Status.CartridgesStatuses.Where(x => x.Cartridge.Slot != CartridgeSlot.Ink)) + //{ + // var wasteState = WasteStates.SingleOrDefault(x => x.Slot == cartridge.Cartridge.Slot); + + // if (wasteState != null) + // { + // wasteState.State = cartridge.State; + // } + //} + } + + #endregion + #region printing public override void OnApplicationStarted() diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index 6edc90844..998ab7db4 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -120,48 +120,52 @@ - + - - - + + + 30 88 - - - - - - - - + + + + + + + + + - - - + + + - - + + - + - - - - + + + + + + + @@ -196,13 +200,13 @@ - + - - - - + + + + @@ -238,13 +242,13 @@ - + - - - - + + + + @@ -880,7 +884,7 @@ - ºC + ºC Dryer Zone 3 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. --> - + diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index ac5e69425..8f8a04005 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -166,7 +166,7 @@ namespace Tango.Emulations.Emulators { Index = i, DispenserLevel = 130000000, - MidTankLevel = 2500, + MidTankLevel = 2.5, }); } -- cgit v1.3.1 From 963f8c4fa2b4da7d875dc223cd70c55e0d5390c1 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Thu, 11 May 2023 21:52:06 +0300 Subject: Show light inks --- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 44 ++++++++++++++-------- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 2 +- 2 files changed, 29 insertions(+), 17 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') 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 1f4040460..7cd328e7b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -20,6 +20,7 @@ using Tango.PPC.UI.Models; using System.Timers; using System.Windows.Threading; using System.Diagnostics; +using Tango.PMR.Printing; namespace Tango.PPC.UI.ViewModels { @@ -62,13 +63,6 @@ namespace Tango.PPC.UI.ViewModels set { _runningJobStatus = value; - IsDyeingProcess = (_runningJobStatus != null && _runningJobStatus.CurrentSegment != null); - if (_runningJobStatus != null && _runningJobStatus.CurrentSegment != null) - { - var segment = Job.Segments.FirstOrDefault(x => x.SegmentIndex == _runningJobStatus.CurrentSegment.SegmentIndex); - if (segment != null) - CurrentBrushStop = segment.FirstBrushStop; - } RaisePropertyChangedAuto(); } } @@ -128,13 +122,12 @@ namespace Tango.PPC.UI.ViewModels } private BrushStop _currentBrushStop; - public BrushStop CurrentBrushStop { get { return _currentBrushStop; } set { - if (_currentBrushStop != value) + // if (_currentBrushStop != value) { _currentBrushStop = value; OnUpdateCurrentBrush(); @@ -143,6 +136,8 @@ namespace Tango.PPC.UI.ViewModels } } + public JobBrushStop JobBrushStop { get; set; } + public double CyanOutput { get { return GetVolumeLiquidType(LiquidTypes.Cyan); } @@ -202,7 +197,7 @@ namespace Tango.PPC.UI.ViewModels public TimeSpan FullInkTimer { get { return _timer; } - set { _timer = value; RaisePropertyChangedAuto();} + set { _timer = value; RaisePropertyChangedAuto(); } } @@ -260,7 +255,7 @@ namespace Tango.PPC.UI.ViewModels Max = x.MidTankType.LiterCapacity, IDSPack = x, }).OrderBy(y => y.IDSPack.LiquidType.Code).ToList(); - // MachineProvider.MachineOperator.InkFillingStatusChanged += MachineOperator_InkFillingStatusChanged; + // MachineProvider.MachineOperator.InkFillingStatusChanged += MachineOperator_InkFillingStatusChanged; MachineProvider.MachineOperator.MachineStatusChanged += MachineOperator_MachineStatusChanged; } @@ -385,10 +380,27 @@ namespace Tango.PPC.UI.ViewModels private void JobHandler_StatusChanged(object sender, RunningJobStatus e) { - InvokeUI(() => + //InvokeUI(() => + //{ + + + RunningJobStatus = e; + IsDyeingProcess = (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null); + if (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null) { - RunningJobStatus = e; - }); + 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; + } + } + //}); } private void JobHandler_CanCancelChanged(object sender, EventArgs e) @@ -439,9 +451,9 @@ namespace Tango.PPC.UI.ViewModels private double GetVolumeLiquidType(LiquidTypes liquidType) { - if (CurrentBrushStop != null && CurrentBrushStop.LiquidVolumes != null && CurrentBrushStop.LiquidVolumes.Count > 0) + if (JobBrushStop != null && JobBrushStop.Dispensers != null && JobBrushStop.Dispensers.Count > 0) { - var lt = CurrentBrushStop.LiquidVolumes.FirstOrDefault(x => x.LiquidType == liquidType); + var lt = JobBrushStop.Dispensers.FirstOrDefault(x => x.DispenserLiquidType == (DispenserLiquidType)liquidType); if (lt != null) { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index 998ab7db4..383ce77e6 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -163,7 +163,7 @@ - + -- cgit v1.3.1 From 7d54607a2a61b9a99376b385c40e94257365eb18 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Sun, 14 May 2023 16:45:03 +0300 Subject: Working on Jerrican Levels Twine X4. --- .../PMR/Messages/MachineStatus/IDSPackLevel.proto | 2 + .../Models/MidTankLevelModel.cs | 38 +-------- .../Converters/LiquidTypeToBrushConverter.cs | 9 +-- .../Images/Overview Icons/JericanRemoved.png | Bin 0 -> 1038 bytes .../PPC/Tango.PPC.UI/Models/JerricanLevelModel.cs | 85 +++++++++++++++++++++ .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 4 +- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 59 +++----------- .../PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml | 8 +- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 57 ++++++++++---- .../Tango.PMR/MachineStatus/IDSPackLevel.cs | 36 ++++++++- 10 files changed, 178 insertions(+), 120 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/JericanRemoved.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Models/JerricanLevelModel.cs (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') diff --git a/Software/PMR/Messages/MachineStatus/IDSPackLevel.proto b/Software/PMR/Messages/MachineStatus/IDSPackLevel.proto index 36658e117..5b0268684 100644 --- a/Software/PMR/Messages/MachineStatus/IDSPackLevel.proto +++ b/Software/PMR/Messages/MachineStatus/IDSPackLevel.proto @@ -13,4 +13,6 @@ message IDSPackLevel bool FillingTimeoutError = 5; bool MidTankEmpty = 6; bool MidTankRefillPumpActive = 7; + + int32 TimerRemainingSeconds = 8; } \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs index c656db8c0..8ea16fe1b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs @@ -28,43 +28,7 @@ namespace Tango.PPC.Maintenance.Models public bool IsEmpty { get { return Level <= MachineOperator.EMPTY_MIDTANK_LITERS; } - } - - private bool _bJerricanPresent; - - public bool JerricanPresent - { - get { return _bJerricanPresent; } - set { - _bJerricanPresent = value; - RaisePropertyChangedAuto(); - } - } - - private bool _fillingTimeoutError; - - public bool FillingTimeoutError - { - get { return _fillingTimeoutError; } - set { _fillingTimeoutError = value; RaisePropertyChangedAuto(); } - } - - private bool _midTankEmpty; - - public bool MidTankEmpty - { - get { return _midTankEmpty; } - set { _midTankEmpty = value; RaisePropertyChangedAuto();} - } - - private bool _midTankRefillPumpActive; - - public bool MidTankRefillPumpActive - { - get { return _midTankRefillPumpActive; } - set { _midTankRefillPumpActive = value; RaisePropertyChangedAuto(); } - } - + } public IdsPack IDSPack { get; set; } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LiquidTypeToBrushConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LiquidTypeToBrushConverter.cs index 8e419b6fd..f9ced3719 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LiquidTypeToBrushConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LiquidTypeToBrushConverter.cs @@ -20,14 +20,7 @@ namespace Tango.PPC.UI.Converters { case BL.Enumerations.LiquidTypes.Lubricant: { - - ImageBrush lubricantBrush = new ImageBrush() { Stretch = Stretch.None, TileMode = TileMode.Tile, ViewportUnits = BrushMappingMode.Absolute }; - - BitmapSource bit_source = ResourceHelper.GetImageFromResources(@"Images/lubricant2.png"); - var targetBitmap = new WriteableBitmap(new TransformedBitmap(bit_source, new ScaleTransform(0.2, 0.2))); - lubricantBrush.ImageSource = targetBitmap; - lubricantBrush.Viewport = new System.Windows.Rect(2, 2, targetBitmap.Width, targetBitmap.Height); - return lubricantBrush; + return Application.Current.Resources["TangoLubricantBrush"] as Brush; } case BL.Enumerations.LiquidTypes.Cleaner: { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/JericanRemoved.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/JericanRemoved.png new file mode 100644 index 000000000..4567d5146 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/JericanRemoved.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/JerricanLevelModel.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/JerricanLevelModel.cs new file mode 100644 index 000000000..13fa455e5 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/JerricanLevelModel.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.Core; +using Tango.Integration.Operation; + +namespace Tango.PPC.UI.Models +{ + public class JerricanLevelModel : ExtendedObject + { + public double Max { get; set; } + + private double _level; + public double Level + { + get { return _level; } + set { _level = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(IsMidTankLow)); } + } + + private bool _bJerricanPresent; + + public bool JerricanPresent + { + get { return _bJerricanPresent; } + set { + _bJerricanPresent = value; + RaisePropertyChangedAuto(); + } + } + + private bool _fillingTimeoutError; + + public bool FillingTimeoutError + { + get { return _fillingTimeoutError; } + set { _fillingTimeoutError = value; RaisePropertyChangedAuto(); } + } + + private bool _midTankEmpty; + + public bool MidTankEmpty + { + get { return _midTankEmpty; } + set { _midTankEmpty = value; RaisePropertyChangedAuto();} + } + + private bool _midTankRefillPumpActive; + + public bool MidTankRefillPumpActive + { + get { return _midTankRefillPumpActive; } + set { _midTankRefillPumpActive = value; RaisePropertyChangedAuto(); } + } + + public bool IsMidTankLow + { + get { return Level <= 0.5; } + } + + private TimeSpan _remainingTimeoutError_; + public TimeSpan RemainingTimeoutError + { + get { return _remainingTimeoutError_; } + set { _remainingTimeoutError_ = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(HasRemainingTimeoutError)); } + } + + public bool HasRemainingTimeoutError + { + get { return RemainingTimeoutError > TimeSpan.Zero; } + } + + + public IdsPack IDSPack { get; set; } + + public JerricanLevelModel() + { + //RemainingTimeoutError = new TimeSpan(1,2,0); + JerricanPresent = true; + //FillingTimeoutError = MidTankEmpty = MidTankRefillPumpActive = false; + } + } +} 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 ce7b9746b..120001ea3 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 @@ -234,6 +234,7 @@ + @@ -613,6 +614,7 @@ + @@ -950,7 +952,7 @@ if $(ConfigurationName) == Eureka copy /Y "$(ProjectDir)Intro.wmv" "$(TargetDir) - + 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 7cd328e7b..a47b68a4f 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -15,7 +15,6 @@ using Tango.PPC.Common.Diagnostics; using Tango.PPC.Jobs; using Tango.PPC.Jobs.NavigationObjects; using Tango.PPC.Jobs.Views; -using Tango.PPC.Maintenance.Models; using Tango.PPC.UI.Models; using System.Timers; using System.Windows.Threading; @@ -31,10 +30,6 @@ namespace Tango.PPC.UI.ViewModels [TangoInject] public IDiagnosticsFrameProvider DefaultDiagnosticsFrameProvider { get; set; } - private DispatcherTimer _ink_timer; - private Stopwatch _stopwatch; - - private JobHandler _handler; private Job _job; @@ -127,7 +122,7 @@ namespace Tango.PPC.UI.ViewModels get { return _currentBrushStop; } set { - // if (_currentBrushStop != value) + // if (_currentBrushStop != value) { _currentBrushStop = value; OnUpdateCurrentBrush(); @@ -183,8 +178,8 @@ namespace Tango.PPC.UI.ViewModels // get { return GetVolumeLiquidType(LiquidTypes.Lubricant); } //} - private List _midTankLevels; - public List MidTankLevels + private List _midTankLevels; + public List MidTankLevels { get { return _midTankLevels; } set { _midTankLevels = value; RaisePropertyChangedAuto(); } @@ -192,15 +187,6 @@ namespace Tango.PPC.UI.ViewModels public MachineOverviewModel OverviewModel { get; set; } - private TimeSpan _timer; - - public TimeSpan FullInkTimer - { - get { return _timer; } - set { _timer = value; RaisePropertyChangedAuto(); } - } - - #endregion #region Commands @@ -227,9 +213,7 @@ namespace Tango.PPC.UI.ViewModels public MachineStatusViewVM() { - _ink_timer = new DispatcherTimer(); - _ink_timer.Interval = TimeSpan.FromSeconds(1); - _ink_timer.Tick += _ink_timer_Tick; + StopCommand = new RelayCommand(StopJob, () => CanStopped()); AbortCommand = new RelayCommand(AbortJob, () => CanStopped()); @@ -250,13 +234,14 @@ namespace Tango.PPC.UI.ViewModels { base.OnApplicationReady(); - MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.HasLevelMeasure).OrderBy(x => x.PackIndex).Select(x => new MidTankLevelModel() + MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.HasLevelMeasure || x.MidTankType.Type == MidTankTypes.LubricantMidTank).OrderBy(x => x.PackIndex).Select(x => new JerricanLevelModel() { Max = x.MidTankType.LiterCapacity, IDSPack = x, - }).OrderBy(y => y.IDSPack.LiquidType.Code).ToList(); - // MachineProvider.MachineOperator.InkFillingStatusChanged += MachineOperator_InkFillingStatusChanged; + }).OrderBy(y => y.IDSPack.LiquidType.PreferredIndex).ToList(); + MachineProvider.MachineOperator.MachineStatusChanged += MachineOperator_MachineStatusChanged; + } #region Events @@ -280,33 +265,12 @@ namespace Tango.PPC.UI.ViewModels model.FillingTimeoutError = item.FillingTimeoutError; model.MidTankEmpty = item.MidTankEmpty; model.MidTankRefillPumpActive = item.MidTankRefillPumpActive; - if (model.FillingTimeoutError) - { - //StartInkTimer() - } + model.RemainingTimeoutError = TimeSpan.FromSeconds(item.TimerRemainingSeconds); } } } } - private void StartInkTimer() - { - _stopwatch = Stopwatch.StartNew(); - _ink_timer.Start(); - } - - private void StopInkTimer() - { - if (_stopwatch.IsRunning) - { - _stopwatch.Stop(); - _ink_timer.Stop(); - } - } - private void _ink_timer_Tick(object sender, EventArgs e) - { - FullInkTimer = _stopwatch.Elapsed; - } private void MachineOperator_InkFillingStatusChanged(object sender, InkFillingStatusChangedEventArgs e) { //foreach (var cartridge in e.Status.CartridgesStatuses.Where(x => x.Cartridge.Slot != CartridgeSlot.Ink)) @@ -380,10 +344,6 @@ namespace Tango.PPC.UI.ViewModels private void JobHandler_StatusChanged(object sender, RunningJobStatus e) { - //InvokeUI(() => - //{ - - RunningJobStatus = e; IsDyeingProcess = (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null); if (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null) @@ -400,7 +360,6 @@ namespace Tango.PPC.UI.ViewModels CurrentBrushStop = segment.FirstBrushStop; } } - //}); } private void JobHandler_CanCancelChanged(object sender, EventArgs e) diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml index bc319367c..acaf14f15 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml @@ -42,11 +42,11 @@ - - + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index 383ce77e6..b6541df1f 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -11,6 +11,7 @@ xmlns:locaControls="clr-namespace:Tango.PPC.UI.Controls" xmlns:localConverters="clr-namespace:Tango.PPC.UI.Converters" xmlns:global="clr-namespace:Tango.PPC.UI" + xmlns:models="clr-namespace:Tango.PPC.UI.Models" xmlns:local="clr-namespace:Tango.PPC.UI.Views" mc:Ignorable="d" d:DesignHeight="1280" d:DesignWidth="932" d:DataContext="{d:DesignInstance Type=vm:MachineStatusViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MachineStatusViewVM}"> @@ -121,10 +122,11 @@ - + - + + @@ -163,9 +165,30 @@ - - - + + + + + @@ -173,7 +196,8 @@ - + + @@ -212,10 +236,11 @@ - - + + --> @@ -1053,8 +1078,8 @@ Waste - - + + @@ -1072,8 +1097,8 @@ - - + diff --git a/Software/Visual_Studio/Tango.PMR/MachineStatus/IDSPackLevel.cs b/Software/Visual_Studio/Tango.PMR/MachineStatus/IDSPackLevel.cs index 099069143..a11341386 100644 --- a/Software/Visual_Studio/Tango.PMR/MachineStatus/IDSPackLevel.cs +++ b/Software/Visual_Studio/Tango.PMR/MachineStatus/IDSPackLevel.cs @@ -23,16 +23,16 @@ namespace Tango.PMR.MachineStatus { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "ChJJRFNQYWNrTGV2ZWwucHJvdG8SF1RhbmdvLlBNUi5NYWNoaW5lU3RhdHVz", - "IrgBCgxJRFNQYWNrTGV2ZWwSDQoFSW5kZXgYASABKAUSFgoORGlzcGVuc2Vy", + "ItcBCgxJRFNQYWNrTGV2ZWwSDQoFSW5kZXgYASABKAUSFgoORGlzcGVuc2Vy", "TGV2ZWwYAiABKAUSFAoMTWlkVGFua0xldmVsGAMgASgBEhcKD0plcnJpY2Fu", "UHJlc2VudBgEIAEoCBIbChNGaWxsaW5nVGltZW91dEVycm9yGAUgASgIEhQK", "DE1pZFRhbmtFbXB0eRgGIAEoCBIfChdNaWRUYW5rUmVmaWxsUHVtcEFjdGl2", - "ZRgHIAEoCEIjCiFjb20udHdpbmUudGFuZ28ucG1yLm1hY2hpbmVzdGF0dXNi", - "BnByb3RvMw==")); + "ZRgHIAEoCBIdChVUaW1lclJlbWFpbmluZ1NlY29uZHMYCCABKAVCIwohY29t", + "LnR3aW5lLnRhbmdvLnBtci5tYWNoaW5lc3RhdHVzYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.MachineStatus.IDSPackLevel), global::Tango.PMR.MachineStatus.IDSPackLevel.Parser, new[]{ "Index", "DispenserLevel", "MidTankLevel", "JerricanPresent", "FillingTimeoutError", "MidTankEmpty", "MidTankRefillPumpActive" }, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.MachineStatus.IDSPackLevel), global::Tango.PMR.MachineStatus.IDSPackLevel.Parser, new[]{ "Index", "DispenserLevel", "MidTankLevel", "JerricanPresent", "FillingTimeoutError", "MidTankEmpty", "MidTankRefillPumpActive", "TimerRemainingSeconds" }, null, null, null) })); } #endregion @@ -70,6 +70,7 @@ namespace Tango.PMR.MachineStatus { fillingTimeoutError_ = other.fillingTimeoutError_; midTankEmpty_ = other.midTankEmpty_; midTankRefillPumpActive_ = other.midTankRefillPumpActive_; + timerRemainingSeconds_ = other.timerRemainingSeconds_; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -154,6 +155,17 @@ namespace Tango.PMR.MachineStatus { } } + /// Field number for the "TimerRemainingSeconds" field. + public const int TimerRemainingSecondsFieldNumber = 8; + private int timerRemainingSeconds_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int TimerRemainingSeconds { + get { return timerRemainingSeconds_; } + set { + timerRemainingSeconds_ = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as IDSPackLevel); @@ -174,6 +186,7 @@ namespace Tango.PMR.MachineStatus { if (FillingTimeoutError != other.FillingTimeoutError) return false; if (MidTankEmpty != other.MidTankEmpty) return false; if (MidTankRefillPumpActive != other.MidTankRefillPumpActive) return false; + if (TimerRemainingSeconds != other.TimerRemainingSeconds) return false; return true; } @@ -187,6 +200,7 @@ namespace Tango.PMR.MachineStatus { if (FillingTimeoutError != false) hash ^= FillingTimeoutError.GetHashCode(); if (MidTankEmpty != false) hash ^= MidTankEmpty.GetHashCode(); if (MidTankRefillPumpActive != false) hash ^= MidTankRefillPumpActive.GetHashCode(); + if (TimerRemainingSeconds != 0) hash ^= TimerRemainingSeconds.GetHashCode(); return hash; } @@ -225,6 +239,10 @@ namespace Tango.PMR.MachineStatus { output.WriteRawTag(56); output.WriteBool(MidTankRefillPumpActive); } + if (TimerRemainingSeconds != 0) { + output.WriteRawTag(64); + output.WriteInt32(TimerRemainingSeconds); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -251,6 +269,9 @@ namespace Tango.PMR.MachineStatus { if (MidTankRefillPumpActive != false) { size += 1 + 1; } + if (TimerRemainingSeconds != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TimerRemainingSeconds); + } return size; } @@ -280,6 +301,9 @@ namespace Tango.PMR.MachineStatus { if (other.MidTankRefillPumpActive != false) { MidTankRefillPumpActive = other.MidTankRefillPumpActive; } + if (other.TimerRemainingSeconds != 0) { + TimerRemainingSeconds = other.TimerRemainingSeconds; + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -318,6 +342,10 @@ namespace Tango.PMR.MachineStatus { MidTankRefillPumpActive = input.ReadBool(); break; } + case 64: { + TimerRemainingSeconds = input.ReadInt32(); + break; + } } } } -- cgit v1.3.1 From cd8bec354b018a03ed3960ed4f76970d4cbff2ef Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Tue, 16 May 2023 16:12:09 +0300 Subject: Bugs + added Display Job Outline button in Tech. mode Related Work Items: #8407 --- .../Modules/Tango.PPC.JobsV2/Models/JobModel.cs | 2 +- .../PPC/Tango.PPC.UI/Controls/JobOutlineControl.cs | 327 ++++ .../MidTankLevelToElementRectConverter.cs | 2 +- .../Tango.PPC.UI/Models/MachineOverviewModel.cs | 30 +- .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 1 + .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 91 ++ .../PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml | 4 +- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 1659 ++++++++++---------- 8 files changed, 1280 insertions(+), 836 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/JobOutlineControl.cs (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs index 00dcf6f8b..8267fd3aa 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs @@ -390,7 +390,7 @@ namespace Tango.PPC.Jobs.Models int coeff = (int)(value + NumberSpools - 1) / NumberSpools; _copies = coeff * NumberSpools; } - NumberOfUnits = (int)value / NumberSpools; + NumberOfUnits = (int)_copies / NumberSpools; RaisePropertyChanged(nameof(LengthIncludingNumberOfUnits)); RaisePropertyChanged(nameof(LengthIncludingNumberOfUnitsAndSpools)); } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/JobOutlineControl.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/JobOutlineControl.cs new file mode 100644 index 000000000..a22afe3ea --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/JobOutlineControl.cs @@ -0,0 +1,327 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Media; +using System.Windows.Shapes; +using Tango.PMR.Printing; +using Tango.Touch.Controls; + +namespace Tango.PPC.UI.Controls +{ + public class JobOutlineControl : Control + { + + #region Members + + private Size _sizeControl = new Size(0, 0); + ScrollViewer _parentScrollViewer = null; + public struct LevelOffset + { + public const double level_0 = 0.0; + public const double level_1 = 10.0; + public const double level_2 = 20.0; + public const double level_3 = 37.0; + public const double level_4 = 50.0; + public const double level_5 = 60.0; + public const double level_6 = 77.0; + public const double level_7 = 90.0; + public const double level_8 = 100.0; + } + private double _verticalOffset = 0; + private double _viewportHeight = 0; + private const double HEADER_FONT_HEIGHT = 35; + private const double TITLE_FONT_HEIGHT = 22; + private const double SUB_TITLE_FONT_HEIGHT = 19; + private const double NORMAL_FONT_HEIGHT = 17; + private const double WIDTH = 330; + + #endregion members + + public JobOutlineControl() : base() + { + DataContextChanged += JobOutlineControl_DataContextChanged; + Width = WIDTH; + } + + private void JobOutlineControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) + { + if (DataContext == null) + { + return; + } + + if (_parentScrollViewer != null) + { + _parentScrollViewer.ScrollToTop(); + } + + InvalidateVisual(); + } + + #region events + + private void ScrollViewer_ScrollChanged(object sender, ScrollChangedEventArgs e) + { + if (e.VerticalChange == 0.0) + return; + + _verticalOffset = _parentScrollViewer.VerticalOffset; + _viewportHeight = _parentScrollViewer.ViewportHeight; + InvalidateVisual(); + } + #endregion events + + #region render + protected override void OnRender(DrawingContext drawingContext) + { + base.OnRender(drawingContext); + + if (!(DataContext is JobTicket job)) return; + if (_parentScrollViewer == null) + { + _parentScrollViewer = this.FindAncestor(); + _parentScrollViewer.ScrollChanged -= ScrollViewer_ScrollChanged; + _parentScrollViewer.ScrollChanged += ScrollViewer_ScrollChanged; + } + else if (_viewportHeight == 0) + { + _viewportHeight = _parentScrollViewer.ActualHeight; + } + _sizeControl = new Size(); + _sizeControl.Height += 10; + DrawHeaderText(drawingContext, "JOB OUTLINE", 30, LevelOffset.level_0); + _sizeControl.Height += HEADER_FONT_HEIGHT; + + _sizeControl.Height += 20; + DrawHeaderText(drawingContext, "BASIC", 17, LevelOffset.level_0); + _sizeControl.Height += TITLE_FONT_HEIGHT; + _sizeControl.Height += 5.0; + var basicProps = GetNameValueList(job); + foreach (var prop in basicProps) + { + DrawNameValueText(drawingContext, prop, LevelOffset.level_1, TouchIconKind.Pencil); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + } + //JobTicket.Spool + if (job.Spool != null) + { + _sizeControl.Height += 20; + DrawHeaderText(drawingContext, "SPOOL", 17, LevelOffset.level_0); + _sizeControl.Height += TITLE_FONT_HEIGHT; + _sizeControl.Height += 5.0; + basicProps = GetNameValueList(job.Spool); + foreach (var prop in basicProps) + { + DrawNameValueText(drawingContext, prop, LevelOffset.level_1, TouchIconKind.Pencil); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + } + } + //JobTicket.ProcessParameters + if (job.ProcessParameters != null) + { + _sizeControl.Height += 20; + DrawHeaderText(drawingContext, "PROCESS PARAMETERS", 17, LevelOffset.level_0); + _sizeControl.Height += TITLE_FONT_HEIGHT; + _sizeControl.Height += 5.0; + basicProps = GetNameValueList(job.ProcessParameters); + foreach (var prop in basicProps) + { + DrawNameValueText(drawingContext, prop, LevelOffset.level_1, TouchIconKind.Settings); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + } + } + //JobTicket.ThreadParameters + if (job.ThreadParameters != null) + { + _sizeControl.Height += 20; + DrawHeaderText(drawingContext, "THREAD PARAMETERS", 17, LevelOffset.level_0); + _sizeControl.Height += TITLE_FONT_HEIGHT; + _sizeControl.Height += 5.0; + basicProps = GetNameValueList(job.ThreadParameters); + foreach (var prop in basicProps) + { + DrawNameValueText(drawingContext, prop, LevelOffset.level_1, TouchIconKind.Settings); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + } + } + //JobTicket.HeadCleaningParameters + if (job.HeadCleaningParameters != null) + { + _sizeControl.Height += 20; + DrawHeaderText(drawingContext, "HEAD CLEANING PARAMETERS", 17, LevelOffset.level_0); + _sizeControl.Height += TITLE_FONT_HEIGHT; + _sizeControl.Height += 5.0; + basicProps = GetNameValueList(job.HeadCleaningParameters); + foreach (var prop in basicProps) + { + DrawNameValueText(drawingContext, prop, LevelOffset.level_1, TouchIconKind.Settings); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + } + } + //JobTicket.BtsrParameters + if (job.BtsrParameters != null) + { + _sizeControl.Height += 20; + DrawHeaderText(drawingContext, "BTSR PARAMETERS", 17, LevelOffset.level_0); + _sizeControl.Height += TITLE_FONT_HEIGHT; + _sizeControl.Height += 5.0; + basicProps = GetNameValueList(job.BtsrParameters); + foreach (var prop in basicProps) + { + DrawNameValueText(drawingContext, prop, LevelOffset.level_1, TouchIconKind.Settings); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + } + } + //JobTicket.Segments + if (job.Segments != null) + { + _sizeControl.Height += 20; + DrawHeaderText(drawingContext, "SEGMENTS", 17, LevelOffset.level_0); + _sizeControl.Height += TITLE_FONT_HEIGHT; + _sizeControl.Height += 10.0; + int index = 0; + foreach (JobSegment seg in job.Segments) + { + DrawHeaderText(drawingContext, string.Format("#{0} SEGMENT", ++index), 14, LevelOffset.level_1); + _sizeControl.Height += SUB_TITLE_FONT_HEIGHT; + basicProps = GetNameValueList(seg); + foreach (var prop in basicProps) + { + DrawNameValueText(drawingContext, prop, LevelOffset.level_2, TouchIconKind.Pencil); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + } + //BrushStops + DrawHeaderText(drawingContext, "BRUSH STOPS", 12, LevelOffset.level_3); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + int indexBrush = 0; + foreach (JobBrushStop brushstop in seg.BrushStops) + { + _sizeControl.Height += 5.0; + DrawHeaderText(drawingContext, string.Format("#{0} STOP", ++indexBrush), 11, LevelOffset.level_4); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + var brushStops = GetNameValueList(brushstop); + foreach (var brushstopprop in brushStops) + { + DrawNameValueText(drawingContext, brushstopprop, LevelOffset.level_5, TouchIconKind.Pencil); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + } + DrawHeaderText(drawingContext, "DISPENSERS", 12, LevelOffset.level_6); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + _sizeControl.Height += 5.0; + int indexDispenser = 0; + foreach (JobDispenser disp in brushstop.Dispensers) + { + DrawHeaderText(drawingContext, string.Format("#{0} DISPENSER", ++indexDispenser), 11, LevelOffset.level_6); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + var dispProperties = GetNameValueList(disp); + foreach (var dispprop in dispProperties) + { + DrawNameValueText(drawingContext, dispprop, LevelOffset.level_7, TouchIconKind.ArrowRightBoldCircle); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + } + } + } + } + } + + if (Height != _sizeControl.Height) + { + Height = _sizeControl.Height; + } + } + public IEnumerable> GetNameValueList(object value) + { + if (value != null) + { + var properties = value.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => (!x.PropertyType.IsClass && !typeof(IEnumerable).IsAssignableFrom(x.PropertyType)) || x.PropertyType == typeof(String)).ToList(); + return properties.Select(x => new Tuple(x.Name, x.GetValue(value).ToString())); + } + else + { + return null; + } + } + #endregion render + + #region drawing + protected void DrawNameValueText(DrawingContext drawingContext, Tuple text, double levelOfOffset, TouchIconKind? icon) + { + if (IsInViewPort()) + { + FormattedText formattedName = new FormattedText(text.Item1 + ": ", System.Globalization.CultureInfo.InvariantCulture, System.Windows.FlowDirection.LeftToRight, new Typeface(this.FontFamily, FontStyles.Normal, FontWeights.Normal, FontStretches.Normal), + 12, Foreground); + DrawIconTextIfVisible(drawingContext, levelOfOffset, formattedName, icon); + double widthOfNameText = formattedName.WidthIncludingTrailingWhitespace + 17 + levelOfOffset;//17 pix for draw icon before text + + FormattedText formattedValue = new FormattedText(text.Item2, System.Globalization.CultureInfo.InvariantCulture, System.Windows.FlowDirection.LeftToRight, new Typeface(this.FontFamily, FontStyles.Normal, FontWeights.SemiBold, FontStretches.Normal), + 12, Foreground); + DrawIconTextIfVisible(drawingContext, widthOfNameText, formattedValue); + _sizeControl.Width = Math.Max(_sizeControl.Width, (widthOfNameText + formattedValue.WidthIncludingTrailingWhitespace)); + } + } + + private bool IsInViewPort() + { + return (_sizeControl.Height >= _verticalOffset && _sizeControl.Height <= (_verticalOffset + _viewportHeight + 5)); + } + + protected void DrawHeaderText(DrawingContext drawingContext, string text, int fontSize, double levelOfOffset) + { + if (IsInViewPort()) + { + FormattedText formattedtext = new FormattedText(text, System.Globalization.CultureInfo.InvariantCulture, System.Windows.FlowDirection.LeftToRight, new Typeface(this.FontFamily, FontStyles.Normal, FontWeights.SemiBold, FontStretches.Normal), + fontSize, Foreground); + DrawIconTextIfVisible(drawingContext, levelOfOffset, formattedtext); + _sizeControl.Width = Math.Max(_sizeControl.Width, (formattedtext.Width + levelOfOffset)); + } + } + + private void DrawIconTextIfVisible(DrawingContext drawingContext, double levelOfOffset, FormattedText formattedText, TouchIconKind? icon = null) + { + if (icon is TouchIconKind) + { + DrawIcon(drawingContext, (TouchIconKind)icon, new Point(levelOfOffset, _sizeControl.Height)); + levelOfOffset += 17; + } + drawingContext.DrawText(formattedText, new Point(levelOfOffset, _sizeControl.Height)); + } + private void DrawIcon(DrawingContext drawingContext, TouchIconKind kind, Point point) + { + GeometryGroup group = GetGeometryByIcon(kind); + SetGeometryPosition(group, point); + drawingContext.DrawGeometry(Foreground, new Pen(Brushes.White, 1), group); + + } + private GeometryGroup GetGeometryByIcon(TouchIconKind kind) + { + Geometry geometry = Geometry.Parse(TouchIcon.Icons[kind]); + GeometryGroup group = new GeometryGroup(); + group.Children.Add(geometry); + + TransformGroup tg = new TransformGroup(); + tg.Children.Add(new ScaleTransform() + { + ScaleX = 10d / geometry.Bounds.Width, + ScaleY = 10d / geometry.Bounds.Height, + }); + tg.Children.Add(new TranslateTransform() { }); + + group.Transform = tg; + return group; + } + private void SetGeometryPosition(GeometryGroup group, Point point) + { + TransformGroup tg = group.Transform as TransformGroup; + (tg.Children[1] as TranslateTransform).X = point.X; + (tg.Children[1] as TranslateTransform).Y = point.Y + 1; + } + #endregion drawing + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/MidTankLevelToElementRectConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/MidTankLevelToElementRectConverter.cs index 2f0e73e2f..93576a8fb 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/MidTankLevelToElementRectConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/MidTankLevelToElementRectConverter.cs @@ -20,7 +20,7 @@ namespace Tango.PPC.UI.Converters double maxLiters = (double)values[3]; double midTankLevel = Math.Min((double)values[2], maxLiters); - var offset = (midTankLevel / maxLiters) * actualHeight; + var offset = actualHeight - (midTankLevel / maxLiters) * actualHeight; return new System.Windows.Rect(1, offset, actualWidth, actualHeight); } catch diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs index d5d8407b7..bd34122c6 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs @@ -14,6 +14,8 @@ namespace Tango.PPC.UI.Models { public class MachineOverviewModel : ExtendedObject { + public static double DryerAirMaxValue = 120.0; + public MachineOverviewItem DryerZone3 { get; set; } public MachineOverviewItem DryerAir { get; set; } public MachineOverviewItem Tunnel { get; set; } @@ -42,7 +44,7 @@ namespace Tango.PPC.UI.Models { DryerZone3 = new MachineOverviewItem(); DryerAir = new MachineOverviewItem(); - DryerAir.MaxValue =140; + DryerAir.MaxValue = DryerAirMaxValue; Tunnel = new MachineOverviewItem(); PumpsPressure = new MachineOverviewItem(); PumpsPressure.MaxValue = 6; @@ -84,7 +86,9 @@ namespace Tango.PPC.UI.Models if (state != null) { - if (state.IsRampingUp) + if (state.IsRampingUp && + (state.SetPoint != 0 + && (state.CurrentValue <= (state.SetPoint - 10)))) { item.Status = "Heating Up"; item.Color = Colors.Orange; @@ -92,15 +96,7 @@ namespace Tango.PPC.UI.Models item.MaxValue = state.SetPoint; item.Value = state.CurrentValue; } - else if (state.CurrentValue > state.SetPoint) - { - item.Status = "Over-temperature"; - item.Color = Colors.Red; - item.DisplayValue = $"{state.CurrentValue} / {state.SetPoint}"; - item.MaxValue = state.SetPoint; - item.Value = state.CurrentValue; - } - else if (state.IsInSetPoint) + else if (state.SetPoint == 0 || (state.CurrentValue >= (state.SetPoint - 10) || state.CurrentValue <= (state.SetPoint + 10))) { item.Status = "Operational"; item.Color = Colors.Green; @@ -108,6 +104,14 @@ namespace Tango.PPC.UI.Models item.MaxValue = state.SetPoint; item.Value = state.CurrentValue; } + else if (!state.IsRampingUp && (state.CurrentValue < (state.SetPoint - 10) || state.CurrentValue > (state.SetPoint + 10))) + { + item.Status = "Over-temperature"; + item.Color = Colors.Red; + item.DisplayValue = $"{state.CurrentValue} / {state.SetPoint}"; + item.MaxValue = state.SetPoint; + item.Value = state.CurrentValue > state.SetPoint? state.SetPoint : state.CurrentValue; + } else { item.Color = Colors.Gray; @@ -119,13 +123,13 @@ namespace Tango.PPC.UI.Models private void UpdateDryerAirItem(double currentvalue) { - if (currentvalue < 140) + if (currentvalue < DryerAirMaxValue) { DryerAir.Status = "Heating Up"; DryerAir.Color = Colors.Orange; DryerAir.DisplayValue = $"{currentvalue}"; } - else if (currentvalue >= 140) + else if (currentvalue >= DryerAirMaxValue) { DryerAir.Status = "Operational"; DryerAir.Color = Colors.Green; 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 120001ea3..12d0486bd 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 @@ -158,6 +158,7 @@ WiFiAuthenticationView.xaml + MachineStatusControl.xaml 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 a47b68a4f..828047ccf 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -187,6 +187,26 @@ namespace Tango.PPC.UI.ViewModels public MachineOverviewModel OverviewModel { get; set; } + private bool _isDisplayJobOutline; + /// + /// Gets or sets a value indicating whether to display the job outline. + /// + public bool IsDisplayJobOutline + { + get { return _isDisplayJobOutline; } + set { _isDisplayJobOutline = value; RaisePropertyChangedAuto(); } + } + + private JobTicket _jobOutlineTicket; + /// + /// Gets or sets the job outline ticket. + /// + public JobTicket JobOutlineTicket + { + get { return _jobOutlineTicket; } + set { _jobOutlineTicket = value; RaisePropertyChangedAuto(); } + } + #endregion #region Commands @@ -209,6 +229,10 @@ namespace Tango.PPC.UI.ViewModels public RelayCommand ClearAllNotificationsCommand { get; set; } + public RelayCommand DisplayJobOutlineCommand { get; set; } + + public RelayCommand HideJobOutlineCommand { get; set; } + #endregion public MachineStatusViewVM() @@ -221,6 +245,8 @@ namespace Tango.PPC.UI.ViewModels JobStatusViewCommand = new RelayCommand(JobStatusView); OverviewViewCommand = new RelayCommand(OverviewView); ClearAllNotificationsCommand = new RelayCommand(ClearAllNotifications); + DisplayJobOutlineCommand = new RelayCommand(DisplayJobOutline); + HideJobOutlineCommand = new RelayCommand(HideJobOutline); IsJobStatusViewEnable = true; IsEnabledStopButton = false; @@ -267,6 +293,57 @@ namespace Tango.PPC.UI.ViewModels model.MidTankRefillPumpActive = item.MidTankRefillPumpActive; model.RemainingTimeoutError = TimeSpan.FromSeconds(item.TimerRemainingSeconds); } + //TEST + //if (model != null) + //{ + // var Li = model.IDSPack.LiquidType.Type; + // var Mid = model.IDSPack.MidTankType.Type; + // model.Level = 0.0; + //model.JerricanPresent = false; + //model.FillingTimeoutError = false; + //model.MidTankEmpty = true; + //model.MidTankRefillPumpActive = false; + //model.RemainingTimeoutError = TimeSpan.FromSeconds(300); + + //if (item.Index == 1) + //{ + // model.Level = 1.0; + //} + //if (item.Index == 2) + //{ + // model.Level = 2.0; + //} + //if (item.Index == 3) + //{ + // model.Level = 3.0; + //} + //if (item.Index == 4)//TI + //{ + // model.Level = 7.0; + //} + //if (item.Index == 5)//LC + //{ + // model.Level = 7.0; + //} + //if (item.Index == 6)//LM + //{ + // model.Level = 3.5; + //} + //if (item.Index == 7)//LY + //{ + // model.Level = 2.5; + //} + // if (item.Index == 8)//Lub + // { + // model.Level = 1.5; + // } + // if (item.Index ==9) + // { + // model.Level = 4.99; + // } + + //} + ////////////////////////////// } } } @@ -454,6 +531,20 @@ namespace Tango.PPC.UI.ViewModels RaisePropertyChanged(nameof(BlackOutput)); } + private void HideJobOutline() + { + IsDisplayJobOutline = false; + } + + private void DisplayJobOutline() + { + if(_handler != null && _handler.JobTicket != null) + { + JobOutlineTicket = _handler.JobTicket; + IsDisplayJobOutline = true; + } + } + #endregion } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml index acaf14f15..a72dc2d1d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml @@ -59,7 +59,7 @@ Foreground="{StaticResource TangoLightForegroundBrush}" Background="{StaticResource TangoMidAccentBrush}" CornerRadius="18" Margin="0 8 0 8"> - + - Back + Back diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index 44be63ffe..d9b37ac85 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -214,7 +214,7 @@ - + - - - - - - Job Length + + + + + + + Job Length @@ -607,12 +614,12 @@ + - - - - - Job Weight + + + + Job Weight @@ -622,189 +629,189 @@ + - - - - - Copies + + + + Copies + - - - - - Time Left - - - + + + + Time Left + + + - - + + + - - + - - + + - - - - - - - - - - Input - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Output - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C - - - - - LC - - - - - M - - - - - LM - - - - - Y - - - - - LY - + + + + + + + + + + Input - - - K - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Output - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C + + + + + LC + + + + + M + + + + + LM + + + + + Y + + + + + LY + + + + + K + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -814,21 +821,21 @@ - - - + + + + + - - - - + + - - + + @@ -847,328 +854,342 @@ - - - - - - - - Sensors - - - - - - - - - - - - - - - ºC - - Dryer Zone 3 - - - - - - - - - - - - - - - - - - Dryer Air - - - - - - - - - - - - - - - - - Tunnel + + + + + + + Sensors - - - - - - - - - - - - - + + + + + + + + + + + + + + ºC - - Pumps pressure - - - - - - - - - - - - - - + + Dryer Zone 3 + - - Lubricant - - - - - - - - - - - - - - - - Winder + + + + + + + + + + + + + + + Dryer Air - - - - - - - - - - - Dancer - - + + + + + + + + + + + + - - - - - - - - - - - - BTSR + + Tunnel - - - - - - - - - - - Feeder + + + + + + + + + + + + + + + Pumps pressure - - - - - - - - - - - Waste + + + + + + + + + + + + + + + + Lubricant - - - + + + + + + + + + + + + + + + + Winder + + + + + + + + + + + + + Dancer + + + + + + + + + + + + + + + BTSR + + + + + + + + + + + + + Feeder + + + + + + + + + + + Waste + + + + + - - - - - Ink Levels - - - - - - - - + + + + Ink Levels + + + + + + + + + - + + - - - - - + + + + + - - - - - - - - - - - Notifications - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + Notifications + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + Hide Job Outline + -- cgit v1.3.1 From bc94c84ee20ea01618241e8a4d32c2a77b4084cc Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Tue, 23 May 2023 16:49:49 +0300 Subject: Added data processing of BtsrsInError, DancersInError, WindersInError in GUI. --- .../Tango.PPC.UI/Images/Overview Icons/Error.png | Bin 831 -> 2146 bytes .../Tango.PPC.UI/Images/Overview Icons/Normal.png | Bin 779 -> 1407 bytes .../Models/MachineOverviewErrorItem.cs | 26 ++++++ .../Models/MachineOverviewErrorStates.cs | 56 ++++++++++++ .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 4 +- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 16 +++- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 100 ++++++++++----------- .../Tango.Emulations/Emulators/MachineEmulator.cs | 16 +++- 8 files changed, 165 insertions(+), 53 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewErrorItem.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewErrorStates.cs (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/Error.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/Error.png index b9138f444..a5a178bdb 100644 Binary files a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/Error.png and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/Error.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/Normal.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/Normal.png index a562e9228..8ddeecbe0 100644 Binary files a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/Normal.png and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/Normal.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewErrorItem.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewErrorItem.cs new file mode 100644 index 000000000..3925a1752 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewErrorItem.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; + +namespace Tango.PPC.UI.Models +{ + public class MachineOverviewErrorItem : ExtendedObject + { + private bool _isErrorState; + + public bool IsErrorState + { + get { return _isErrorState; } + set { _isErrorState = value; RaisePropertyChangedAuto();} + } + + public MachineOverviewErrorItem() + { + IsErrorState = false; + } + + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewErrorStates.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewErrorStates.cs new file mode 100644 index 000000000..d293c4418 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewErrorStates.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; + +namespace Tango.PPC.UI.Models +{ + public class MachineOverviewErrorStates : ExtendedObject + { + public ObservableCollection Winders { get; set; } + + public ObservableCollection Dancers { get; set; } + + public ObservableCollection BTSRs { get; set; } + + public MachineOverviewErrorStates() + { + Winders = new ObservableCollection(); + Dancers = new ObservableCollection(); + BTSRs = new ObservableCollection(); + for ( int i = 0; i < 4 ; i++) + { + Winders.Add( new MachineOverviewErrorItem()); + Dancers.Add(new MachineOverviewErrorItem()); + BTSRs.Add(new MachineOverviewErrorItem()); + } + } + + public void UpdateWinders(List updates) + { + UpdateCollection(Winders, updates); + } + public void UpdateDancers(List updates) + { + UpdateCollection(Dancers, updates); + } + public void UpdateBTSRs(List updates) + { + UpdateCollection(BTSRs, updates); + } + + private void UpdateCollection(ObservableCollection collection, List updates ) + { + if (collection.Count == updates.Count) + { + for (int i = 0; i < collection.Count; i++) + { + collection[i].IsErrorState = updates[i]; + } + } + } + } +} 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 51600b0e8..a3ec9667f 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 @@ -238,9 +238,11 @@ + + @@ -962,7 +964,7 @@ if $(ConfigurationName) == Eureka copy /Y "$(ProjectDir)Intro.wmv" "$(TargetDir) - + 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 828047ccf..1182ba50e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -206,7 +206,9 @@ namespace Tango.PPC.UI.ViewModels get { return _jobOutlineTicket; } set { _jobOutlineTicket = value; RaisePropertyChangedAuto(); } } - + + public MachineOverviewErrorStates MachineErrorStates { get; set; } + #endregion #region Commands @@ -254,6 +256,7 @@ namespace Tango.PPC.UI.ViewModels IsWeghtView = false; OverviewModel = new MachineOverviewModel(); + MachineErrorStates = new MachineOverviewErrorStates(); } public override void OnApplicationReady() @@ -275,6 +278,7 @@ namespace Tango.PPC.UI.ViewModels private void MachineOperator_MachineStatusChanged(object sender, MachineStatus status) { UpdateMidTankLevels(status); + UpdateMachineStatusErrors(status); } private void UpdateMidTankLevels(MachineStatus status) { @@ -348,6 +352,16 @@ namespace Tango.PPC.UI.ViewModels } } + private void UpdateMachineStatusErrors(MachineStatus status) + { + var windersInError = status.WindersInError.ToList();// to test + MachineErrorStates.UpdateWinders(windersInError); + var dansersInError = status.DancersInError.ToList(); + MachineErrorStates.UpdateDancers(dansersInError); + var btsrsInErrors = status.BtsrsInError.ToList(); + MachineErrorStates.UpdateBTSRs(btsrsInErrors); + } + private void MachineOperator_InkFillingStatusChanged(object sender, InkFillingStatusChangedEventArgs e) { //foreach (var cartridge in e.Status.CartridgesStatuses.Where(x => x.Cartridge.Slot != CartridgeSlot.Ink)) diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index 666fffe72..b6bda0892 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -168,19 +168,25 @@ - + + + + + + @@ -963,43 +990,25 @@ - - - - - - - - + + + + + + + Winder - - - - - - - - - + + + + + + + + Dancer @@ -1007,22 +1016,13 @@ - - - - - - - - + + + + + + + BTSR diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index 3543b8b3a..0e00bee3e 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -170,8 +170,22 @@ namespace Tango.Emulations.Emulators MidTankLevel = 2.5, }); } + for (int i = 0; i < 4; i++) + { + if( i == 2) + { + MachineStatus.WindersInError.Add(false); + MachineStatus.DancersInError.Add(true); + MachineStatus.BtsrsInError.Add(true); + } + else { + MachineStatus.WindersInError.Add(false); + MachineStatus.DancersInError.Add(false); + MachineStatus.BtsrsInError.Add(false); + } + } - EventsStates = MachineEventState.GetAllEventsStates(); + EventsStates = MachineEventState.GetAllEventsStates(); _valveStates = new List(); _blower_states = new List(); -- cgit v1.3.1 From c3b117cb5612295c80e1ed3da1cc10a582d5cb9f Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Mon, 29 May 2023 15:57:53 +0300 Subject: PPC. Bug error GoTOJob when job is null. Related Work Items: #8486 --- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 8 ++++++- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 26 ++++++++++++++++++++-- 2 files changed, 31 insertions(+), 3 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') 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 1182ba50e..68c0f1867 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -45,6 +45,7 @@ namespace Tango.PPC.UI.ViewModels if (_job == null) IsDyeingProcess = false; RaisePropertyChangedAuto(); + InvalidateRelayCommands(); } } @@ -243,7 +244,7 @@ namespace Tango.PPC.UI.ViewModels StopCommand = new RelayCommand(StopJob, () => CanStopped()); AbortCommand = new RelayCommand(AbortJob, () => CanStopped()); - GoToJobCommand = new RelayCommand(GoToJob); + GoToJobCommand = new RelayCommand(GoToJob, () => IsEnableGoToJob()); JobStatusViewCommand = new RelayCommand(JobStatusView); OverviewViewCommand = new RelayCommand(OverviewView); ClearAllNotificationsCommand = new RelayCommand(ClearAllNotifications); @@ -467,6 +468,11 @@ namespace Tango.PPC.UI.ViewModels #region Methods + private bool IsEnableGoToJob() + { + return Job != null && _handler != null; + } + private void GoToJob() { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index 8baaf0067..731693a06 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -335,8 +335,30 @@ - Go To Job - + + + + + + + + + + -- cgit v1.3.1 From 3e46bf434c6f8ba56fe812205fd1ea20a1f9d347 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Mon, 5 Jun 2023 15:11:17 +0300 Subject: Present Lubricant Ink with divider, sort the Ink level indicators. Related Work Items: #8528 --- .../Tango.PPC.JobsV2/Views/JobEurekaView.xaml | 2 +- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 29 +++++- .../PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml | 10 +- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 114 ++++++++++++++++++--- 4 files changed, 129 insertions(+), 26 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml index 613200c02..c31c8036d 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml @@ -258,7 +258,7 @@ x.MidTankType.HasLevelMeasure || x.MidTankType.Type == MidTankTypes.LubricantMidTank).OrderBy(x => x.PackIndex).Select(x => new JerricanLevelModel() + MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.HasLevelMeasure ).OrderBy(x => x.PackIndex).Select(x => new JerricanLevelModel() { Max = x.MidTankType.LiterCapacity, IDSPack = x, - }).OrderBy(y => y.IDSPack.LiquidType.PreferredIndex).ToList(); + }).OrderBy(y => y.IDSPack.LiquidType.Type).ToList(); + var LubLevel = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.Type == MidTankTypes.LubricantMidTank).FirstOrDefault(); + + MidTankLubLevel = new JerricanLevelModel(); + if(LubLevel != null) + { + MidTankLubLevel.Max = LubLevel.MidTankType.LiterCapacity; + MidTankLubLevel.IDSPack = LubLevel; + }; MachineProvider.MachineOperator.MachineStatusChanged += MachineOperator_MachineStatusChanged; @@ -287,7 +302,15 @@ namespace Tango.PPC.UI.ViewModels { foreach (var item in status.IDSPacksLevels) { - var model = MidTankLevels.SingleOrDefault(x => x.IDSPack.PackIndex == item.Index); + JerricanLevelModel model = null; + if (item.Index == 8)//lub + { + model = MidTankLubLevel; + + } + else { + model = MidTankLevels.SingleOrDefault(x => x.IDSPack.PackIndex == item.Index); + } if (model != null) { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml index 84d1108f2..049f2268d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml @@ -61,7 +61,7 @@ Foreground="{StaticResource TangoLightForegroundBrush}" Background="{StaticResource TangoMidAccentBrush}" CornerRadius="18" Margin="0 8 0 8"> - + - Back + Back @@ -85,7 +85,7 @@ - + + + + + + + + + + + + + + + + + + 30 + 88 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -236,11 +315,11 @@ - - - - - + + + + + @@ -904,7 +983,7 @@ - + @@ -1089,7 +1168,7 @@ Waste - + @@ -1107,9 +1186,10 @@ - - + + + + @@ -1120,8 +1200,8 @@ - - + + -- cgit v1.3.1 From 54624e4a90a240ad702995e1ed551901768e131f Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Tue, 6 Jun 2023 14:56:59 +0300 Subject: Open Notifications bar when an error happens Related Work Items: #8534 --- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 27 +++++++++++++++++++++- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 12 ++++++---- .../Tango.Touch/Controls/TouchExpander.cs | 7 +++++- 3 files changed, 39 insertions(+), 7 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') 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 52199fcca..2563cb331 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -217,6 +217,17 @@ namespace Tango.PPC.UI.ViewModels public MachineOverviewErrorStates MachineErrorStates { get; set; } + private bool _isExpandedNotificatios; + + public bool IsExpandedNotifications + { + get { return _isExpandedNotificatios; } + set { + _isExpandedNotificatios = value; + RaisePropertyChangedAuto();} + } + + #endregion #region Commands @@ -265,11 +276,14 @@ namespace Tango.PPC.UI.ViewModels OverviewModel = new MachineOverviewModel(); MachineErrorStates = new MachineOverviewErrorStates(); + + IsExpandedNotifications = false; } public override void OnApplicationReady() { base.OnApplicationReady(); + EventLogger.EventReceived += EventLogger_EventReceived; MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.HasLevelMeasure ).OrderBy(x => x.PackIndex).Select(x => new JerricanLevelModel() { @@ -291,7 +305,18 @@ namespace Tango.PPC.UI.ViewModels #region Events - private void MachineOperator_MachineStatusChanged(object sender, MachineStatus status) + private void EventLogger_EventReceived(object sender, MachinesEvent ev) + { + InvokeUI(() => + { + if (ev.Category == EventTypeCategories.Error || ev.Category == EventTypeCategories.Critical) + { + IsExpandedNotifications = true; + } + }); + } + + private void MachineOperator_MachineStatusChanged(object sender, MachineStatus status) { UpdateMidTankLevels(status); UpdateMachineStatusErrors(status); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index 1cdc39973..536682bf9 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -1201,7 +1201,7 @@ - + @@ -1244,13 +1244,13 @@ - + - + @@ -1281,10 +1281,12 @@ - + + - + + diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchExpander.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchExpander.cs index b85be6c49..80974bd4a 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchExpander.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchExpander.cs @@ -39,7 +39,12 @@ namespace Tango.Touch.Controls set { SetValue(IsExpandedProperty, value); } } public static readonly DependencyProperty IsExpandedProperty = - DependencyProperty.Register("IsExpanded", typeof(bool), typeof(TouchExpander), new PropertyMetadata(false)); + DependencyProperty.Register("IsExpanded", typeof(bool), typeof(TouchExpander), new FrameworkPropertyMetadata + { + DefaultValue = false, + BindsTwoWayByDefault = true, + DefaultUpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged + }); static TouchExpander() { -- cgit v1.3.1 From a5de87ea9863c6e7053e09ed1c2eabf58285af48 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Tue, 20 Jun 2023 16:40:58 +0300 Subject: PPC. Added Real Time Graph --- Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml | 1 + .../StatisticTabToVisibilityConverter.cs | 28 ++++ .../PPC/Tango.PPC.UI/Graphs/GraphHelper.cs | 36 +++++ .../PPC/Tango.PPC.UI/Graphs/RealTimeGraph.cs | 149 +++++++++++++++++++++ .../PPC/Tango.PPC.UI/Graphs/RealTimeGraph.xaml | 106 +++++++++++++++ .../Tango.PPC.UI/Images/Overview Icons/motor.png | Bin 0 -> 1023 bytes .../Tango.PPC.UI/Images/Overview Icons/pr_data.png | Bin 0 -> 1054 bytes .../Images/Overview Icons/pressure.png | Bin 0 -> 1156 bytes .../Images/Overview Icons/temperature.png | Bin 0 -> 1065 bytes .../PPC/Tango.PPC.UI/Images/screw.png | Bin 0 -> 937 bytes .../PPC/Tango.PPC.UI/Resources/Graphs.xaml | 8 ++ .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 26 +++- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 112 ++++++++++++++++ .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 64 +++++++++ .../Tango.PPC.UI/Views/MachineStatusView.xaml.cs | 10 ++ .../Visual_Studio/PPC/Tango.PPC.UI/app.manifest | 2 +- .../Tango.Touch/Controls/TouchNavigationLinks.cs | 22 ++- .../Tango.Touch/Controls/TouchNavigationLinks.xaml | 5 +- .../Tango.Touch/Resources/Colors.xaml | 28 ++++ 19 files changed, 589 insertions(+), 8 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/StatisticTabToVisibilityConverter.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/GraphHelper.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/RealTimeGraph.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/RealTimeGraph.xaml create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/motor.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/pr_data.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/pressure.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/temperature.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/screw.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Graphs.xaml (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml index bdcf675e3..38a5b91b2 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml @@ -20,6 +20,7 @@ + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/StatisticTabToVisibilityConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/StatisticTabToVisibilityConverter.cs new file mode 100644 index 000000000..06c75a999 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/StatisticTabToVisibilityConverter.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Data; +using static Tango.PPC.UI.ViewModels.MachineStatusViewVM; + +namespace Tango.PPC.UI.Converters +{ + public class StatisticTabToVisibilityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + StatisticTab selected = (StatisticTab)Enum.Parse(typeof(StatisticTab), parameter.ToString()); + StatisticTab statTab = (StatisticTab)value; + + return statTab.Equals(selected) ? Visibility.Visible : Visibility.Hidden; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/GraphHelper.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/GraphHelper.cs new file mode 100644 index 000000000..d06ed042a --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/GraphHelper.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Media; + +namespace Tango.PPC.UI.Graphs +{ + public static class GraphHelper + { + public enum GraphColor + { + White, + Red, + Yellow, + Green, + Orange + } + + public static Color GetGraphColor(GraphColor graphColor) + { + return (Color)Application.Current.Resources[$"Tango_RealTimeGraph_{graphColor.ToString()}"]; + } + + public static Brush GetGraphBrush(GraphColor graphColor) + { + return new SolidColorBrush(GetGraphColor(graphColor)); + } + + public static Color GetGraphStrokeColor() + { + return (Color)Application.Current.Resources["Tango_RealTimeGraph_ForegroundColor"]; + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/RealTimeGraph.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/RealTimeGraph.cs new file mode 100644 index 000000000..303b18892 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/RealTimeGraph.cs @@ -0,0 +1,149 @@ +using RealTimeGraphX; +using System; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Media; + +namespace Tango.PPC.UI.Graphs +{ + public class RealTimeGraph : Control + { + /// + /// Gets or sets the graph controller. + /// + public IGraphController Controller + { + get { return (IGraphController)GetValue(ControllerProperty); } + set { SetValue(ControllerProperty, value); } + } + public static readonly DependencyProperty ControllerProperty = + DependencyProperty.Register("Controller", typeof(IGraphController), typeof(RealTimeGraph), new PropertyMetadata(null)); + + + /// + /// Gets or sets the string format of the y-axis. + /// + public String StringFormat + { + get { return (String)GetValue(StringFormatProperty); } + set { SetValue(StringFormatProperty, value); } + } + public static readonly DependencyProperty StringFormatProperty = + DependencyProperty.Register("StringFormat", typeof(String), typeof(RealTimeGraph), new PropertyMetadata("0.0")); + + + /// + /// Gets or sets the display name. + /// + public String DisplayName + { + get { return (String)GetValue(DisplayNameProperty); } + set { SetValue(DisplayNameProperty, value); } + } + public static readonly DependencyProperty DisplayNameProperty = + DependencyProperty.Register("DisplayName", typeof(String), typeof(RealTimeGraph), new PropertyMetadata(null)); + + + /// + /// Gets or sets the display units. + /// + public String DisplayUnits + { + get { return (String)GetValue(DisplayUnitsProperty); } + set { SetValue(DisplayUnitsProperty, value); } + } + public static readonly DependencyProperty DisplayUnitsProperty = + DependencyProperty.Register("DisplayUnits", typeof(String), typeof(RealTimeGraph), new PropertyMetadata(null)); + + /// + /// Gets or sets the graph label visibility. + /// + public Visibility GraphLabelVisibility + { + get { return (Visibility)GetValue(GraphLabelVisibilityProperty); } + set { SetValue(GraphLabelVisibilityProperty, value); } + } + public static readonly DependencyProperty GraphLabelVisibilityProperty = + DependencyProperty.Register("GraphLabelVisibility", typeof(Visibility), typeof(RealTimeGraph), new PropertyMetadata(Visibility.Visible)); + + + /// + /// Gets or sets the vertical ticks. + /// + public int VerticalTicks + { + get { return (int)GetValue(VerticalTicksProperty); } + set { SetValue(VerticalTicksProperty, value); } + } + public static readonly DependencyProperty VerticalTicksProperty = + DependencyProperty.Register("VerticalTicks", typeof(int), typeof(RealTimeGraph), new PropertyMetadata(10)); + + + /// + /// Gets or sets the horizontal ticks. + /// + public int HorizontalTicks + { + get { return (int)GetValue(HorizontalTicksProperty); } + set { SetValue(HorizontalTicksProperty, value); } + } + public static readonly DependencyProperty HorizontalTicksProperty = + DependencyProperty.Register("HorizontalTicks", typeof(int), typeof(RealTimeGraph), new PropertyMetadata(10)); + + public Brush GridLinesBrush + { + get { return (Brush)GetValue(GridLinesBrushProperty); } + set { SetValue(GridLinesBrushProperty, value); } + } + public static readonly DependencyProperty GridLinesBrushProperty = + DependencyProperty.Register("GridLinesBrush", typeof(Brush), typeof(RealTimeGraph), new PropertyMetadata(null)); + + public Visibility HorizontalAxisVisibility + { + get { return (Visibility)GetValue(HorizontalAxisVisibilityProperty); } + set { SetValue(HorizontalAxisVisibilityProperty, value); } + } + public static readonly DependencyProperty HorizontalAxisVisibilityProperty = + DependencyProperty.Register("HorizontalAxisVisibility", typeof(Visibility), typeof(RealTimeGraph), new PropertyMetadata(Visibility.Visible)); + + public Visibility VerticalAxisVisibility + { + get { return (Visibility)GetValue(VerticalAxisVisibilityProperty); } + set { SetValue(VerticalAxisVisibilityProperty, value); } + } + public static readonly DependencyProperty VerticalAxisVisibilityProperty = + DependencyProperty.Register("VerticalAxisVisibility", typeof(Visibility), typeof(RealTimeGraph), new PropertyMetadata(Visibility.Visible)); + + public Visibility CurrentValueVisibility + { + get { return (Visibility)GetValue(CurrentValueVisibilityProperty); } + set { SetValue(CurrentValueVisibilityProperty, value); } + } + public static readonly DependencyProperty CurrentValueVisibilityProperty = + DependencyProperty.Register("CurrentValueVisibility", typeof(Visibility), typeof(RealTimeGraph), new PropertyMetadata(Visibility.Collapsed)); + + public double CurrentValueFontSize + { + get { return (double)GetValue(CurrentValueFontSizeProperty); } + set { SetValue(CurrentValueFontSizeProperty, value); } + } + public static readonly DependencyProperty CurrentValueFontSizeProperty = + DependencyProperty.Register("CurrentValueFontSize", typeof(double), typeof(RealTimeGraph), new PropertyMetadata(25.0)); + + public Thickness CurrentValueMargin + { + get { return (Thickness)GetValue(CurrentValueMarginProperty); } + set { SetValue(CurrentValueMarginProperty, value); } + } + public static readonly DependencyProperty CurrentValueMarginProperty = + DependencyProperty.Register("CurrentValueMargin", typeof(Thickness), typeof(RealTimeGraph), new PropertyMetadata(new Thickness(20))); + + /// + /// Initializes the class. + /// + static RealTimeGraph() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(RealTimeGraph), new FrameworkPropertyMetadata(typeof(RealTimeGraph))); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/RealTimeGraph.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/RealTimeGraph.xaml new file mode 100644 index 000000000..8844f9627 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Graphs/RealTimeGraph.xaml @@ -0,0 +1,106 @@ + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/motor.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/motor.png new file mode 100644 index 000000000..8401a8e30 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/motor.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/pr_data.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/pr_data.png new file mode 100644 index 000000000..ebd02a99b Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/pr_data.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/pressure.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/pressure.png new file mode 100644 index 000000000..12ade5d92 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/pressure.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/temperature.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/temperature.png new file mode 100644 index 000000000..de9b042c4 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Overview Icons/temperature.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/screw.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/screw.png new file mode 100644 index 000000000..46a8134fe Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/screw.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Graphs.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Graphs.xaml new file mode 100644 index 000000000..67047cf1f --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Graphs.xaml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file 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 a3ec9667f..e2d447be5 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 @@ -176,6 +176,7 @@ + BitResultsView.xaml @@ -236,6 +237,8 @@ + + @@ -409,6 +412,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -433,6 +440,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -627,6 +638,11 @@ + + + + + @@ -648,6 +664,14 @@ + + {6b9774f7-960d-438e-ad81-c6b9be328d50} + RealTimeGraphX.WPF + + + {f13a489c-80ee-4cd0-bdd4-92d959215646} + RealTimeGraphX + {d129789c-3096-4d0b-8dd7-fe24a4df4b21} Tango.AnimatedGif @@ -964,7 +988,7 @@ if $(ConfigurationName) == Eureka copy /Y "$(ProjectDir)Intro.wmv" "$(TargetDir) - + 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 2563cb331..103084e11 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -20,11 +20,27 @@ using System.Timers; using System.Windows.Threading; using System.Diagnostics; using Tango.PMR.Printing; +using System.ComponentModel; +using RealTimeGraphX.WPF; +using RealTimeGraphX.DataPoints; +using Tango.PPC.UI.Graphs; namespace Tango.PPC.UI.ViewModels { public class MachineStatusViewVM : PPCViewModel { + public enum StatisticTab + { + [Description("Production Data")] + Productiondata = 0, + [Description("Temperature")] + Temperature = 1, + [Description("Pressure")] + Pressure = 2, + [Description("Motor")] + Motor = 3 + } + #region Properties [TangoInject] @@ -227,6 +243,70 @@ namespace Tango.PPC.UI.ViewModels RaisePropertyChangedAuto();} } + private int _selectedStatisticTabIndex; + /// + /// Gets or sets the index of the selected category. + /// + public int SelectedStatisticTabIndex + { + get { return _selectedStatisticTabIndex; } + set + { + if (_selectedStatisticTabIndex != value) + { + _selectedStatisticTabIndex = value; + RaisePropertyChangedAuto(); + switch (_selectedStatisticTabIndex) + { + case 0: + { + SelectedStatisticTab = StatisticTab.Productiondata; + break; + } + case 1: + { + SelectedStatisticTab = StatisticTab.Temperature; + break; + } + case 2: + { + SelectedStatisticTab = StatisticTab.Pressure; + break; + } + case 3: + { + SelectedStatisticTab = StatisticTab.Motor; + break; + } + } + } + } + } + + private StatisticTab _selectedStatisticTab; + /// + /// Gets or sets the selected category. + /// + /// + public StatisticTab SelectedStatisticTab + { + get + { + return _selectedStatisticTab; + } + set + { + if (_selectedStatisticTab != value) + { + _selectedStatisticTab = value; + RaisePropertyChangedAuto(); + } + _selectedStatisticTabIndex = _selectedStatisticTab.ToInt32(); + RaisePropertyChanged(nameof(SelectedStatisticTabIndex)); + } + } + + public WpfGraphController JobController { get; set; } #endregion @@ -278,6 +358,9 @@ namespace Tango.PPC.UI.ViewModels MachineErrorStates = new MachineOverviewErrorStates(); IsExpandedNotifications = false; + SelectedStatisticTabIndex = 0; + + JobController = CreateController(CreateSeries("Total", GraphHelper.GraphColor.Green)); } public override void OnApplicationReady() @@ -613,6 +696,35 @@ namespace Tango.PPC.UI.ViewModels } } + private WpfGraphController CreateController(params WpfGraphDataSeries[] seriesCollection) + { + var controller = new WpfGraphController(); + + foreach (var series in seriesCollection) + { + controller.DataSeriesCollection.Add(series); + } + + controller.Range.AutoY = true; + controller.Range.MaximumY = 100; + controller.Range.MinimumY = 0; + controller.Range.MaximumX = new DateTime(0).AddMinutes(30); + + controller.RefreshRate = TimeSpan.FromMilliseconds(300000);//5 min + + return controller; + } + + private WpfGraphDataSeries CreateSeries(String name, GraphHelper.GraphColor fill) + { + WpfGraphDataSeries series = new WpfGraphDataSeries(); + series.Name = name; + series.Fill = GraphHelper.GetGraphBrush(fill); + series.StrokeThickness = 1; + series.Stroke = GraphHelper.GetGraphStrokeColor(); + return series; + } + #endregion } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index 1445337ad..9e766fffc 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -12,6 +12,7 @@ xmlns:localConverters="clr-namespace:Tango.PPC.UI.Converters" xmlns:global="clr-namespace:Tango.PPC.UI" xmlns:models="clr-namespace:Tango.PPC.UI.Models" + xmlns:graphs="clr-namespace:Tango.PPC.UI.Graphs" xmlns:local="clr-namespace:Tango.PPC.UI.Views" mc:Ignorable="d" d:DesignHeight="1280" d:DesignWidth="932" d:DataContext="{d:DesignInstance Type=vm:MachineStatusViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MachineStatusViewVM}"> @@ -25,6 +26,7 @@ + + @@ -1203,6 +1209,64 @@ + + + + + + + + + + + + Production Data + + + + Temperature + + + + Pressure + + + + Motor + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml.cs index 2ee98bc2b..e49e062b7 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml.cs @@ -57,5 +57,15 @@ namespace Tango.PPC.UI.Views { _timer.Stop(); } + + private void NavigationSTLinks_PreviewTouchDown(object sender, TouchEventArgs e) + { + e.Handled = true; + } + + private void NavigationSTLinks_PreviewMouseDown(object sender, MouseButtonEventArgs e) + { + e.Handled = true; + } } } 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. --> - + diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.cs index 3a0d3de9e..5fb4496e0 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.cs @@ -24,7 +24,18 @@ namespace Tango.Touch.Controls private const string PART_Rectangle = "PART_Rectangle"; private Line _line; private Object _lastSelectedItem; + + public int LineThickness + { + get { return (int)GetValue(LineThicknessProperty); } + set { SetValue(LineThicknessProperty, value); } + } + + // Using a DependencyProperty as the backing store for LineThickness. This enables animation, styling, binding, etc... + public static readonly DependencyProperty LineThicknessProperty = + DependencyProperty.Register("LineThickness", typeof(int), typeof(TouchNavigationLinks), new PropertyMetadata(3)); + static TouchNavigationLinks() { DefaultStyleKeyProperty.OverrideMetadata(typeof(TouchNavigationLinks), new FrameworkPropertyMetadata(typeof(TouchNavigationLinks))); @@ -48,12 +59,14 @@ namespace Tango.Touch.Controls private void MoveLineToSelectedItem() { - if (SelectedItem != null) + if (SelectedItem != null ) { + if(SelectedItem is UIElement && ((UIElement)SelectedItem).IsEnabled == false) + return; var container = ItemContainerGenerator.ContainerFromItem(SelectedItem) as FrameworkElement; - + ContentPresenter presenter = container.FindChild().FindChild(); - + if (presenter != null) { Point relativePoint = presenter.TransformToAncestor(this).Transform(new Point(0, 0)); @@ -87,8 +100,9 @@ namespace Tango.Touch.Controls _line.BeginAnimation(Line.X2Property, aniX2); } } + _lastSelectedItem = SelectedItem; } - + _lastSelectedItem = SelectedItem; } } diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.xaml index 599dfdf7c..2b8b4ff03 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.xaml +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.xaml @@ -37,10 +37,11 @@ + - + @@ -77,7 +78,7 @@ - + diff --git a/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml b/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml index 283e69b45..1dc2090aa 100644 --- a/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml +++ b/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml @@ -60,6 +60,17 @@ #55FFFFFF #000131 + #18FFFFFF + #B6FF6F6F + #BBFFB84B + #B958C13B + #BBFA9252 + + #7C98B3 + #202020 + #505050 + #303030 + @@ -128,4 +139,21 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.3.1 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. --- .../Controls/RunningJobViewerEureka.xaml | 15 ++- .../Controls/RunningJobViewerEureka.xaml.cs | 108 ++++++++++++++++++++- .../Converters/DoubleWidthConverter.cs | 24 +++++ .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 1 + .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 10 +- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 6 +- .../Tango.Integration/Operation/JobHandler.cs | 8 +- 7 files changed, 154 insertions(+), 18 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/DoubleWidthConverter.cs (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml index 39c032145..4c39bded0 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml @@ -4,12 +4,14 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:converters="clr-namespace:Tango.PPC.UI.Converters" xmlns:local="clr-namespace:Tango.PPC.UI.Controls" xmlns:enumerations="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL" mc:Ignorable="d" + Name="RunningJobViewerEurekaContr" d:DesignHeight="60" d:DesignWidth="500" Height="38" d:DataContext="{d:DesignInstance Type=local:RunningJobViewerEureka, IsDesignTimeCreatable=False}"> - + + MouseDown="SliderContentControl_MouseDown" TouchDown="SliderContentControl_TouchDown" SizeChanged="Slider_control_SizeChanged" > @@ -34,7 +36,9 @@ - + + + @@ -45,7 +49,7 @@ - + @@ -55,7 +59,8 @@ - + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs index 29efaad72..95fe5cd10 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs @@ -1,5 +1,8 @@ using System; +using System.Collections; using System.Collections.Generic; +using System.Collections.Specialized; +using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -22,6 +25,24 @@ namespace Tango.PPC.UI.Controls /// public partial class RunningJobViewerEureka : UserControl { + List _segments; + + + + private double _prevOffset; + private double _addOffset; + private int _prevUnit; + + private double _controlWidth; + + public double ControlWidth + { + get { return _controlWidth; } + set { + _controlWidth = value;//for debug + } + } + /// /// Maybe not necessary! /// @@ -43,7 +64,7 @@ namespace Tango.PPC.UI.Controls } public static readonly DependencyProperty DisplayMarkersProperty = DependencyProperty.Register("DisplayMarkers", typeof(bool), typeof(RunningJobViewerEureka), new PropertyMetadata(true)); - + /// /// Gets or sets the job. /// @@ -53,7 +74,40 @@ namespace Tango.PPC.UI.Controls set { SetValue(JobProperty, value); } } public static readonly DependencyProperty JobProperty = - DependencyProperty.Register("Job", typeof(Job), typeof(RunningJobViewerEureka), new PropertyMetadata(null)); + DependencyProperty.Register("Job", typeof(Job), typeof(RunningJobViewerEureka), new PropertyMetadata(null, (d, e) => (d as RunningJobViewerEureka).OnUpdateJob())); + + private void OnUpdateJob() + { + if(Job != null) + { + _segments = Job.EffectiveSegments.ToList(); + + if (Job.NumberOfUnits > 1 && _segments.Count > 0 + && (_segments.Count > 1 || _segments[0].BrushStops.Count > 1)) + { + //if (Job.EnableInterSegment && Job.InterSegmentLength > 0) + //{ + // _segments.Add(Job.CreateInterSegment(Job.InterSegmentLength)); + //} + _segments.AddRange(Job.EffectiveSegments.ToList()); + //if (Job.EnableInterSegment && Job.InterSegmentLength > 0) + //{ + // _segments.Add(Job.CreateInterSegment(Job.InterSegmentLength)); + //}//without check if last segment and last unit + IsHasMultipleColorsSegments = true; + } + else + IsHasMultipleColorsSegments = false; + + SegmentsItemsControl.ItemsSource = _segments; + SegmentsItemsControl.InvalidateVisual(); + + _prevOffset = _addOffset = 0.0; + _prevUnit = 0; + ItemsBorder.SetValue(Canvas.LeftProperty, 0.0); + ItemsBorder.InvalidateVisual(); + } + } /// /// Gets or sets the running job status. @@ -121,7 +175,19 @@ namespace Tango.PPC.UI.Controls // Using a DependencyProperty as the backing store for ThumbHeight. This enables animation, styling, binding, etc... public static readonly DependencyProperty ThumbHeightProperty = DependencyProperty.Register("ThumbHeight", typeof(double), typeof(RunningJobViewerEureka), new FrameworkPropertyMetadata(0.0)); + + public bool IsHasMultipleColorsSegments + { + get { return (bool)GetValue(IsHasMultipleColorsSegmentsProperty); } + set { SetValue(IsHasMultipleColorsSegmentsProperty, value); } + } + + // Using a DependencyProperty as the backing store for IsHasMultipleColorsSegments. This enables animation, styling, binding, etc... + public static readonly DependencyProperty IsHasMultipleColorsSegmentsProperty = + DependencyProperty.Register("IsHasMultipleColorsSegments", typeof(bool), typeof(RunningJobViewerEureka), new PropertyMetadata(false)); + + /// /// Initializes a new instance of the class. /// @@ -139,11 +205,49 @@ namespace Tango.PPC.UI.Controls { e.Handled = true; } + private void OnSliderValueChanged() { if(slider_control != null) + { slider_control.Value = SliderValue; + if(RunningJobStatus != null && RunningJobStatus.IsSettingUp == false && IsHasMultipleColorsSegments && ColorCanvas != null && ControlWidth > 0) + { + double progress = RunningJobStatus.CurrentUnitProgress; + double total = RunningJobStatus.CurrentUnitTotalProgress; + + int currentUnit = RunningJobStatus.CurrentUnit; + int totalUnits = Job.NumberOfUnits; + + double simpleoffset = ((progress / total) * ControlWidth) ; + + double multiplier = (((double)(totalUnits - 1)) / (double)totalUnits); + double offset = simpleoffset * multiplier; + + if(_prevUnit < currentUnit) + { + _addOffset = _prevOffset; + } + + offset += _addOffset; + + if (offset >= ControlWidth) + { + offset -= ControlWidth;//round + } + _prevOffset = offset; + _prevUnit = currentUnit; + + ItemsBorder.SetValue(Canvas.LeftProperty, (-1) * offset); + ItemsBorder.InvalidateVisual(); + } + } + } + + private void Slider_control_SizeChanged(object sender, SizeChangedEventArgs e) + { + ControlWidth = e.NewSize.Width; } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/DoubleWidthConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/DoubleWidthConverter.cs new file mode 100644 index 000000000..3ddcc5f3c --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/DoubleWidthConverter.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace Tango.PPC.UI.Converters +{ + public class DoubleWidthConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + double length = System.Convert.ToDouble(value); + return length * 2; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} 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 e2d447be5..f5d3502c0 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 @@ -168,6 +168,7 @@ + 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; } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index 9e766fffc..614da8fea 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -607,7 +607,7 @@ - + @@ -1260,9 +1260,9 @@ - + - diff --git a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs index 23bd2b1ba..4579ff08c 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs @@ -516,7 +516,8 @@ namespace Tango.Integration.Operation TimeSpan segmentsDuration = Job.TranslateProgressToTime(previousSegmentsLengthWithThis, ProcessParameters); TimeSpan segmentRemainingTime = segmentsDuration - Job.TranslateProgressToTime(Status.Progress, ProcessParameters); - segment.Progress = Math.Min(Math.Max((previousSegmentsLengthWithThis - segment.Length - Status.Progress) * -1, 0), segment.Length); + // segment.Progress = Math.Min(Math.Max((previousSegmentsLengthWithThis - segment.Length - Status.Progress) * -1, 0), segment.Length); + segment.Progress = Math.Min(Math.Max((previousSegmentsLengthWithThis - segment.Length - Status.ProgressMinusSettingUp) * -1, 0), segment.Length); if (i == 0 && Status.Progress > 0) { @@ -526,8 +527,9 @@ namespace Tango.Integration.Operation Status.CurrentSegment = segment; } } - - if (Status.Progress >= previousSegmentsLengthWithThis) + + //if (Status.Progress >= previousSegmentsLengthWithThis) + if (Status.ProgressMinusSettingUp >= previousSegmentsLengthWithThis) { if (!segment.Completed) { -- cgit v1.3.1 From b92a2bd63cf2b832a0870deae740aa559cb685b3 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Thu, 27 Jul 2023 16:14:22 +0300 Subject: Preparation to add resume to Machine Status view --- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 35 +- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 512 +++++++++++---------- 2 files changed, 312 insertions(+), 235 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') 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 653c2368f..684b9bd8c 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -316,6 +316,12 @@ namespace Tango.PPC.UI.ViewModels public RelayCommand AbortCommand { get; set; } + public RelayCommand ResumeCommand { get; set; } + public RelayCommand CaancelJobCommand{ get; set; } + public RelayCommand RestartJobCommand { get; set; } + public RelayCommand ClearJobCommand { get; set; } + + public RelayCommand GoToJobCommand { get; set; } /// @@ -342,7 +348,14 @@ namespace Tango.PPC.UI.ViewModels StopCommand = new RelayCommand(StopJob, () => CanStopped()); AbortCommand = new RelayCommand(AbortJob, () => CanStopped()); - GoToJobCommand = new RelayCommand(GoToJob, () => IsEnableGoToJob()); + + ResumeCommand = new RelayCommand(ResumeJob, () => CanStopped()); + CaancelJobCommand = new RelayCommand(CaancelJob, () => CanStopped()); + RestartJobCommand = new RelayCommand(RestartJob, () => CanStopped()); + ClearJobCommand = new RelayCommand(ClearJob, () => CanStopped()); + + + GoToJobCommand = new RelayCommand(GoToJob, () => IsEnableGoToJob()); JobStatusViewCommand = new RelayCommand(JobStatusView); OverviewViewCommand = new RelayCommand(OverviewView); ClearAllNotificationsCommand = new RelayCommand(ClearAllNotifications); @@ -663,6 +676,26 @@ namespace Tango.PPC.UI.ViewModels private void AbortJob() { _handler?.Cancel(); + //Job = null; + } + + private void ResumeJob() + { + + } + + private void CaancelJob() + { + Job = null; + } + + private void RestartJob() + { + + } + + private void ClearJob() + { Job = null; } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index 5f5612fb6..686638870 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -352,6 +352,32 @@ + + + + + + + @@ -456,269 +482,287 @@ - - - - - - + + + + + + + - - - - - - Thread Type - + + + + + Thread Type + + - - - - - Job Length (m) - - - - - + + + + Job Length (m) + + + + + + - - - - - Job Weight (g) - - - - - + + + + Job Weight (g) + + + + + + - - - - - Copies - - - - - + + + + Copies + + + + + + - - - - - Spools - + + + + Spools + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + Completed / + Length + Weight + + - + + + + + + + + + + + + + + + + + + + + + - - - - - Completed / - Length - Weight + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + Getting Ready... + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + Time Left + + + + + + - - - - Getting Ready... - - - - + + + + + + + - - - Time Left - + + + - - - - - - + - - - - - - - - - - - + + - - - + + + + + + + -- cgit v1.3.1 From da1c997c138633c46daa8dc3c099b7164a536eb9 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Wed, 2 Aug 2023 15:44:56 +0300 Subject: Job Running Progress - added inter segments to logic. --- .../Controls/RunningJobViewerEureka.xaml | 72 ++++++++++++++++------ .../Controls/RunningJobViewerEureka.xaml.cs | 54 ++++++++++++---- .../Converters/ProgressBorderWidthConverter.cs | 24 ++++++++ .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 3 +- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 39 +++++++++--- 5 files changed, 150 insertions(+), 42 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressBorderWidthConverter.cs (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml index 4c39bded0..dfbd47514 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml @@ -12,6 +12,7 @@ d:DesignHeight="60" d:DesignWidth="500" Height="38" d:DataContext="{d:DesignInstance Type=local:RunningJobViewerEureka, IsDesignTimeCreatable=False}"> + - - - - - - - - - + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs index 95fe5cd10..c87c50db2 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs @@ -17,6 +17,7 @@ using System.Windows.Navigation; using System.Windows.Shapes; using Tango.BL.Entities; using Tango.Integration.Operation; +using Tango.Logging; namespace Tango.PPC.UI.Controls { @@ -26,9 +27,9 @@ namespace Tango.PPC.UI.Controls public partial class RunningJobViewerEureka : UserControl { List _segments; + List _lastsegments; + - - private double _prevOffset; private double _addOffset; private int _prevUnit; @@ -80,27 +81,36 @@ namespace Tango.PPC.UI.Controls { if(Job != null) { + JobUnitLength = Job.Length; _segments = Job.EffectiveSegments.ToList(); if (Job.NumberOfUnits > 1 && _segments.Count > 0 && (_segments.Count > 1 || _segments[0].BrushStops.Count > 1)) { - //if (Job.EnableInterSegment && Job.InterSegmentLength > 0) - //{ - // _segments.Add(Job.CreateInterSegment(Job.InterSegmentLength)); - //} + if (Job.EnableInterSegment && Job.InterSegmentLength > 0) + { + _segments.Add(Job.CreateInterSegment(Job.InterSegmentLength)); + } _segments.AddRange(Job.EffectiveSegments.ToList()); - //if (Job.EnableInterSegment && Job.InterSegmentLength > 0) - //{ - // _segments.Add(Job.CreateInterSegment(Job.InterSegmentLength)); - //}//without check if last segment and last unit + if(Job.NumberOfUnits > 2 && Job.EnableInterSegment && Job.InterSegmentLength > 0) + { + _segments.Add(Job.CreateInterSegment(Job.InterSegmentLength)); + JobUnitLength += Job.InterSegmentLength; + //_segments.AddRange(Job.EffectiveSegments.ToList());//third set to use in end printing without intersegment + } + _lastsegments = Job.EffectiveSegments.ToList();; + IsHasMultipleColorsSegments = true; } else + { IsHasMultipleColorsSegments = false; + } SegmentsItemsControl.ItemsSource = _segments; SegmentsItemsControl.InvalidateVisual(); + LastSegmentsItemsControl.ItemsSource = _lastsegments; + LastSegmentsItemsControl.InvalidateVisual(); _prevOffset = _addOffset = 0.0; _prevUnit = 0; @@ -188,6 +198,20 @@ namespace Tango.PPC.UI.Controls DependencyProperty.Register("IsHasMultipleColorsSegments", typeof(bool), typeof(RunningJobViewerEureka), new PropertyMetadata(false)); + + public double JobUnitLength + { + get { return (double)GetValue(JobUnitLengthProperty); } + set { SetValue(JobUnitLengthProperty, value); } + } + + // Using a DependencyProperty as the backing store for JobUnitLength. This enables animation, styling, binding, etc... + public static readonly DependencyProperty JobUnitLengthProperty = + DependencyProperty.Register("JobUnitLength", typeof(double), typeof(RunningJobViewerEureka), new FrameworkPropertyMetadata(0.0)); + + + + /// /// Initializes a new instance of the class. /// @@ -228,14 +252,20 @@ namespace Tango.PPC.UI.Controls if(_prevUnit < currentUnit) { _addOffset = _prevOffset; + //Debug.WriteLine($"OnSliderValueChanged prevOffset: '{_prevOffset}' currentUnit = {currentUnit}, total:{total}"); } offset += _addOffset; - if (offset >= ControlWidth) + if (offset >= ControlWidth && currentUnit < (Job.NumberOfUnits - 2)) { - offset -= ControlWidth;//round + offset -= ControlWidth;//round + //Debug.WriteLine($"OnSliderValueChanged round!!! offset: '{offset}' currentUnit = {currentUnit}, total:{total}"); } + //if(currentUnit == (Job.NumberOfUnits - 1)) + //{ + // Debug.WriteLine($"OnSliderValueChanged offset: '{offset}' currentUnit = {currentUnit}. ControlWidth = {ControlWidth} total:{total}"); + //} _prevOffset = offset; _prevUnit = currentUnit; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressBorderWidthConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressBorderWidthConverter.cs new file mode 100644 index 000000000..3345798eb --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressBorderWidthConverter.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace Tango.PPC.UI.Converters +{ + public class ProgressBorderWidthConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + double length = System.Convert.ToDouble(value); + return length * 3; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} 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 e364c530c..705c042c5 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 @@ -174,6 +174,7 @@ + @@ -990,7 +991,7 @@ if $(ConfigurationName) == Eureka copy /Y "$(ProjectDir)Intro.wmv" "$(TargetDir) - + 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 684b9bd8c..f8c139cf6 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -184,7 +184,7 @@ namespace Tango.PPC.UI.ViewModels { get { return GetVolumeLiquidType(LiquidTypes.LightYellow); } } - + //public double TransparentInkOutput //{ // get { return GetVolumeLiquidType(LiquidTypes.TransparentInk); } @@ -584,17 +584,38 @@ namespace Tango.PPC.UI.ViewModels IsDyeingProcess = (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null); if (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null) { - 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(_runningJobStatus.CurrentSegment.IsInterSegment) { - if (_handler.JobTicket.Segments.Count > 0) + CurrentBrushStop = _runningJobStatus.CurrentSegment.BrushStops.FirstOrDefault(); + JobBrushStop = null; + } + else + { + var realsegmIndex = 1; + if (Job.EnableInterSegment && Job.InterSegmentLength > 0) { - JobBrushStop = _handler.JobTicket.Segments[Job.OrderedSegments.IndexOf(segment)].BrushStops.First(); - } + int segmentIndex = _runningJobStatus.CurrentSegment.SegmentIndex - (Job.EffectiveSegments.Count * RunningJobStatus.CurrentUnit); + if(RunningJobStatus.CurrentUnit > 0) + { + segmentIndex -= RunningJobStatus.CurrentUnit;// inter segment between units + } + realsegmIndex = (int)(segmentIndex/2) + 1; + } + else + { + realsegmIndex = Math.Max(_runningJobStatus.CurrentSegment.SegmentIndex - (Job.Segments.Count * RunningJobStatus.CurrentUnit), 0); + } + + var segment = Job.Segments.FirstOrDefault(x => x.SegmentIndex == realsegmIndex); + if (segment != null) + { + if (_handler.JobTicket.Segments.Count > 0) + { + JobBrushStop = _handler.JobTicket.Segments[Job.OrderedSegments.IndexOf(segment)].BrushStops.First(); + } + } + CurrentBrushStop = RunningJobStatus.CurrentSegment.FirstBrushStop; } - CurrentBrushStop = RunningJobStatus.CurrentSegment.FirstBrushStop; } } -- cgit v1.3.1 From f6b8be518df438baa155f718619ad04905b4fae5 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Fri, 25 Aug 2023 19:26:42 +0300 Subject: Resume button. Set SettingUpTotalProgress as global Start Position. --- .../Controls/RunningJobViewerEureka.xaml.cs | 12 ++-- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 77 +++++++++++++++++++++- .../Tango.Emulations/Emulators/MachineEmulator.cs | 10 +-- .../Tango.Integration/Operation/JobHandler.cs | 38 +++++++++-- .../Tango.Integration/Operation/MachineOperator.cs | 11 ++-- 5 files changed, 126 insertions(+), 22 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs index 11823f797..60c5a0346 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml.cs @@ -236,14 +236,14 @@ namespace Tango.PPC.UI.Controls if(slider_control != null) { slider_control.Value = SliderValue; - if(RunningJobStatus != null && RunningJobStatus.IsSettingUp == false && IsHasMultipleColorsSegments && ColorCanvas != null && ControlWidth > 0) + if(RunningJobStatus != null && RunningJobStatus.IsSettingUp == false && IsHasMultipleColorsSegments && ColorCanvas != null && ControlWidth > 0 && RunningJobStatus.CurrentUnitProgress > 0.01 && RunningJobStatus.CurrentUnitTotalProgress > 0) { double progress = RunningJobStatus.CurrentUnitProgress; double total = RunningJobStatus.CurrentUnitTotalProgress; int currentUnit = RunningJobStatus.CurrentUnit; - int totalUnits = Job.NumberOfUnits; - + int totalUnits = RunningJobStatus.RemainingUnits + RunningJobStatus.CurrentUnit;//Job.NumberOfUnits; + double simpleoffset = ((progress / total) * ControlWidth) ; double multiplier = (((double)(totalUnits - 1)) / (double)totalUnits); @@ -256,16 +256,16 @@ namespace Tango.PPC.UI.Controls _prevOffset = ControlWidth * (1-multiplier) * currentUnit; } _addOffset = _prevOffset; - //Debug.WriteLine($"OnSliderValueChanged prevOffset: '{_prevOffset}' currentUnit = {currentUnit}, total:{total}"); } - + // Debug.WriteLine($"OnSliderValueChanged Offset: '{offset}' CurrentUnitProgress = {RunningJobStatus.CurrentUnitProgress} progress= {progress} currentUnit = {currentUnit}, total:{total}"); offset += _addOffset; if (offset >= ControlWidth && currentUnit < (Job.NumberOfUnits - 2)) { offset -= ControlWidth;//round - //Debug.WriteLine($"OnSliderValueChanged round!!! offset: '{offset}' currentUnit = {currentUnit}, total:{total}"); + // Debug.WriteLine($"OnSliderValueChanged round!!! offset: '{offset}' currentUnit = {currentUnit}, total:{total}"); } + //if(currentUnit == (Job.NumberOfUnits - 1)) //{ // Debug.WriteLine($"OnSliderValueChanged offset: '{offset}' currentUnit = {currentUnit}. ControlWidth = {ControlWidth} total:{total}"); 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 f8c139cf6..131476c9e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -24,6 +24,9 @@ using System.ComponentModel; using RealTimeGraphX.WPF; using RealTimeGraphX.DataPoints; using Tango.PPC.UI.Graphs; +using Tango.BL; +using System.Data.Entity; +using System.Windows.Media; namespace Tango.PPC.UI.ViewModels { @@ -41,6 +44,25 @@ namespace Tango.PPC.UI.ViewModels Motor = 3 } + public class TimeToDyeValueItem + { + public DateTime startTime; + public DateTime endTime; + public double totalValue; + }; + + public class TimeToDyeValueCollection + { + public DateTime StartTime { get; set;} + public List items; + public TimeToDyeValueCollection() + { + items = new List(); + } + }; + + private DispatcherTimer _productiondata_timer; + #region Properties [TangoInject] @@ -344,7 +366,10 @@ namespace Tango.PPC.UI.ViewModels public MachineStatusViewVM() { - + _productiondata_timer = new DispatcherTimer(); + _productiondata_timer.Interval = TimeSpan.FromMinutes(10); + _productiondata_timer.Tick += _productiondata_timer_Tick; + StopCommand = new RelayCommand(StopJob, () => CanStopped()); AbortCommand = new RelayCommand(AbortJob, () => CanStopped()); @@ -355,7 +380,7 @@ namespace Tango.PPC.UI.ViewModels ClearJobCommand = new RelayCommand(ClearJob, () => CanStopped()); - GoToJobCommand = new RelayCommand(GoToJob, () => IsEnableGoToJob()); + GoToJobCommand = new RelayCommand(GoToJob, () => IsEnableGoToJob()); JobStatusViewCommand = new RelayCommand(JobStatusView); OverviewViewCommand = new RelayCommand(OverviewView); ClearAllNotificationsCommand = new RelayCommand(ClearAllNotifications); @@ -397,6 +422,12 @@ namespace Tango.PPC.UI.ViewModels MachineProvider.MachineOperator.MachineStatusChanged += MachineOperator_MachineStatusChanged; + DateTime dateTime = DateTime.Now; + DateTime onedayEarlier = dateTime.AddDays(-1); + + GetCollectionDyePropByStartTime(onedayEarlier); + + _productiondata_timer.Start(); } #region Events @@ -520,6 +551,10 @@ namespace Tango.PPC.UI.ViewModels //} } + private void _productiondata_timer_Tick(object sender, EventArgs e) + { + var CurrentDateTime = DateTime.Now; + } #endregion #region printing @@ -749,6 +784,12 @@ namespace Tango.PPC.UI.ViewModels IsDisplayJobOutline = true; } } + + #endregion + + #region graph + + public TimeToDyeValueCollection graphDyeingValuesCollection = new TimeToDyeValueCollection(); private WpfGraphController CreateController(params WpfGraphDataSeries[] seriesCollection) { @@ -771,7 +812,10 @@ namespace Tango.PPC.UI.ViewModels private WpfGraphDataSeries CreateSeries(String name, GraphHelper.GraphColor fill) { - WpfGraphDataSeries series = new WpfGraphDataSeries(); + WpfGraphDataSeries series = new WpfGraphDataSeries() + { + Stroke = Colors.DodgerBlue, + }; series.Name = name; series.Fill = GraphHelper.GetGraphBrush(fill); series.StrokeThickness = 1; @@ -779,6 +823,33 @@ namespace Tango.PPC.UI.ViewModels return series; } + public async void GetCollectionDyePropByStartTime(DateTime starttime) + { + try + { + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + var jobRuns = await db.JobRuns.Where(x => x.StartDate >= starttime).Select(x => new { x.StartDate, x.EndDate, x.EndPosition }).OrderBy(y => y.StartDate).ToListAsync(); + double allvalues = 0; + graphDyeingValuesCollection.StartTime = starttime; + for ( int i = 0; i < jobRuns.Count; i++) + { + JobController.PushData(jobRuns[i].StartDate, allvalues); + if (i > 0) + { + allvalues += jobRuns[i-1].EndPosition; + } + graphDyeingValuesCollection.items.Add( new TimeToDyeValueItem(){ startTime = jobRuns[i].StartDate, endTime = jobRuns[i].EndDate, totalValue = allvalues }); + JobController.PushData(jobRuns[i].EndDate, allvalues); + } + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error loading machine counters."); + + } + } #endregion } } diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index 7074582d0..61d069847 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -851,10 +851,11 @@ namespace Tango.Emulations.Emulators for (int i = 0; i < units; i++) { - while (progress < unit_length + (!bIsResumeProcess && i == units - 1 ? dryerLength : 0) && !_cancelJob) - { - var status = new PMR.Printing.JobStatus(); - status.Progress = progress; + // while (progress < unit_length + (!bIsResumeProcess && i == units - 1 ? dryerLength : 0) && !_cancelJob) + while (progress < unit_length + ( i == units - 1 ? dryerLength : 0) && !_cancelJob) + { + var status = new PMR.Printing.JobStatus(); + status.Progress = progress; if (!message_sent) { @@ -891,6 +892,7 @@ namespace Tango.Emulations.Emulators addedResume = true; progress = firstUnitStartPosition; } + //LogManager.Log($" Emulator Progress = {progress}, units = {units}"); double currentPosition = 0; double nextStopPosition = unit_length; diff --git a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs index 4579ff08c..5d62f4269 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs @@ -9,6 +9,7 @@ using Tango.BL.Enumerations; using Tango.Core; using Tango.Logging; using Tango.PMR.Printing; +using static Tango.Integration.Operation.AdditionalJobConfiguration; namespace Tango.Integration.Operation { @@ -139,6 +140,8 @@ namespace Tango.Integration.Operation /// public JobTicket JobTicket { get; private set; } + public ResumeConfiguration ResumeConfig { get; private set; } + #endregion #region Constructors @@ -155,13 +158,14 @@ namespace Tango.Integration.Operation /// Initializes a new instance of the class. /// /// The cancel action. - public JobHandler(Action cancelAction, Job job, JobTicket jobTicket, ProcessParametersTable processParameters, JobHandlerModes mode) : this() + public JobHandler(Action cancelAction, Job job, JobTicket jobTicket, ProcessParametersTable processParameters, JobHandlerModes mode, ResumeConfiguration resumeConfig = null) : this() { _mode = mode; ProcessParameters = processParameters; Job = job; JobTicket = jobTicket; + ResumeConfig = resumeConfig; foreach (var s in Job.Segments) { @@ -187,6 +191,11 @@ namespace Tango.Integration.Operation Status.RemainingProgress = Status.TotalProgress; Status.CurrentUnitSegments = _effectiveSegments.ToList(); Status.SettingUpTotalProgress = processParameters.DryerBufferLengthMeters; + if (resumeConfig != null && resumeConfig.GlobalStartPosition > 0) + { + Status.SettingUpTotalProgress = resumeConfig.GlobalStartPosition; + Status.CurrentUnitProgress = ResumeConfig.FirstUnitStartPosition; + } Status.TotalProgressMinusSettingUp = Job.LengthIncludingNumberOfUnits; Status.IsSettingUp = true; @@ -332,7 +341,7 @@ namespace Tango.Integration.Operation protected virtual void InvalidateJobProgress(JobStatus s) { JobStatus = s; - + if (_last_progress != s.Progress) { if (s.Progress <= PROGRESS_REPORT_RANGE_METERS || s.Progress >= Status.TotalProgress - PROGRESS_REPORT_RANGE_METERS) @@ -383,7 +392,16 @@ namespace Tango.Integration.Operation Status.IsSettingUp = false; } - Status.ProgressMinusSettingUp = s.Progress - this.Status.SettingUpTotalProgress; + if (ResumeConfig != null && ResumeConfig.GlobalStartPosition > 0) + { + Status.ProgressMinusSettingUp = s.Progress - ProcessParameters.DryerBufferLengthMeters; + //LogManager.Log($" Status.ProgressMinusSettingUp {Status.ProgressMinusSettingUp} progress = {s.Progress}"); + + } + else + { + Status.ProgressMinusSettingUp = s.Progress - this.Status.SettingUpTotalProgress; + } } int units = (int)Math.Max(Job.NumberOfUnits, 1); @@ -411,6 +429,15 @@ namespace Tango.Integration.Operation break; } } + else if(ResumeConfig != null && ResumeConfig.GlobalStartPosition > 0) + { + if (!Status.IsSettingUp && s.Progress <= previousUnitsLengthWithoutThis + unitLength + ProcessParameters.DryerBufferLengthMeters) + { + currentUnitProgress = s.Progress - previousUnitsLengthWithoutThis - ProcessParameters.DryerBufferLengthMeters; + //LogManager.Log($"currentUnitProgress before ={currentUnitProgress} progress = {s.Progress}"); + break; + } + } else if (s.Progress <= previousUnitsLengthWithoutThis + unitLength + Status.SettingUpProgress) { if (!Status.IsSettingUp) @@ -425,6 +452,7 @@ namespace Tango.Integration.Operation Status.CurrentUnit = currentUnit; Status.CurrentUnitProgress = currentUnitProgress; + //LogManager.Log($"CurrentUnit {Status.CurrentUnit} currentUnitProgress {Status.CurrentUnitProgress} "); Status.RemainingUnits = this.Job.NumberOfUnits - this.Status.CurrentUnit; @@ -444,7 +472,7 @@ namespace Tango.Integration.Operation { Status.Message = s.Message; } - + _lastStatusMessage = s.Message; @@ -527,7 +555,7 @@ namespace Tango.Integration.Operation Status.CurrentSegment = segment; } } - + //if (Status.Progress >= previousSegmentsLengthWithThis) if (Status.ProgressMinusSettingUp >= previousSegmentsLengthWithThis) { diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index 11634109f..07d2c9881 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -2596,6 +2596,8 @@ namespace Tango.Integration.Operation /// public Task Print(Job job, ProcessParametersTable processParameters, AdditionalJobConfiguration config = null) { + //processParameters.DryerBufferLength = 10; //TODO: REMOVE !!! + return Task.Factory.StartNew(() => { if (config == null) config = new AdditionalJobConfiguration(); @@ -2916,7 +2918,7 @@ namespace Tango.Integration.Operation handler.CanCancel = true; LogManager.Log(ex, "Failed to cancel job."); } - }, clonedJob, ticket, processParameters, JobHandlingMode); + }, clonedJob, ticket, processParameters, JobHandlingMode, config.ResumeConfig); handler.StatusChanged += (x, s) => { @@ -3252,9 +3254,10 @@ namespace Tango.Integration.Operation if (config.ResumeConfig != null) { - resumePreProgress = config.ResumeConfig.GlobalStartPosition - request.FirstUnitStartPosition; + resumePreProgress = config.ResumeConfig.GlobalStartPosition - processParameters.DryerBufferLengthMeters; request.FirstUnitStartPosition = config.ResumeConfig.FirstUnitStartPosition; - request.JobTicket.Length = (request.JobTicket.Length / Math.Max(request.JobTicket.NumberOfUnits, 1)) *(int)Math.Max(config.ResumeConfig.RemainingUnits, 1); + //LogManager.Log($" resumePreProgress = {resumePreProgress}, GlobalStartPosition {config.ResumeConfig.GlobalStartPosition} FirstUnitStartPosition {request.FirstUnitStartPosition}"); + request.JobTicket.Length = (request.JobTicket.Length / Math.Max(request.JobTicket.NumberOfUnits, 1)) * (int)Math.Max(config.ResumeConfig.RemainingUnits, 1); request.JobTicket.NumberOfUnits = (uint)Math.Max(config.ResumeConfig.RemainingUnits, 1); } @@ -3263,7 +3266,7 @@ namespace Tango.Integration.Operation if (!completed) { response.Message.Status.Progress += resumePreProgress; - + handler.RaiseStatusReceived(response.Message.Status); _last_job_status = handler.Status; -- cgit v1.3.1