From c1d16392f2414775a2e3a1b1b948021a022e9359 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Mon, 29 May 2023 13:49:47 +0300 Subject: PPC. Jobs add thread column. Related Work Items: #8458 --- .../Tango.PPC.UI/Models/MachineOverviewModel.cs | 32 ++++++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs') 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 bd34122c6..579aa57f4 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs @@ -56,7 +56,7 @@ namespace Tango.PPC.UI.Models public void Update(StartDiagnosticsResponse diagnostics, Rml rml, ProcessParametersTable processParameters) { //Dryer Zone 3 - var dryerZone3State = diagnostics.HeatersStates.FirstOrDefault(x => x.HeaterType == HeaterType.HeaterZone3); + var dryerZone3State = diagnostics.HeatersStates.FirstOrDefault(x => x.HeaterType == HeaterType.EDryerHeater3); UpdateHeaterItem(DryerZone3, dryerZone3State); //Dryer Air @@ -72,7 +72,26 @@ namespace Tango.PPC.UI.Models //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(); + //EuDispenser1Pressure + List EuDispensersPressure = new List(); + var EuDispenser1PressureValue = diagnostics.Monitors.EuDispenser1Pressure.FirstOrDefault(); + EuDispensersPressure.Add(EuDispenser1PressureValue); + var EuDispenser2PressureValue = diagnostics.Monitors.EuDispenser2Pressure.FirstOrDefault(); + EuDispensersPressure.Add(EuDispenser2PressureValue); + var EuDispenser3PressureValue = diagnostics.Monitors.EuDispenser3Pressure.FirstOrDefault(); + EuDispensersPressure.Add(EuDispenser3PressureValue); + var EuDispenser4PressureValue = diagnostics.Monitors.EuDispenser4Pressure.FirstOrDefault(); + EuDispensersPressure.Add(EuDispenser4PressureValue); + var EuDispenser5PressureValue = diagnostics.Monitors.EuDispenser5Pressure.FirstOrDefault(); + EuDispensersPressure.Add(EuDispenser5PressureValue); + var EuDispenser6PressureValue = diagnostics.Monitors.EuDispenser6Pressure.FirstOrDefault(); + EuDispensersPressure.Add(EuDispenser6PressureValue); + var EuDispenser7PressureValue = diagnostics.Monitors.EuDispenser7Pressure.FirstOrDefault(); + EuDispensersPressure.Add(EuDispenser7PressureValue); + var EuDispenser8PressureValue = diagnostics.Monitors.EuDispenser8Pressure.FirstOrDefault(); + EuDispensersPressure.Add(EuDispenser8PressureValue); + + var pumpsPressuerValue = EuDispensersPressure.Max();// diagnostics.Monitors.EuInkLinesPressure.SelectMany(x => x.Data).Max(); UpdatePumpsPressureItem(pumpsPressuerValue); } @@ -101,7 +120,14 @@ namespace Tango.PPC.UI.Models item.Status = "Operational"; item.Color = Colors.Green; item.DisplayValue = $" {state.SetPoint}"; - item.MaxValue = state.SetPoint; + if(state.SetPoint == 0 && state.CurrentValue == 0) + { + item.MaxValue = 10; + } + else + { + item.MaxValue = state.SetPoint; + } item.Value = state.CurrentValue; } else if (!state.IsRampingUp && (state.CurrentValue < (state.SetPoint - 10) || state.CurrentValue > (state.SetPoint + 10))) -- cgit v1.3.1 From 218794a0207ccb6e89a9a3c7175180001ae03740 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Thu, 1 Jun 2023 15:48:54 +0300 Subject: PPC. GUI bugs,. Related Work Items: #8497, #8509, #8512 --- .../Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs | 52 ++++++++++++++++++++++ .../Tango.PPC.JobsV2/Views/JobEurekaView.xaml | 22 ++++----- .../Modules/Tango.PPC.JobsV2/Views/JobsView.xaml | 23 +++------- .../Tango.PPC.MachineSettings/Views/MainView.xaml | 2 +- .../Tango.PPC.UI/Models/MachineOverviewModel.cs | 13 ++++-- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 8 ++-- .../Tango.Emulations/Emulators/MachineEmulator.cs | 3 ++ .../Tango.Integration/Operation/JobHandler.cs | 6 +-- 8 files changed, 88 insertions(+), 41 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs') 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 df3ae4596..e5e41b382 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 @@ -225,6 +225,11 @@ namespace Tango.PPC.Jobs.ViewModels /// public RelayCommand ExportJobCommand { get; set; } + /// + /// Gets or sets the move to list ( History or Draft) jobs command. + /// + public RelayCommand MoveToListJobsCommand { get; set; } + #endregion #region Constructors @@ -251,6 +256,7 @@ namespace Tango.PPC.Jobs.ViewModels DeleteJobsCommand = new RelayCommand(() => DeleteJobs(SelectedJobs)); CloneJobsCommand = new RelayCommand(() => CloneJobs(SelectedJobs)); ExportJobCommand = new RelayCommand(ExportJob); + MoveToListJobsCommand = new RelayCommand(() => MoveToListJobs(SelectedJobs)); RegisterForMessage(HandleJobRemovedMessage); RegisterForMessage(HandleJobSavedMessage); @@ -643,6 +649,52 @@ namespace Tango.PPC.Jobs.ViewModels } } + /// + /// Moves to list (Draft/History) jobs. + /// + /// The jobs. + private async void MoveToListJobs(ObservableCollection jobs) + { + bool isHistory = SelectedCategory == JobsCategory.History; + string list = isHistory ? "Draft" : "History"; + try + { + + LogManager.Log($"Move To {list} selected jobs:\n{jobs.Select(x => x.Name).ToList().ToJsonString()}"); + + foreach (var job in SelectedJobs) + { + if(isHistory) + { + if(job.JobStatus != JobStatuses.Draft) + { + job.JobStatus = JobStatuses.Draft; + job.LastUpdated = DateTime.UtcNow; + } + } + if(!isHistory)//draft + { + if(job.JobStatus == JobStatuses.Draft) + { + job.JobStatus = JobStatuses.Completed; + job.LastUpdated = DateTime.UtcNow; + } + } + } + + await _db.SaveChangesAsync(); + + HistoryJobsCollectionView.Refresh(); + DraftJobsCollectionView.Refresh(); + ClearSelection(); + } + catch (Exception ex) + { + LogManager.Log(ex, $"Error Move To {list} selected jobs."); + await NotificationProvider.ShowError($"An error occurred while trying to Move To {list} the selected jobs."); + } + } + /// /// Called when the search filter has been changed /// 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 a92c950ed..613200c02 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 @@ -259,7 +259,7 @@ @@ -268,7 +268,7 @@ @@ -887,14 +887,14 @@ - + - + @@ -1030,7 +1030,7 @@ @@ -1040,7 +1040,7 @@ @@ -1193,7 +1193,7 @@ - + @@ -1212,12 +1212,12 @@ - + - + @@ -1230,7 +1230,7 @@ - + @@ -1238,7 +1238,7 @@ - Job Summary + Summary diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml index 5a64922af..d396b5860 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml @@ -91,26 +91,17 @@ - + + + + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml index 6475869dd..764f044d0 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml @@ -461,7 +461,7 @@ - Show advanced options (Multi-segments & Gradients) in the Job Editor + Show advanced options (Segments & Gradients) in the Job Editor 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 579aa57f4..0030d71aa 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewModel.cs @@ -198,11 +198,16 @@ namespace Tango.PPC.UI.Models Lubricant.Status = "Active"; Lubricant.DisplayValue = lubricantValue.ToString(); Lubricant.Color = Colors.Green; + return; } - - Lubricant.Status = "NotActive"; - Lubricant.DisplayValue = "None"; - Lubricant.Color = Colors.Gray; + else + { + Lubricant.Status = "NotActive"; + Lubricant.DisplayValue = "None"; + Lubricant.Color = Colors.Gray; + } + + } } } 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 7cb0cc181..adf25eddb 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -392,7 +392,7 @@ - Job Length + Job Length (m)