aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StopModel.cs
diff options
context:
space:
mode:
authorRoy <Roy.mail.net@gmail.com>2022-11-13 03:46:12 +0200
committerRoy <Roy.mail.net@gmail.com>2022-11-13 03:46:12 +0200
commitd38bf750367c6d6cdda3a6a3efbdf3552aa85358 (patch)
tree000818a2a1e49d1e3decc630a94cf183bbaf2128 /Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StopModel.cs
parent8431040bf909ba65d5ce242b5fd2cc91005ba679 (diff)
downloadTango-d38bf750367c6d6cdda3a6a3efbdf3552aa85358.tar.gz
Tango-d38bf750367c6d6cdda3a6a3efbdf3552aa85358.zip
FSE Stats Module.
Extended job run structure. CSV export.
Diffstat (limited to 'Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StopModel.cs')
-rw-r--r--Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StopModel.cs144
1 files changed, 144 insertions, 0 deletions
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StopModel.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StopModel.cs
new file mode 100644
index 000000000..b4cb29e7e
--- /dev/null
+++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StopModel.cs
@@ -0,0 +1,144 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Media;
+using Tango.BL.DTO;
+using Tango.BL.Entities;
+using Tango.BL.Enumerations;
+using Tango.Core.Commands;
+using Tango.PPC.Shared.Statistics;
+
+namespace Tango.FSE.Statistics.Models
+{
+ public class StopModel : PresentationBrushStop
+ {
+ public JobRunDTO JobRun { get; set; }
+ public PresentationJob Job { get; set; }
+ public PresentationSegment Segment { get; set; }
+ public int JobIndex { get; set; }
+ public int SegmentIndex { get; set; }
+ public String ThreadName { get; set; }
+ public RelayCommand<StopModel> ShowFailedMessageCommand { get; set; }
+ public ProcessParametersTable ProcessParameters { get; set; }
+ public bool IsAdvancedMode { get; set; }
+
+ public String Input
+ {
+ get
+ {
+ switch (ColorSpace)
+ {
+ case ColorSpaces.RGB:
+ return $"{Red}, {Green}, {Blue}";
+ case ColorSpaces.LAB:
+ return $"{Math.Round(L, 2)}, {Math.Round(A, 2)}, {Math.Round(B, 2)}";
+ case ColorSpaces.Catalog:
+ return $"{Catalog} => {CatalogItem}";
+ case ColorSpaces.Volume:
+ return $"{Math.Round(Cyan, 2)}, {Math.Round(Magenta, 2)}, {Math.Round(Yellow, 2)}, {Math.Round(Black, 2)}";
+ }
+
+ return "Unspecified";
+ }
+ }
+
+ public TimeSpan Duration
+ {
+ get
+ {
+ return JobRun.EndDate - JobRun.StartDate;
+ }
+ }
+
+ public double CyanOutput
+ {
+ get { return GetLiquidTypeOfDefault(LiquidTypes.Cyan); }
+ }
+
+ public double MagentaOutput
+ {
+ get { return GetLiquidTypeOfDefault(LiquidTypes.Magenta); }
+ }
+
+ public double YellowOutput
+ {
+ get { return GetLiquidTypeOfDefault(LiquidTypes.Yellow); }
+ }
+
+ public double BlackOutput
+ {
+ get { return GetLiquidTypeOfDefault(LiquidTypes.Black); }
+ }
+
+ public double LightCyanOutput
+ {
+ get { return GetLiquidTypeOfDefault(LiquidTypes.LightCyan); }
+ }
+
+ public double LightMagentaOutput
+ {
+ get { return GetLiquidTypeOfDefault(LiquidTypes.LightMagenta); }
+ }
+
+ public double LightYellowOutput
+ {
+ get { return GetLiquidTypeOfDefault(LiquidTypes.LightYellow); }
+ }
+
+ public double TransparentInkOutput
+ {
+ get { return GetLiquidTypeOfDefault(LiquidTypes.TransparentInk); }
+ }
+
+ public double LubricantOutput
+ {
+ get { return GetLiquidTypeOfDefault(LiquidTypes.Lubricant); }
+ }
+
+ private double GetLiquidTypeOfDefault(LiquidTypes liquidType)
+ {
+ var lt = LiquidVolumes.FirstOrDefault(x => x.LiquidType == liquidType);
+
+ if (lt != null)
+ {
+ return Math.Round(lt.Volume, 2);
+ }
+
+ return 0;
+ }
+
+ public List<LiquidQuantityModel> LiquidQuantities
+ {
+ get
+ {
+ return new List<LiquidQuantityModel>()
+ {
+ new LiquidQuantityModel(){ LiquidType = LiquidTypes.Cyan, Quantity = JobRun.CyanQuantity },
+ new LiquidQuantityModel(){ LiquidType = LiquidTypes.Magenta, Quantity = JobRun.MagentaQuantity },
+ new LiquidQuantityModel(){ LiquidType = LiquidTypes.Yellow, Quantity = JobRun.YellowQuantity },
+ new LiquidQuantityModel(){ LiquidType = LiquidTypes.Black, Quantity = JobRun.BlackQuantity },
+ new LiquidQuantityModel(){ LiquidType = LiquidTypes.LightCyan, Quantity = JobRun.LightCyanQuantity },
+ new LiquidQuantityModel(){ LiquidType = LiquidTypes.LightMagenta, Quantity = JobRun.LightMagentaQuantity },
+ new LiquidQuantityModel(){ LiquidType = LiquidTypes.LightYellow, Quantity = JobRun.LightYellowQuantity },
+ new LiquidQuantityModel(){ LiquidType = LiquidTypes.TransparentInk, Quantity = JobRun.TransparentQuantity },
+ new LiquidQuantityModel(){ LiquidType = LiquidTypes.Lubricant, Quantity = JobRun.LubricantQuantity },
+ };
+ }
+ }
+
+ public Color BestMatchColor
+ {
+ get
+ {
+ return BestMatchR == 0 && BestMatchG == 0 && BestMatchB == 0 ? Colors.Transparent : Color.FromRgb((byte)BestMatchR, (byte)BestMatchG, (byte)BestMatchB);
+ }
+ }
+
+ public Brush BestMatchBrush
+ {
+ get { return new SolidColorBrush(BestMatchColor); }
+ }
+ }
+}