From b6745cf00a2aedae8da24a2477d1000f30e7e1d3 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Thu, 19 Oct 2023 17:23:24 +0300 Subject: Added Number of Spools to Job table. --- Software/Visual_Studio/Tango.BL/DTO/JobDTOBase.cs | 8 +++++ .../Visual_Studio/Tango.BL/Entities/JobBase.cs | 38 ++++++++++++++++++++++ 2 files changed, 46 insertions(+) (limited to 'Software/Visual_Studio/Tango.BL') diff --git a/Software/Visual_Studio/Tango.BL/DTO/JobDTOBase.cs b/Software/Visual_Studio/Tango.BL/DTO/JobDTOBase.cs index c5e13a569..feb789ffe 100644 --- a/Software/Visual_Studio/Tango.BL/DTO/JobDTOBase.cs +++ b/Software/Visual_Studio/Tango.BL/DTO/JobDTOBase.cs @@ -309,5 +309,13 @@ namespace Tango.BL.DTO get; set; } + /// + /// number of spools + /// + public Int32 NumberOfSpools + { + get; set; + } + } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs b/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs index f37848b5e..83912de98 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs @@ -83,6 +83,8 @@ namespace Tango.BL.Entities public event EventHandler VersionChanged; + public event EventHandler NumberOfSpoolsChanged; + public event EventHandler ColorCatalogChanged; public event EventHandler ColorSpaceChanged; @@ -1079,6 +1081,33 @@ namespace Tango.BL.Entities } } + protected Int32 _numberofspools; + + /// + /// Gets or sets the jobbase number of spools. + /// + + [Column("NUMBER_OF_SPOOLS")] + + public Int32 NumberOfSpools + { + get + { + return _numberofspools; + } + + set + { + if (_numberofspools != value) + { + _numberofspools = value; + + OnNumberOfSpoolsChanged(value); + + } + } + } + protected ColorCatalog _colorcatalog; /// @@ -1637,6 +1666,15 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(Version)); } + /// + /// Called when the NumberOfSpools has changed. + /// + protected virtual void OnNumberOfSpoolsChanged(Int32 numberofspools) + { + NumberOfSpoolsChanged?.Invoke(this, numberofspools); + RaisePropertyChanged(nameof(NumberOfSpools)); + } + /// /// Called when the ColorCatalog has changed. /// -- 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/Tango.BL') 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