diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.BL/LiquidVolume.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.BL/LiquidVolume.cs | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/Software/Visual_Studio/Tango.BL/LiquidVolume.cs b/Software/Visual_Studio/Tango.BL/LiquidVolume.cs index 5b4cec488..4949378e9 100644 --- a/Software/Visual_Studio/Tango.BL/LiquidVolume.cs +++ b/Software/Visual_Studio/Tango.BL/LiquidVolume.cs @@ -140,16 +140,27 @@ namespace Tango.BL { List<LiquidTypesRml> factors = Configuration.GetSupportedIdsPacks(RML).Select(x => x.LiquidType).SelectMany(x => x.LiquidTypesRmls).Where(x => x.Rml.Guid == RML.Guid).ToList(); - int index = BrushStop.LiquidVolumes.IndexOf(this); + var factor = factors.FirstOrDefault(x => x.LiquidType != null && x.LiquidType.Type == LiquidType); - if (index > factors.Count - 1 || index < 0) + if (factor != null) { - return 0d; + return factor.MaxNlPerCm; } else { - return factors[index].MaxNlPerCm; + return RML.DefaultLiquidFactor; } + + //int index = BrushStop.LiquidVolumes.IndexOf(this); + + //if (index > factors.Count - 1 || index < 0) + //{ + // return RML.DefaultLiquidFactor; + //} + //else + //{ + // return factors[index].MaxNlPerCm; + //} } else { |
