aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2021-02-17 23:39:56 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2021-02-17 23:39:56 +0200
commitcbfc5f86577cd3eacac4f97321b75e3e4c0539de (patch)
tree60d5680ac997cae8bc38bdbc8741400a0b833e48 /Software/Visual_Studio/PPC/Tango.PPC.UI
parentf9ad6d13e30ce2a2721bcbf631a22095cfca3e4e (diff)
parentf73b3b8043e4f9183a5450afdbb99bcde1b63ff1 (diff)
downloadTango-cbfc5f86577cd3eacac4f97321b75e3e4c0539de.tar.gz
Tango-cbfc5f86577cd3eacac4f97321b75e3e4c0539de.zip
Merged short-cycle-mode branch.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml7
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityViewVM.cs17
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs26
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml17
4 files changed, 64 insertions, 3 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml
index ad1c2ece3..d2fe31387 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml
@@ -6,11 +6,16 @@
xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
xmlns:local="clr-namespace:Tango.PPC.UI.Dialogs"
mc:Ignorable="d"
- Background="{StaticResource TangoPrimaryBackgroundBrush}" Width="700" Height="800" d:DataContext="{d:DesignInstance Type=local:InsufficientLiquidQuantityViewVM, IsDesignTimeCreatable=False}">
+ Background="{StaticResource TangoPrimaryBackgroundBrush}" Width="700" Height="900" d:DataContext="{d:DesignInstance Type=local:InsufficientLiquidQuantityViewVM, IsDesignTimeCreatable=False}">
<Grid Margin="20">
<DockPanel>
<Grid DockPanel.Dock="Bottom">
<touch:TouchButton HorizontalAlignment="Right" CornerRadius="25" Command="{Binding OKCommand}" Style="{StaticResource TangoHollowButton}" Width="150" Height="50" VerticalAlignment="Bottom">CLOSE</touch:TouchButton>
+
+ <StackPanel HorizontalAlignment="Left" Visibility="{Binding IsAutoInkFillingDisabled,Converter={StaticResource BooleanToVisibilityConverter}}">
+ <TextBlock HorizontalAlignment="Center" Foreground="{StaticResource TangoErrorBrush}">Auto ink filling is disabled</TextBlock>
+ <touch:TouchButton CornerRadius="25" Margin="0 5 0 0" Command="{Binding EnableAutoInkFillingCommand}" Style="{StaticResource TangoHollowButton}" Width="300" Height="50" VerticalAlignment="Bottom">ENABLE AUTO INK FILLING</touch:TouchButton>
+ </StackPanel>
</Grid>
<StackPanel DockPanel.Dock="Top">
<Image Source="/Images/cartridge_validation.png" RenderOptions.BitmapScalingMode="Fant" Stretch="Uniform" Height="120"></Image>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityViewVM.cs
index 8b15d2e00..6d4c90e21 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityViewVM.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Tango.Core.Commands;
using Tango.Integration.Operation;
using Tango.SharedUI;
@@ -12,9 +13,23 @@ namespace Tango.PPC.UI.Dialogs
{
public InsufficientLiquidQuantityException Exception { get; set; }
- public InsufficientLiquidQuantityViewVM(InsufficientLiquidQuantityException ex)
+ public bool IsAutoInkFillingDisabled { get; set; }
+
+ public bool EnableAutoInkFillingOnExit { get; set; }
+
+ public RelayCommand EnableAutoInkFillingCommand { get; set; }
+
+ public InsufficientLiquidQuantityViewVM(InsufficientLiquidQuantityException ex,bool isAutoInkFillingDisabled)
{
Exception = ex;
+ IsAutoInkFillingDisabled = isAutoInkFillingDisabled;
+ EnableAutoInkFillingCommand = new RelayCommand(EnableAutoInkFilling);
+ }
+
+ private void EnableAutoInkFilling()
+ {
+ EnableAutoInkFillingOnExit = true;
+ Accept();
}
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs
index 9e84275d6..ed1a0253d 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs
@@ -9,6 +9,7 @@ using Tango.BL.Enumerations;
using Tango.Core;
using Tango.Core.DI;
using Tango.Integration.Operation;
+using Tango.PMR.MachineStatus;
using Tango.PPC.Common;
using Tango.PPC.Common.Connection;
using Tango.PPC.Common.Messages;
@@ -82,7 +83,30 @@ namespace Tango.PPC.UI.Printing
{
_notificationProvider.ReleaseGlobalBusyMessage();
LogManager.Log(ex);
- await _notificationProvider.ShowDialog(new InsufficientLiquidQuantityViewVM(ex));
+
+ var vm = await _notificationProvider.ShowDialog(new InsufficientLiquidQuantityViewVM(ex, _machineProvider.MachineOperator.MachineStatus.AutoInkFillingDisabled));
+
+ if (vm.EnableAutoInkFillingOnExit)
+ {
+ try
+ {
+ _notificationProvider.SetGlobalBusyMessage("Enabling auto ink filling...");
+ await _machineProvider.MachineOperator.SendRequest<SetInkAutoFillingModeRequest, SetInkAutoFillingModeResponse>(new SetInkAutoFillingModeRequest()
+ {
+ Disabled = false
+ });
+ }
+ catch (Exception exx)
+ {
+ LogManager.Log(exx, "Error enabling ink filling.");
+ await _notificationProvider.ShowError($"Error enabling auto ink filling.\n{ex.Message}");
+ }
+ finally
+ {
+ _notificationProvider.ReleaseGlobalBusyMessage();
+ }
+ }
+
throw ex;
}
catch (Exception ex)
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
index 5c5b86140..d7ff1d89e 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
@@ -287,6 +287,23 @@
<touch:TouchButton Margin="40 0 0 0" Height="65" Padding="50 0" MinWidth="200" CornerRadius="35" BlurRadius="20" Command="{Binding NotificationProvider.CurrentAppButton.Command}" IsEnabled="{Binding NotificationProvider.CurrentAppButton.IsEnabled}" Content="{Binding NotificationProvider.CurrentAppButton.Text}" Visibility="{Binding NotificationProvider.CurrentAppButton,Converter={StaticResource IsNullToVisibilityConverter}}"></touch:TouchButton>
</StackPanel>
+
+ <Grid IsHitTestVisible="False">
+ <Grid.Style>
+ <Style TargetType="Grid">
+ <Setter Property="Visibility" Value="Hidden"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding MachineProvider.MachineOperator.MachineStatus.AutoInkFillingDisabled}" Value="True">
+ <Setter Property="Visibility" Value="Visible"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding MachineProvider.MachineOperator.IsConnected}" Value="False">
+ <Setter Property="Visibility" Value="Hidden"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Grid.Style>
+ <touch:TouchIcon Icon="LightningBoltOutline" Foreground="#151515" Width="24" Height="24" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0 3 20 0"></touch:TouchIcon>
+ </Grid>
</Grid>
<Grid>