Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksei S <a.sasin@ultimaker.com>2018-07-14 00:50:02 +0300
committerAleksei S <a.sasin@ultimaker.com>2018-07-14 00:50:02 +0300
commit817a304ed1a252cd3937391cd616fd3952c2b06c (patch)
treede5abefa276aa8b85214736b6b161ad802ea13e0 /plugins
parent31891e631c829d7724b2da6d1bbcab19b55649d6 (diff)
After reconecting to another port update job status '_is_cancelled' to false
CURA-5549
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/CuraEngineBackend/CuraEngineBackend.py5
-rw-r--r--plugins/CuraEngineBackend/StartSliceJob.py3
2 files changed, 8 insertions, 0 deletions
diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py
index 9aff42a9e1..6814674308 100755
--- a/plugins/CuraEngineBackend/CuraEngineBackend.py
+++ b/plugins/CuraEngineBackend/CuraEngineBackend.py
@@ -534,6 +534,11 @@ class CuraEngineBackend(QObject, Backend):
if error.getErrorCode() not in [Arcus.ErrorCode.BindFailedError, Arcus.ErrorCode.ConnectionResetError, Arcus.ErrorCode.Debug]:
Logger.log("w", "A socket error caused the connection to be reset")
+ # _terminate()' function sets the job status to 'cancel', after reconnecting to another Port the job status
+ # needs to be updated. Otherwise backendState is "Unable To Slice"
+ if error.getErrorCode() == Arcus.ErrorCode.BindFailedError and self._start_slice_job is not None:
+ self._start_slice_job.setIsCancelled(False)
+
## Remove old layer data (if any)
def _clearLayerData(self, build_plate_numbers: Set = None) -> None:
for node in DepthFirstIterator(self._scene.getRoot()): #type: ignore #Ignore type error because iter() should get called automatically by Python syntax.
diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py
index 9a40445a18..eb392de121 100644
--- a/plugins/CuraEngineBackend/StartSliceJob.py
+++ b/plugins/CuraEngineBackend/StartSliceJob.py
@@ -290,6 +290,9 @@ class StartSliceJob(Job):
def isCancelled(self) -> bool:
return self._is_cancelled
+ def setIsCancelled(self, value: bool):
+ self._is_cancelled = value
+
## Creates a dictionary of tokens to replace in g-code pieces.
#
# This indicates what should be replaced in the start and end g-codes.