diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index d020fd2a6..9768498c6 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -2174,6 +2174,27 @@ namespace Tango.Integration.Operation job.NumberOfUnits = 1; } + if (job.EnableLubrication) + { + try + { + foreach (var stop in job.Segments.SelectMany(x => x.BrushStops).Where(x => x.BrushColorSpace != ColorSpaces.Volume)) + { + var lubricantVolume = stop.LiquidVolumes.SingleOrDefault(x => x.IdsPack != null && x.IdsPack.LiquidType != null && x.LiquidType == LiquidTypes.Lubricant); + + if (lubricantVolume != null) + { + lubricantVolume.Volume = 100; + } + } + } + catch (Exception ex) + { + System.Diagnostics.Debugger.Break(); + LogManager.Log(ex, "Error in setting automatic lubrication volumes."); + } + } + //Modify transparent/white brush stops. (Transparent/white stops should be all zeros and 100% TI) foreach (var stop in job.Segments.SelectMany(x => x.BrushStops).Where(x => x.IsTransparent || x.IsWhite).ToList()) { @@ -2333,6 +2354,12 @@ namespace Tango.Integration.Operation ThreadFactory.StartNew(async () => { + if (handler.IsCanceled) + { + Status = MachineStatuses.ReadyToDye; + return; + } + Status = MachineStatuses.GettingReady; RunningJob = clonedJob; OnPrintingStarted(handler, clonedJob); @@ -2408,6 +2435,12 @@ namespace Tango.Integration.Operation LogManager.Log($"Job upload method is set to {JobUploadStrategy}..."); + if (handler.IsCanceled) + { + Status = MachineStatuses.ReadyToDye; + return; + } + var oldKeepAlive = UseKeepAlive; if (JobUploadStrategy == JobUploadStrategy.JobDescriptionFile) @@ -2428,9 +2461,21 @@ namespace Tango.Integration.Operation Message = "Uploading job description file...", }); + if (handler.IsCanceled) + { + Status = MachineStatuses.ReadyToDye; + return; + } + LogManager.Log("Creating storage API manager..."); var storage = CreateStorageManager(); + if (handler.IsCanceled) + { + Status = MachineStatuses.ReadyToDye; + return; + } + //Suppress keep alive while job uploads. //storage.SuppressKeepAliveWhileFileUploads = true; UseKeepAlive = false; //This is a work around for Shlomo not managing to keep alive while parsing the file. |
