From 357d86202db77f6860b8f514e910b967ce4c3034 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Thu, 28 Apr 2022 02:30:11 +0300 Subject: Spool Type Firmware Notifications. --- .../Connection/DefaultMachineProvider.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/Connection') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs index fe0de64f9..18c0f6202 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs @@ -160,6 +160,22 @@ namespace Tango.PPC.Common.Connection var settings = SettingsManager.Default.GetOrCreate(); + if (Machine != null) + { + try + { + using (var db = ObservablesContext.CreateDefault()) + { + var spoolType = db.SpoolTypes.FirstOrDefault(x => x.Guid == settings.SpoolTypeGuid); + await MachineOperator.SetSpoolType((PMR.Printing.JobSpoolType)spoolType.Code); + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error setting machine spool type before connection."); + } + } + if (!Machine.IsDemo) { if (String.IsNullOrWhiteSpace(settings.EmbeddedComPort)) @@ -210,7 +226,7 @@ namespace Tango.PPC.Common.Connection preCheckSerialPort.Close(); fileLoggingDisabled = false; Thread.Sleep(500); //Wait a little while to not scare the other side?.. - } + } LogManager.Log($"Connecting to machine on {settings.EmbeddedComPort}...", LogCategory.Info); -- cgit v1.3.1