From b294fd44000766de11ce6c0e2d82d2fae81c82b9 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Wed, 13 Nov 2019 11:59:51 +0200 Subject: Restored job liquid quantity validation to start of procedure. --- .../ViewModels/MainViewVM.cs | 48 ++++++++-------------- .../Views/InsufficientLiquidQuantityView.xaml | 2 +- 2 files changed, 18 insertions(+), 32 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio') 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 93baf3b9d..fd20a0b1c 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 @@ -1479,39 +1479,15 @@ namespace Tango.MachineStudio.Developer.ViewModels JobHandler.Failed += (x, ex) => { - if (ex is InsufficientLiquidQuantityException) - { - InvokeUI(() => - { - _notification.ShowModalDialog(new InsufficientLiquidQuantityViewVM(ex as InsufficientLiquidQuantityException), (_) => - { - - MachineOperator.EnableJobLiquidQuantityValidation = false; - StartJob(); - - }, () => - { - SetJobFailed(); + LogManager.Log(ex, String.Format("Job {0} has failed.", RunningJob.Name)); + _eventLogger.Log(ex, String.Format("Job {0} has failed.", RunningJob.Name)); + SetJobFailed(); - InvokeUI(() => - { - StopRecordingIfInProgress(); - }); - }); - }); - } - else + InvokeUI(() => { - LogManager.Log(ex, String.Format("Job {0} has failed.", RunningJob.Name)); - _eventLogger.Log(ex, String.Format("Job {0} has failed.", RunningJob.Name)); - SetJobFailed(); - - InvokeUI(() => - { - _notification.ShowError("Job failed. " + ex.FlattenMessage()); - StopRecordingIfInProgress(); - }); - } + _notification.ShowError("Job failed. " + ex.FlattenMessage()); + StopRecordingIfInProgress(); + }); }; JobHandler.Finalizing += (_, __) => @@ -1543,6 +1519,16 @@ namespace Tango.MachineStudio.Developer.ViewModels //Finally Canceled.. }; } + catch (InsufficientLiquidQuantityException ex) + { + _notification.ShowModalDialog(new InsufficientLiquidQuantityViewVM(ex), (x) => + { + + MachineOperator.EnableJobLiquidQuantityValidation = false; + StartJob(); + + }, () => { }); + } catch (Exception ex) { LogManager.Log(ex); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml index f0e9dc29c..9bf76c026 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml @@ -6,7 +6,7 @@ xmlns:vm="clr-namespace:Tango.MachineStudio.Developer.ViewModels" xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views" mc:Ignorable="d" - Height="450" Width="800" Background="{StaticResource WhiteBackgroundBrush}" d:DataContext="{d:DesignInstance Type=vm:InsufficientLiquidQuantityViewVM, IsDesignTimeCreatable=False}"> + Height="450" Width="800" d:DataContext="{d:DesignInstance Type=vm:InsufficientLiquidQuantityViewVM, IsDesignTimeCreatable=False}"> -- cgit v1.3.1 From 2c9f65d23e63e71c20e4321244bace59fdfbf791 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Wed, 13 Nov 2019 17:55:22 +0200 Subject: Improve insufficient liquid quantity view. Fixed MS finalizing text. --- .../Views/InsufficientLiquidQuantityView.xaml | 58 +++++++++++++++++----- .../Views/InsufficientLiquidQuantityView.xaml.cs | 6 +-- .../Views/MainView.xaml | 58 ++++++++++++---------- .../InsufficientLiquidQuantityException.cs | 8 +++ .../Tango.Integration/Operation/MachineOperator.cs | 20 +++++--- 5 files changed, 102 insertions(+), 48 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml index 9bf76c026..fa85ea598 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml @@ -5,8 +5,10 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:vm="clr-namespace:Tango.MachineStudio.Developer.ViewModels" xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views" + xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - Height="450" Width="800" d:DataContext="{d:DesignInstance Type=vm:InsufficientLiquidQuantityViewVM, IsDesignTimeCreatable=False}"> + Height="590" Width="800" d:DataContext="{d:DesignInstance Type=vm:InsufficientLiquidQuantityViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource Dialog.Foreground}" + Background="{StaticResource Dialog.Background}"> @@ -23,28 +25,53 @@ - - + + - + - - - + + + + + + + + + + + + + + + - + - - + + - + + + + + + + - + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml.cs index 171cb754e..51cfb1e73 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml.cs @@ -33,7 +33,7 @@ namespace Tango.MachineStudio.Developer.Views Grid parent = border.Parent as Grid; IDSPackLevel packLevel = border.DataContext as IDSPackLevel; - border.Height = ((double)packLevel.Current / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualHeight; + border.Width = ((double)packLevel.Current / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualWidth; } private void Limit_Loaded(object sender, RoutedEventArgs e) @@ -42,8 +42,8 @@ namespace Tango.MachineStudio.Developer.Views Grid parent = rect.Parent as Grid; IDSPackLevel packLevel = rect.DataContext as IDSPackLevel; - var top = ((double)packLevel.Required / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualHeight; - rect.Margin = new Thickness(0, 0, 0, top); + var left = ((double)packLevel.Required / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualWidth; + rect.Margin = new Thickness(left, 0, 0, 0); if (packLevel.IsValid) { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml index abea6aec9..d0caa2447 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml @@ -330,31 +330,36 @@ - - - + + + Finalizing... + + + + + @@ -408,8 +413,7 @@ - Finalizing... - + diff --git a/Software/Visual_Studio/Tango.Integration/Operation/InsufficientLiquidQuantityException.cs b/Software/Visual_Studio/Tango.Integration/Operation/InsufficientLiquidQuantityException.cs index a1c18370b..3e4758c58 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/InsufficientLiquidQuantityException.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/InsufficientLiquidQuantityException.cs @@ -14,11 +14,19 @@ namespace Tango.Integration.Operation public IdsPack IdsPack { get; set; } public int Current { get; set; } public int Required { get; set; } + public int Maximum { get; set; } public bool IsValid { get { return Current >= Required; } } + + public bool IsOverMax + { + get { return Required > Maximum; } + } + + public String Message { get; set; } } public InsufficientLiquidQuantityException(String message) : base(message) diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index 451ed8219..ebbf520c3 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -1425,9 +1425,9 @@ namespace Tango.Integration.Operation { var segment = job.Segments[segmentIndex]; var segment_length_cm = segment.Length * 100d; - + List orderedBrushCollection = segment.BrushStops.OrderBy(x => x.OffsetMeters).ToList(); - + int solid_gradient_oeff = orderedBrushCollection.Count == 1 ? 1 : 2; double prev_offset_cm = 0; for (int brushIndex = 0; brushIndex < orderedBrushCollection.Count; brushIndex++) @@ -1450,7 +1450,7 @@ namespace Tango.Integration.Operation brush_length_centimeters -= resolution; } prev_offset_cm = brush_offset_cm; - + foreach (var liquidVolumes in brush.LiquidVolumes) { liquidQuantities[liquidVolumes.IdsPack.PackIndex] += liquidVolumes.NanoliterPerCentimeter * (brush_length_centimeters / solid_gradient_oeff); @@ -1477,12 +1477,20 @@ namespace Tango.Integration.Operation { IdsPack = idsPack, Current = packLevel.DispenserLevel, - Required = (int)liquidQuantities[index] + Required = (int)liquidQuantities[index], + Maximum = MAX_DISPENSER_NANOLITER, }; - if (liquidQuantities[index] > packLevel.DispenserLevel) + if (idsLevel.Required > idsLevel.Current) { shouldThrow = true; + + idsLevel.Message = $"Missing {idsLevel.Required - idsLevel.Current} nanoliters to complete the job."; + + if (idsLevel.Required > idsLevel.Maximum) + { + idsLevel.Message = $"Required ink exceeds the maximum capacity of the dispenser by {idsLevel.Required - idsLevel.Maximum} nanoliters. Please reduce the segment length."; + } } exception.IdsPackLevels.Add(idsLevel); @@ -1769,7 +1777,7 @@ namespace Tango.Integration.Operation if (EnableJobLiquidQuantityValidation) { - ValidateJobLiquidQuantity(job, processParameters, job.Machine.Configuration); + ValidateJobLiquidQuantity(job, processParameters, job.Machine.Configuration); } var originalJob = job; -- cgit v1.3.1 From ebcd646d565cc251d808048fc7ffa2bacbeaeca2 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Thu, 14 Nov 2019 11:38:18 +0200 Subject: Changed color of text and format in InsufficientLiquidQuantityException dialog --- .../Views/InsufficientLiquidQuantityView.xaml | 33 ++++++++++++++-------- .../InsufficientLiquidQuantityException.cs | 8 ++++++ .../Tango.Integration/Operation/MachineOperator.cs | 11 +++++--- 3 files changed, 36 insertions(+), 16 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml index fa85ea598..c0cb963e7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml @@ -25,7 +25,7 @@ - + @@ -34,7 +34,7 @@ - + @@ -43,7 +43,7 @@ + - - + @@ -97,14 +104,16 @@ - - - - - + + + + + + + - + diff --git a/Software/Visual_Studio/Tango.Integration/Operation/InsufficientLiquidQuantityException.cs b/Software/Visual_Studio/Tango.Integration/Operation/InsufficientLiquidQuantityException.cs index 3e4758c58..797d4f498 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/InsufficientLiquidQuantityException.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/InsufficientLiquidQuantityException.cs @@ -27,6 +27,12 @@ namespace Tango.Integration.Operation } public String Message { get; set; } + public IDSPackLevel() + { + Maximum = 130000000; + Required = 0; + Current = 0; + } } public InsufficientLiquidQuantityException(String message) : base(message) @@ -35,5 +41,7 @@ namespace Tango.Integration.Operation } public List IdsPackLevels { get; internal set; } + + } } diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index ebbf520c3..9a5c7ff9b 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -40,6 +40,7 @@ using Tango.Integration.Emergency; using Tango.PMR.MachineStatus; using Newtonsoft.Json; using Tango.PMR.Integration; +using System.Globalization; namespace Tango.Integration.Operation { @@ -1484,12 +1485,13 @@ namespace Tango.Integration.Operation if (idsLevel.Required > idsLevel.Current) { shouldThrow = true; - - idsLevel.Message = $"Missing {idsLevel.Required - idsLevel.Current} nanoliters to complete the job."; + string display_value = (((double)(idsLevel.Required - idsLevel.Current)/ 1000000000)).ToString("N2", CultureInfo.InvariantCulture); + idsLevel.Message = $"Missing {display_value} liters to complete the job."; if (idsLevel.Required > idsLevel.Maximum) { - idsLevel.Message = $"Required ink exceeds the maximum capacity of the dispenser by {idsLevel.Required - idsLevel.Maximum} nanoliters. Please reduce the segment length."; + display_value = (((double)(idsLevel.Required - idsLevel.Maximum))/ 1000000000).ToString("N2", CultureInfo.InvariantCulture); + idsLevel.Message = $"Required ink exceeds the maximum capacity of the dispenser by {display_value} liters. Please reduce the segment length."; } } @@ -1569,7 +1571,8 @@ namespace Tango.Integration.Operation { IdsPack = idsPack, Current = packLevel.DispenserLevel, - Required = (int)liquidQuantities[index] + Required = (int)liquidQuantities[index], + Maximum = MAX_DISPENSER_NANOLITER, }; if (liquidQuantities[index] > packLevel.DispenserLevel) -- cgit v1.3.1 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. --- Software/DB/PPC/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/PPC/Tango_log.ldf | Bin 53673984 -> 53673984 bytes Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 22675456 -> 22675456 bytes .../ViewModels/MainViewVM.cs | 2 +- .../Views/JobView.xaml | 152 +++++++++++---------- .../ViewModels/ColorConversionViewVM.cs | 15 +- .../UWF/AlternativeUnifiedWriteFilterManager.cs | 13 +- .../PPC/Tango.PPC.UI/Resources/Colors.xaml | 2 + .../Visual_Studio/Tango.BL/Entities/BrushStop.cs | 19 ++- 10 files changed, 119 insertions(+), 84 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio') diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf index d5304a381..b7604d584 100644 Binary files a/Software/DB/PPC/Tango.mdf and b/Software/DB/PPC/Tango.mdf differ diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf index c5bc583ac..ecab6b86c 100644 Binary files a/Software/DB/PPC/Tango_log.ldf and b/Software/DB/PPC/Tango_log.ldf differ diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 849baff99..34ed04aa3 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index 4c1df436f..38dc8f93b 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ 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; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/UWF/AlternativeUnifiedWriteFilterManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/UWF/AlternativeUnifiedWriteFilterManager.cs index 5fb74b2fe..828bccf83 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/UWF/AlternativeUnifiedWriteFilterManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/UWF/AlternativeUnifiedWriteFilterManager.cs @@ -47,14 +47,15 @@ namespace Tango.PPC.Common.UWF command.OutputEncoding = CmdCommand.OutEncoding.Unicode; await command.Run(); - command = new CmdCommand("wmic", $"computersystem where name=\"%computername%\" set AutomaticManagedPagefile=False"); - await command.Run(); + //We don't use page file anymore since upgrade to 4GB RAM. But keep this just in case. + //command = new CmdCommand("wmic", $"computersystem where name=\"%computername%\" set AutomaticManagedPagefile=False"); + //await command.Run(); - command = new CmdCommand("wmic", $"pagefileset create name=\"p:\\pagefile.sys\""); - await command.Run(); + //command = new CmdCommand("wmic", $"pagefileset create name=\"p:\\pagefile.sys\""); + //await command.Run(); - command = new CmdCommand("wmic", $"pagefileset where name=\"p:\\\\pagefile.sys\" set InitialSize=16,MaximumSize=3870"); - await command.Run(); + //command = new CmdCommand("wmic", $"pagefileset where name=\"p:\\\\pagefile.sys\" set InitialSize=16,MaximumSize=3870"); + //await command.Run(); } /// diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Colors.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Colors.xaml index f0e872285..a0db8e2aa 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Colors.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Colors.xaml @@ -13,4 +13,6 @@ + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs b/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs index d23e9b1f2..8c755455f 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs @@ -111,7 +111,7 @@ namespace Tango.BL.Entities { get { - return LiquidVolumes != null ? LiquidVolumes.Where(x => x.IdsPack.IdsPackFormula.Code == IdsPackFormulas.StandardColor.ToInt32()).Sum(x => x.Volume) > MAX_TOTAL_LIQUID_VOLUME : false; + return LiquidVolumes != null ? LiquidVolumes.Where(x => x.IdsPack.IdsPackFormula.Code == IdsPackFormulas.StandardColor.ToInt32()).Sum(x => x.Volume) > GetTotalMaximumLiquidVolumeLimit() : false; } } @@ -709,5 +709,22 @@ namespace Tango.BL.Entities } #endregion + + #region Private Methods + + private double GetTotalMaximumLiquidVolumeLimit() + { + try + { + var tables = Segment.Job.Rml.GetActiveProcessGroup().ProcessParametersTables.OrderBy(x => x.TableIndex).ToList(); + return (tables[1].MaxInkUptake / tables[0].MaxInkUptake) * 100; + } + catch + { + return MAX_TOTAL_LIQUID_VOLUME; + } + } + + #endregion } } -- cgit v1.3.1