diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-10-22 13:54:49 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-10-22 13:56:23 +0300 |
| commit | 648437dec6e56e32218d88b7a85e70ac00b6e98a (patch) | |
| tree | ad7a74e3d81246c701e6b59e9b26e063a6702417 /Software/Visual_Studio/PPC/Tango.PPC.UI/Converters | |
| parent | b6745cf00a2aedae8da24a2477d1000f30e7e1d3 (diff) | |
| download | Tango-648437dec6e56e32218d88b7a85e70ac00b6e98a.tar.gz Tango-648437dec6e56e32218d88b7a85e70ac00b6e98a.zip | |
Changed Number of Spools in Converters and GUI PPC.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Converters')
3 files changed, 17 insertions, 13 deletions
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 |
