aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StopModel.cs
diff options
context:
space:
mode:
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.cs96
1 files changed, 34 insertions, 62 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
index d979fe55b..6f92ca2e8 100644
--- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StopModel.cs
+++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StopModel.cs
@@ -58,94 +58,63 @@ namespace Tango.FSE.Statistics.Models
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 String.Join("\n", GetVolumeInputs().Where(x => x.Volume > 0).Select(x => x.LiquidType.Name + ": " + Math.Round(x.Volume, 2)));
}
return "Unspecified";
}
}
- public TimeSpan Duration
+ public String OutputString
{
get
{
- return JobRun.EndDate - JobRun.StartDate;
+ return String.Join("\n", Output.Where(x => x.Volume > 0).Select(x => x.LiquidType.Name + ": " + Math.Round(x.Volume, 2)));
}
}
- 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
+ public List<PresentationLiquidVolume> InputVolumes
{
- get { return GetLiquidTypeOfDefault(LiquidTypes.LightYellow); }
- }
-
- public double TransparentInkOutput
- {
- get { return GetLiquidTypeOfDefault(LiquidTypes.TransparentInk); }
+ get
+ {
+ return GetVolumeInputs().Where(x => x.Volume > 0).ToList();
+ }
}
- public double LubricantOutput
+ public List<PresentationLiquidVolume> Output
{
- get { return GetLiquidTypeOfDefault(LiquidTypes.Lubricant); }
+ get
+ {
+ var output = new List<PresentationLiquidVolume>();
+ output.AddRange(LiquidVolumes.Where(x => x.LiquidType.HasPigment && x.Volume > 0).OrderBy(x => x.LiquidType.PreferredIndex));
+ output.Add(LiquidVolumes.FirstOrDefault(x => x.LiquidType.Type == LiquidTypes.TransparentInk));
+ return output;
+ }
}
- private double GetLiquidTypeOfDefault(LiquidTypes liquidType)
+ public TimeSpan Duration
{
- var lt = LiquidVolumes.FirstOrDefault(x => x.LiquidType == liquidType);
-
- if (lt != null)
+ get
{
- return Math.Round(lt.Volume, 2);
+ return JobRun.EndDate - JobRun.StartDate;
}
-
- return 0;
}
public List<LiquidQuantityModel> LiquidQuantities
{
get
{
- return new List<LiquidQuantityModel>()
+ var quantities = new List<LiquidQuantityModel>();
+
+ foreach (var liquidVolume in LiquidVolumes)
{
- 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 },
- };
+ LiquidQuantityModel model = new LiquidQuantityModel();
+ model.LiquidType = liquidVolume.LiquidType;
+ model.Quantity = (double)typeof(JobRun).GetProperty(model.LiquidType.Name.Replace(" ", "") + "Quantity").GetValue(JobRun);
+ quantities.Add(model);
+ }
+
+ return quantities;
}
}
@@ -164,8 +133,11 @@ namespace Tango.FSE.Statistics.Models
public String LogicalLength
{
- get { var length = IsEureka ? JobRun.JobLogicalLength * 4 : JobRun.JobLogicalLength;
- return JobRun.NumberOfUnits > 1 ? $"{length} x{JobRun.NumberOfUnits}" : length.ToString(); }
+ get
+ {
+ var length = IsEureka ? JobRun.JobLogicalLength * 4 : JobRun.JobLogicalLength;
+ return JobRun.NumberOfUnits > 1 ? $"{length} x{JobRun.NumberOfUnits}" : length.ToString();
+ }
}
public double JobLength