From 856d12b6cc813697451fa200fb437c84ff2640c7 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 14 Nov 2019 17:00:20 +0200 Subject: Refactored IsLiquidVolumesOutOfRange to use process parameters. --- .../ViewModels/MainViewVM.cs | 2 +- .../Views/JobView.xaml | 152 +++++++++++---------- .../ViewModels/ColorConversionViewVM.cs | 15 +- 3 files changed, 92 insertions(+), 77 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index fd20a0b1c..63cfa10b8 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -873,7 +873,7 @@ namespace Tango.MachineStudio.Developer.ViewModels foreach (var stop in stops) { - if (stop.ColorSpace.Code == BL.Enumerations.ColorSpaces.Volume.ToInt32() && !stop.IsLiquidVolumesOutOfRange) + if (stop.ColorSpace.Code == BL.Enumerations.ColorSpaces.Volume.ToInt32()) { try { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml index e1bbad6a7..3e6ffd396 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml @@ -241,91 +241,93 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Liquid volumes exceeds the maximum range for color conversion! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - + Total: % ( nl ) - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + Liquid volumes exceeds the maximum range for color conversion! + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs index b68239b4b..f583fa15e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs @@ -309,6 +309,19 @@ namespace Tango.MachineStudio.RML.ViewModels } } + private double GetTotalMaximumLiquidVolumeLimit() + { + try + { + var tables = RML.GetActiveProcessGroup().ProcessParametersTables.OrderBy(x => x.TableIndex).ToList(); + return (tables[1].MaxInkUptake / tables[0].MaxInkUptake) * 100; + } + catch + { + return BrushStop.MAX_TOTAL_LIQUID_VOLUME; + } + } + private void OnLiquidVolumeChanged() { try @@ -316,7 +329,7 @@ namespace Tango.MachineStudio.RML.ViewModels if (LiquidsCalibrationData == null || _prevent_inverse_conversion) return; //TODO: This is temporary because of out of range volumes. - if (LiquidVolumes.Where(x => x.LiquidType.HasPigment).Sum(x => x.Volume) > 200) + if (LiquidVolumes.Where(x => x.LiquidType.HasPigment).Sum(x => x.Volume) > GetTotalMaximumLiquidVolumeLimit()) { IsVolumesOutOfRange = true; return; -- cgit v1.3.1