diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-03-29 17:51:32 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-03-29 17:51:32 +0300 |
| commit | c61d12100372054de07f6201c27c7755c7be35e8 (patch) | |
| tree | eca0ada6201de7dd90a0227a8a06bc681060d2fb /Software/Visual_Studio/Tango.BL | |
| parent | 0766ff8488c961c7f73eec50fb9ee64c89da5eb1 (diff) | |
| download | Tango-c61d12100372054de07f6201c27c7755c7be35e8.tar.gz Tango-c61d12100372054de07f6201c27c7755c7be35e8.zip | |
Eureka PPC. Added weight of job by length and RML.
Diffstat (limited to 'Software/Visual_Studio/Tango.BL')
| -rw-r--r-- | Software/Visual_Studio/Tango.BL/Entities/Job.cs | 112 | ||||
| -rw-r--r-- | Software/Visual_Studio/Tango.BL/Entities/Rml.cs | 24 |
2 files changed, 136 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.BL/Entities/Job.cs b/Software/Visual_Studio/Tango.BL/Entities/Job.cs index 235a347b7..bfcd19cb1 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Job.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Job.cs @@ -93,6 +93,84 @@ namespace Tango.BL.Entities } } + [NotMapped] + [JsonIgnore] + public double LengthIncludingNumberOfUnitsAndSpools + { + get + { + if (Spools >= 4) + { + return LengthIncludingNumberOfUnits * Spools; + } + + return LengthIncludingNumberOfUnits; + } + } + + [NotMapped] + [JsonIgnore] + public double WeightIncludingNumberOfUnits + { + get + { + if (Rml == null) + return 0; + + var gramPerlength = Rml.GetGramPer1000mLength; + var weight = (LengthIncludingNumberOfUnits * gramPerlength) / (1000 * 1000);//(kg) + return weight; + } + } + + [NotMapped] + [JsonIgnore] + public double WeightIncludingNumberOfUnitsAndSpools + { + get + { + if (Spools >= 4) + { + return WeightIncludingNumberOfUnits * Spools; + } + + return WeightIncludingNumberOfUnits; + } + } + + [NotMapped] + [JsonIgnore] + public Int32 NumberOfUnitsMultipliedBySpools + { + get + { + if (Spools >= 4) + { + return NumberOfUnits * Spools; + } + return NumberOfUnits; + } + } + + [NotMapped] + [JsonIgnore] + public double WeightNumberOfUnits + { + get + { + _lastLength = GetLength(); + var l = _lastLength * Math.Max(NumberOfUnits, 1); + + if (EnableInterSegment && NumberOfUnits > 1) + { + l += ((NumberOfUnits - 1) * InterSegmentLength); + } + + return l; + } + } + + /// <summary> /// Gets or sets the job <see cref="Status"/> property as <see cref="JobStatus"/> enum instead of int. /// </summary> @@ -141,6 +219,13 @@ namespace Tango.BL.Entities } } + [NotMapped] + [JsonIgnore] + public int Spools + { + get { return 4; }//headunits? + } + /// <summary> /// Gets or sets the effective segments. /// </summary> @@ -318,6 +403,11 @@ namespace Tango.BL.Entities set { EditingState = value.ToInt32(); RaisePropertyChangedAuto(); } } + [NotMapped] + [JsonIgnore] + public double GramPerLength { get; private set;} + + #endregion #region Unmapped Fine Tuning @@ -381,6 +471,17 @@ namespace Tango.BL.Entities } } + protected override void OnRmlChanged(Rml rml) + { + base.OnRmlChanged(rml); + if(rml != null) + { + GramPerLength = Rml.GetGramPer1000mLength; + } + else + GramPerLength = 0; + } + #endregion #region Override Methods @@ -529,6 +630,17 @@ namespace Tango.BL.Entities return length; } + private double GetWeigth() + { + if(Rml == null) + return 0; + + double length = GetLength(); + + var weight = (length * GramPerLength) / (1000 * 1000);//length in m, return value in kg + return weight; + } + #endregion #region Public Methods diff --git a/Software/Visual_Studio/Tango.BL/Entities/Rml.cs b/Software/Visual_Studio/Tango.BL/Entities/Rml.cs index a49b3cf84..80d3afdba 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Rml.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Rml.cs @@ -292,6 +292,30 @@ namespace Tango.BL.Entities } } + [NotMapped] + [JsonIgnore] + public double GetGramPer1000mLength + { + + get + { + if (LinearMassDensityUnit == null || FiberSize == 0) + return 1; + if (LinearMassDensityUnit.Name == "Tex") + return FiberSize; + if (LinearMassDensityUnit.Name == "DTEX") + return (FiberSize /10); + if (LinearMassDensityUnit.Name == "Ne") + return (590.5 / FiberSize); + if (LinearMassDensityUnit.Name == "Nm") + return (1000 / FiberSize); + if (LinearMassDensityUnit.Name == "Denier") + return FiberSize/9; + + return 1; + } + } + [NotMapped] [JsonIgnore] |
