From b5c5758e431077d84fb53a3ff62f8e751fca2731 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 23 Sep 2019 18:22:32 +0300 Subject: Implemented Insufficient liquid levels !!! --- .../Dialogs/InsufficientLiquidQuantityView.xaml | 78 ++++++++++++++++++++++ .../Dialogs/InsufficientLiquidQuantityView.xaml.cs | 54 +++++++++++++++ .../Dialogs/InsufficientLiquidQuantityViewVM.cs | 20 ++++++ 3 files changed, 152 insertions(+) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityViewVM.cs (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml new file mode 100644 index 000000000..f3c471954 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml @@ -0,0 +1,78 @@ + + + + + CLOSE + + + + Insufficient Ink Level + + There seems to be an insufficient ink levels in one or more of the following dispensers. + The job cannot be completed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml.cs new file mode 100644 index 000000000..9ec1eec0e --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.Integration.Operation; +using static Tango.Integration.Operation.InsufficientLiquidQuantityException; + +namespace Tango.PPC.UI.Dialogs +{ + /// + /// Interaction logic for InsufficientLiquidQuantityView.xaml + /// + public partial class InsufficientLiquidQuantityView : UserControl + { + public InsufficientLiquidQuantityView() + { + InitializeComponent(); + } + + private void IdsPackLoaded(object sender, RoutedEventArgs e) + { + Border border = sender as Border; + Grid parent = border.Parent as Grid; + IDSPackLevel packLevel = border.DataContext as IDSPackLevel; + + border.Height = ((double)packLevel.Current / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualHeight; + } + + private void Limit_Loaded(object sender, RoutedEventArgs e) + { + Rectangle rect = sender as Rectangle; + 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); + + if (packLevel.IsValid) + { + rect.Visibility = Visibility.Hidden; + } + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityViewVM.cs new file mode 100644 index 000000000..8b15d2e00 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityViewVM.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Integration.Operation; +using Tango.SharedUI; + +namespace Tango.PPC.UI.Dialogs +{ + public class InsufficientLiquidQuantityViewVM : DialogViewVM + { + public InsufficientLiquidQuantityException Exception { get; set; } + + public InsufficientLiquidQuantityViewVM(InsufficientLiquidQuantityException ex) + { + Exception = ex; + } + } +} -- cgit v1.3.1