diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index f8e632fa5..3f62cd301 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -1470,6 +1470,8 @@ namespace Tango.Integration.Operation LogManager.Log($"Job upload method is set to {JobUploadStrategy}..."); + var oldKeepAlive = UseKeepAlive; + if (JobUploadStrategy == JobUploadStrategy.JobDescriptionFile) { LogManager.Log("Generating job description file..."); @@ -1492,7 +1494,8 @@ namespace Tango.Integration.Operation var storage = CreateStorageManager(); //Suppress keep alive while job uploads. - storage.SuppressKeepAliveWhileFileUploads = true; + //storage.SuppressKeepAliveWhileFileUploads = true; + UseKeepAlive = false; //This is a work around for Shlomo not managing to keep alive while parsing the file. LogManager.Log("Getting storage drive information..."); var storageInfo = await storage.GetStorageDrive(); @@ -1518,6 +1521,7 @@ namespace Tango.Integration.Operation } catch (Exception ex) { + UseKeepAlive = oldKeepAlive; Status = MachineStatuses.ReadyToDye; PrintingFailed?.Invoke(this, new PrintingFailedEventArgs(handler, originalJob, ex)); PrintingEnded?.Invoke(this, new PrintingEventArgs(handler, originalJob)); @@ -1529,6 +1533,7 @@ namespace Tango.Integration.Operation if (handler.IsCanceled) { + UseKeepAlive = oldKeepAlive; Status = MachineStatuses.ReadyToDye; return; } @@ -1544,6 +1549,14 @@ namespace Tango.Integration.Operation handler.RaiseStatusReceived(response.Message.Status); _last_job_status = handler.Status; + if (response.Message.Status.Progress > 0) + { + if (oldKeepAlive != UseKeepAlive) + { + UseKeepAlive = oldKeepAlive; + } + } + if (!responseLogged) { requestSent = true; @@ -1579,6 +1592,8 @@ namespace Tango.Integration.Operation { completed = true; + UseKeepAlive = oldKeepAlive; + if (!(ex is ContinuousResponseAbortedException)) { Status = MachineStatuses.ReadyToDye; @@ -1602,6 +1617,8 @@ namespace Tango.Integration.Operation { completed = true; + UseKeepAlive = oldKeepAlive; + Status = MachineStatuses.ReadyToDye; PrintingCompleted?.Invoke(this, new PrintingEventArgs(handler, originalJob)); PrintingEnded?.Invoke(this, new PrintingEventArgs(handler, originalJob)); |
