From 765986922827db6d0f92ce1de6f53519c0674344 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Wed, 11 Oct 2023 14:55:13 +0300 Subject: Removed option 'show advanced (segment&gradient) in job editor' Related Work Items: #9131 --- .../Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.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 345231e57..5d8473018 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 @@ -280,19 +280,7 @@ namespace Tango.PPC.Jobs.ViewModels } } } - - private bool _showAdvanced; - - public bool ShowAdvanced - { - get { return _showAdvanced; } - set - { - _showAdvanced = value; - RaisePropertyChangedAuto(); - } - } - + private JobResumeModel _resumeModel; public JobResumeModel ResumeModel { @@ -547,7 +535,7 @@ namespace Tango.PPC.Jobs.ViewModels RaisePropertyChanged(nameof(SelectedRML)); await LoadRML(_selectedRML); - if (BuildProvider.IsEureka && Job.Segments.Count == 1 && Job.Segments[0].BrushStops.Count == 1) + if (BuildProvider.IsEureka && Job.Segments.Count == 1 && Job.Segments[0].BrushStops.Count <= 1) { IsBasicMode = true; } @@ -581,7 +569,6 @@ namespace Tango.PPC.Jobs.ViewModels IsFullMode = true; DyeCommand.RaiseCanExecuteChanged(); - ShowAdvanced = Settings.ShowAdvancedOptions; } catch (Exception ex) { -- cgit v1.3.1 From 3fc440bd00595d660299de7da0fce21945014df4 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Thu, 19 Oct 2023 11:55:18 +0300 Subject: when a job is running, the "Edit job' button should be disabled. Related Work Items: #9149 --- .../Tango.PPC.JobsV2/ViewModels/JobViewVM.cs | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.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 5d8473018..dffa9b241 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 @@ -110,6 +110,17 @@ namespace Tango.PPC.Jobs.ViewModels } } + public bool CanDropResume + { + get + { + return Job != null && HasResumeModel && + (!MachineProvider.MachineOperator.IsPrinting + || (MachineProvider.MachineOperator.RunningJob != null + && MachineProvider.MachineOperator.RunningJob.Guid != Job.Guid)); + } + } + private ICollectionView _segmentsCollectionView; /// /// Gets or sets the job segments collection view. @@ -423,7 +434,7 @@ namespace Tango.PPC.Jobs.ViewModels CopyCommand = new RelayCommand(Copy); UndoCommand = new RelayCommand(Undo);//(x) => { return UndoRedoManager.Instance.IsEnableUndoOperation(); } RedoCommand = new RelayCommand(Redo);//(x) => { return UndoRedoManager.Instance.IsEnableRedoOperation();} - DropResumeCommand = new RelayCommand(DropResume); + DropResumeCommand = new RelayCommand(DropResume, (x)=> CanDropResume); NavigateBackToJobs = new RelayCommand(NavigateBack); @@ -510,6 +521,7 @@ namespace Tango.PPC.Jobs.ViewModels } RaisePropertyChanged(nameof(CanEdit)); + DropResumeCommand.RaiseCanExecuteChanged(); Job.NameChanged -= Job_NameChanged; Job.NameChanged += Job_NameChanged; @@ -768,6 +780,7 @@ namespace Tango.PPC.Jobs.ViewModels var handler = await PrintingManager.Print(Job, _db, printConfig); RaisePropertyChanged(nameof(CanEdit)); + DropResumeCommand.RaiseCanExecuteChanged(); if (!BuildProvider.IsEureka) { @@ -1773,6 +1786,10 @@ namespace Tango.PPC.Jobs.ViewModels private void MachineOperator_PrintingStarted(object sender, PrintingEventArgs e) { RaisePropertyChanged(nameof(CanEdit)); + InvokeUI( () => + { + DropResumeCommand.RaiseCanExecuteChanged(); + }); } private void MachineOperator_PrintingEnded(object sender, Integration.Operation.PrintingEventArgs e) @@ -1783,6 +1800,10 @@ namespace Tango.PPC.Jobs.ViewModels } RaisePropertyChanged(nameof(CanEdit)); + InvokeUI(() => + { + DropResumeCommand.RaiseCanExecuteChanged(); + }); } -- cgit v1.3.1 From 648437dec6e56e32218d88b7a85e70ac00b6e98a Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Sun, 22 Oct 2023 13:54:49 +0300 Subject: Changed Number of Spools in Converters and GUI PPC. --- .../Tango.PPC.JobsV2/ViewModels/JobViewVM.cs | 5 +++-- .../Modules/Tango.PPC.JobsV2/Views/JobsView.xaml | 4 ++-- .../Converters/ProgressLengthSpoolConverter.cs | 12 +++++++----- .../Converters/ProgressUnitSpoolConverter.cs | 6 +++--- .../Converters/ProgressWeightSpoolConverter.cs | 12 +++++++----- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 13 +++++++++---- Software/Visual_Studio/Tango.BL/Entities/Job.cs | 21 +++++++-------------- 7 files changed, 38 insertions(+), 35 deletions(-) (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.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 dffa9b241..8a01e07cc 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 @@ -632,8 +632,8 @@ namespace Tango.PPC.Jobs.ViewModels JobType = Job.JobType, InterSegmentLength = Job.InterSegmentLength, EnableInterSegment = Job.EnableInterSegment, - NumberSpools = (BuildProvider.IsEureka ? Job.Spools : 1), - Copies = (BuildProvider.IsEureka ? Job.NumberOfUnits * Job.Spools : Job.NumberOfUnits) + NumberSpools = (BuildProvider.IsEureka ? Job.NumberOfSpools : 1), + Copies = (BuildProvider.IsEureka ? Job.NumberOfUnits * Job.NumberOfSpools : Job.NumberOfUnits) }; Dictionary guidToGroup = new Dictionary(); if (Job.Version < 2) @@ -1607,6 +1607,7 @@ namespace Tango.PPC.Jobs.ViewModels { Job.SpoolType = _spoolTypes.FirstOrDefault(x => x.Code == (int)BL.Enumerations.SpoolTypes.StandardSpool); } + Job.NumberOfSpools = JobModel.NumberSpools; var oldSegments = Job.Segments.ToList(); 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 b57619c8c..ec080ebed 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 @@ -285,7 +285,7 @@ - + @@ -408,7 +408,7 @@ - + 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 377d02d81..f43405085 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs @@ -15,11 +15,12 @@ namespace Tango.PPC.UI.Converters { try { - if (values.Count() == 2) + if (values.Count() == 3) { double length = System.Convert.ToDouble(values[0]); bool forOneSpool = System.Convert.ToBoolean(values[1]); - var totalBy4Spools = (double)length*4;// spools ; + int number_of_spools = System.Convert.ToInt16(values[2]); + var totalBy4Spools = (double)length* number_of_spools; if (forOneSpool) { return (double)totalBy4Spools / 4; @@ -27,14 +28,15 @@ namespace Tango.PPC.UI.Converters return totalBy4Spools; } - if (values.Count() == 3) + 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]) ; + int number_of_spools = System.Convert.ToInt16(values[3]); - var totalBy4Spools = (double)length * 4; - var currentProgressBy4Spools = (double)currentProgresslength * 4 ; + var totalBy4Spools = (double)length * number_of_spools; + var currentProgressBy4Spools = (double)currentProgresslength * number_of_spools; int coeff = (int)currentProgressBy4Spools / (int)totalBy4Spools; var progressCurrent = (coeff == 0 || coeff == 1) ? currentProgressBy4Spools : currentProgressBy4Spools % (coeff * totalBy4Spools);//show for progress diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs index d0cc8284e..66303ab27 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs @@ -14,11 +14,11 @@ namespace Tango.PPC.UI.Converters { try { - if (values.Count() == 1)//may be added count of spools + if (values.Count() == 2)//may be added count of spools { int CurrentUnit = System.Convert.ToInt16(values[0]); - - var totalBy4Spools = (double)CurrentUnit * 4;// spools ; + int number_of_spools = System.Convert.ToInt16(values[1]); + var totalBy4Spools = (double)CurrentUnit * number_of_spools; return totalBy4Spools.ToString(); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressWeightSpoolConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressWeightSpoolConverter.cs index f451fe0d9..7ffb1e8a7 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressWeightSpoolConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressWeightSpoolConverter.cs @@ -16,12 +16,13 @@ namespace Tango.PPC.UI.Converters { try { - if (values.Count() == 3) + if (values.Count() == 4) { 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 ; + int number_of_spools = System.Convert.ToInt16(values[3]); + var totalBy4Spools = (double)length * number_of_spools; var weight = ((double)totalBy4Spools * coef) / (1000);//(g) if (forOneSpool) @@ -31,15 +32,16 @@ namespace Tango.PPC.UI.Converters return weight; } - if (values.Count() == 4) + if (values.Count() == 5) { 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]); + int number_of_spools = System.Convert.ToInt16(values[4]); - var totalBy4Spools = (double)length * 4; - var currentProgressBy4Spools = (double)currentProgresslength * 4; + var totalBy4Spools = (double)length * number_of_spools; + var currentProgressBy4Spools = (double)currentProgresslength * number_of_spools; int coeff = (int)currentProgressBy4Spools / (int)totalBy4Spools; var progressCurrent = (coeff == 0 || coeff == 1) ? currentProgressBy4Spools : currentProgressBy4Spools % (coeff * totalBy4Spools);//show for progress 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 0436cdab6..f9338b813 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -558,7 +558,7 @@ Spools - + @@ -650,6 +650,7 @@ + @@ -659,6 +660,7 @@ + @@ -673,6 +675,7 @@ + @@ -683,6 +686,7 @@ + @@ -792,7 +796,7 @@ - + @@ -807,7 +811,7 @@ - + @@ -830,6 +834,7 @@ + @@ -1019,7 +1024,7 @@ - + diff --git a/Software/Visual_Studio/Tango.BL/Entities/Job.cs b/Software/Visual_Studio/Tango.BL/Entities/Job.cs index 29f7e1054..328d74f0c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Job.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Job.cs @@ -99,9 +99,9 @@ namespace Tango.BL.Entities { get { - if (Spools >= 4) + if (NumberOfSpools >= 4) { - return LengthIncludingNumberOfUnits * Spools; + return LengthIncludingNumberOfUnits * NumberOfSpools; } return LengthIncludingNumberOfUnits; @@ -129,9 +129,9 @@ namespace Tango.BL.Entities { get { - if (Spools >= 4) + if (NumberOfSpools >= 4) { - return WeightIncludingNumberOfUnits * Spools; + return WeightIncludingNumberOfUnits * NumberOfSpools; } return WeightIncludingNumberOfUnits; @@ -144,9 +144,9 @@ namespace Tango.BL.Entities { get { - if (Spools >= 4) + if (NumberOfSpools >= 4) { - return NumberOfUnits * Spools; + return NumberOfUnits * NumberOfSpools; } return NumberOfUnits; } @@ -218,14 +218,7 @@ namespace Tango.BL.Entities RaisePropertyChangedAuto(); } } - - [NotMapped] - [JsonIgnore] - public int Spools - { - get { return 4; }//headunits? - } - + /// /// Gets or sets the effective segments. /// -- cgit v1.3.1