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 ++++++++-------------- 1 file changed, 17 insertions(+), 31 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels') 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); -- 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/Modules/Tango.MachineStudio.Developer/ViewModels') 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