aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2024-12-05 02:38:10 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2024-12-05 02:38:10 +0200
commitb77fbb01ed5b63b65f6e755fef9ca49c3e58ea50 (patch)
tree40013e359a230404d0bf4fd4e6fbfb7bdd862432 /Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics
parentec3b8fd0d0b4d980a5d93c5fa11b4717cbd0c875 (diff)
downloadTango-b77fbb01ed5b63b65f6e755fef9ca49c3e58ea50.tar.gz
Tango-b77fbb01ed5b63b65f6e755fef9ca49c3e58ea50.zip
Last say on extra inks branch
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/PresentationBrushStop.cs48
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/PresentationLiquidVolume.cs3
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/StatisticsResult.cs3
3 files changed, 49 insertions, 5 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/PresentationBrushStop.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/PresentationBrushStop.cs
index d17cc8d42..2f5e7aea6 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/PresentationBrushStop.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/PresentationBrushStop.cs
@@ -9,6 +9,8 @@ namespace Tango.PPC.Shared.Statistics
{
public class PresentationBrushStop
{
+
+ private List<PresentationLiquidVolume> _inputVolumes;
public ColorSpaces ColorSpace { get; set; }
public double StartMeters { get; set; }
public int Red { get; set; }
@@ -17,10 +19,7 @@ namespace Tango.PPC.Shared.Statistics
public double L { get; set; }
public double A { get; set; }
public double B { get; set; }
- public double Cyan { get; set; }
- public double Magenta { get; set; }
- public double Yellow { get; set; }
- public double Black { get; set; }
+
public String Catalog { get; set; }
public String CatalogItem { get; set; }
@@ -30,6 +29,47 @@ namespace Tango.PPC.Shared.Statistics
public List<PresentationLiquidVolume> LiquidVolumes { get; set; }
+ public double GetLiquidVolumeOutputOrZero(LiquidTypes liquidType)
+ {
+ var lv = LiquidVolumes.FirstOrDefault(x => x.LiquidType.Type == liquidType);
+ return lv != null ? lv.Volume : 0.0;
+ }
+
+ public double GetLiquidVolumeInputOrZero(LiquidTypes liquidType)
+ {
+ var lv = GetVolumeInputs().FirstOrDefault(x => x.LiquidType.Type == liquidType);
+ return lv != null ? lv.Volume : 0.0;
+ }
+
+ public List<PresentationLiquidVolume> GetVolumeInputs()
+ {
+ if (_inputVolumes == null)
+ {
+ _inputVolumes = new List<PresentationLiquidVolume>();
+ var clones = LiquidVolumes.Select(x => new PresentationLiquidVolume() { LiquidType = x.LiquidType, Volume = x.Volume }).ToList();
+
+
+ foreach (var liquidVolume in clones.Where(x => x.LiquidType.HasPigment))
+ {
+ if (liquidVolume.LiquidType.IsLightInk && liquidVolume.Volume > 0)
+ {
+ var darkInk = clones.FirstOrDefault(x => x.LiquidType.Code == liquidVolume.LiquidType.DarkInkCode);
+ if (darkInk != null)
+ {
+ darkInk.Volume = (double)((decimal)liquidVolume.Volume / 10m);
+
+ continue;
+ }
+ }
+
+ _inputVolumes.Add(liquidVolume);
+ }
+ }
+
+ return _inputVolumes;
+ }
+
+
public PresentationBrushStop()
{
LiquidVolumes = new List<PresentationLiquidVolume>();
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/PresentationLiquidVolume.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/PresentationLiquidVolume.cs
index c370d1f5d..fb560ca0c 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/PresentationLiquidVolume.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/PresentationLiquidVolume.cs
@@ -3,13 +3,14 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Tango.BL.Entities;
using Tango.BL.Enumerations;
namespace Tango.PPC.Shared.Statistics
{
public class PresentationLiquidVolume
{
- public LiquidTypes LiquidType { get; set; }
+ public LiquidType LiquidType { get; set; }
public double Volume { get; set; }
}
} \ No newline at end of file
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/StatisticsResult.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/StatisticsResult.cs
index 8cee4c545..3cbd26e32 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/StatisticsResult.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/StatisticsResult.cs
@@ -11,9 +11,12 @@ namespace Tango.PPC.Shared.Statistics
{
public List<JobRunComposition> JobRuns { get; set; }
+ public List<LiquidTypeDTO> LiquidTypes { get; set; }
+
public StatisticsResult()
{
JobRuns = new List<JobRunComposition>();
+ LiquidTypes = new List<LiquidTypeDTO>();
}
}
}