diff options
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs | 18 |
1 files changed, 17 insertions, 1 deletions
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<PPCSettings>(); + 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); |
