aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs26
1 files changed, 25 insertions, 1 deletions
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)