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') 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