1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
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); }
}
}
}
|