blob: c6319499f2ff6af39157ad01646cd43625e345d8 (
plain)
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
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.Entities;
using Tango.BL.Enumerations;
namespace Tango.BL.Dispensing
{
/// <summary>
/// Represents a transparent liquid (Diluter) IDS pack dispensing calculator.
/// </summary>
/// <seealso cref="Tango.BL.Dispensing.DispensingCalcBase" />
[DispensingCalc(IdsPackFormulas.TransparentLiquid)]
public class TransparentLiquidDispensingCalc : DispensingCalcBase
{
/// <summary>
/// Calculates the required nanoliter per centimeter.
/// </summary>
/// <param name="liquidVolume">The liquid volume.</param>
/// <returns></returns>
public override double CalculateNanoliterPerCentimeter(LiquidVolume liquidVolume)
{
if (liquidVolume.Configuration != null && liquidVolume.RML != null && liquidVolume.ProcessParametersTable != null)
{
double nlPcmSum = liquidVolume.BrushStop.LiquidVolumes.Where(x => x.IdsPack.LiquidType.HasPigment).Sum(x => x.NanoliterPerCentimeter);
nlPcmSum = Math.Max(0, liquidVolume.ProcessParametersTable.MinInkUptake - nlPcmSum);
if (nlPcmSum < liquidVolume.ProcessParametersTable.MinInkUptake * 0.02d)
{
nlPcmSum = 0;
}
return nlPcmSum;
}
else
{
return 0d;
}
}
/// <summary>
/// Coerces the specified liquid volume.
/// </summary>
/// <param name="liquidVolume">The liquid volume.</param>
/// <returns></returns>
public override double CoerceVolume(LiquidVolume liquidVolume)
{
if (liquidVolume.ProcessParametersTable != null)
{
return Math.Max(100d - liquidVolume.BrushStop.LiquidVolumes.Where(x => x.IdsPack.LiquidType.HasPigment).Sum(x => x.Volume), 0);
}
else
{
return liquidVolume.Volume;
}
}
}
}
|