aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.BL
diff options
context:
space:
mode:
authorRoy <Roy.mail.net@gmail.com>2023-04-26 18:42:31 +0300
committerRoy <Roy.mail.net@gmail.com>2023-04-26 18:42:31 +0300
commit1ce740b88ebb7e275bfe8d900c31749af766392b (patch)
treef0c302f1ee564a19f76a17103672e2f6d7647acc /Software/Visual_Studio/Tango.BL
parent4d8cdd9ea1b383529a17b5e6b7bacdb39a90e42a (diff)
parentaeb2abf154a5e53189aaae24a71542a56eb1f278 (diff)
downloadTango-1ce740b88ebb7e275bfe8d900c31749af766392b.tar.gz
Tango-1ce740b88ebb7e275bfe8d900c31749af766392b.zip
Merged eureka_ppc
Diffstat (limited to 'Software/Visual_Studio/Tango.BL')
-rw-r--r--Software/Visual_Studio/Tango.BL/Entities/Job.cs120
-rw-r--r--Software/Visual_Studio/Tango.BL/Entities/Rml.cs24
-rw-r--r--Software/Visual_Studio/Tango.BL/Entities/Segment.cs10
3 files changed, 146 insertions, 8 deletions
diff --git a/Software/Visual_Studio/Tango.BL/Entities/Job.cs b/Software/Visual_Studio/Tango.BL/Entities/Job.cs
index c6a6ea226..2784dea32 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 );//(g)
+ 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; 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
@@ -527,14 +628,17 @@ namespace Tango.BL.Entities
}
return length;
- //if (Segments != null)
- //{
- // return Segments.Sum(x => x.LengthWithFactor) + ((EnableInterSegment && IsAllSegmentsPerSpool) ? (InterSegmentLength * (Segments.Count > 0 ? Segments.Count - 1 : Segments.Count)) : 0);
- //}
- //else
- //{
- // return 0;
- //}
+ }
+
+ private double GetWeigth()
+ {
+ if(Rml == null)
+ return 0;
+
+ double length = GetLength();
+
+ var weight = (length * GramPerLength) / (1000 );//length in m, return value in g
+ return weight;
}
#endregion
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]
diff --git a/Software/Visual_Studio/Tango.BL/Entities/Segment.cs b/Software/Visual_Studio/Tango.BL/Entities/Segment.cs
index be72100a5..5a99442e4 100644
--- a/Software/Visual_Studio/Tango.BL/Entities/Segment.cs
+++ b/Software/Visual_Studio/Tango.BL/Entities/Segment.cs
@@ -271,6 +271,16 @@ namespace Tango.BL.Entities
}
}
+ public BrushStop FirstBrushStop
+ {
+ get { if (BrushStops.Count == 1)//Intersegment?? - null
+ return BrushStops[0];
+ else if(BrushStops.Count >= 5)
+ return BrushStops[1];
+ else
+ return null; }
+ }
+
public static Color GetRelativeRGB(Color first, Color second, double firstOffset, double secondOffset, double offset)
{
var color = new Color();