diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 955d508304..622894c9fd 100644 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -134,6 +134,7 @@ class CuraEngineBackend(Backend): self._scene.gcode_list = [] self._slicing = True + self.slicingStarted.emit() job = StartSliceJob.StartSliceJob(self._profile, self._socket) job.start() @@ -142,6 +143,7 @@ class CuraEngineBackend(Backend): def _terminate(self): self._slicing = False self._restart = True + self.slicingCancelled.emit() if self._process is not None: Logger.log("d", "Killing engine process") try: @@ -259,7 +261,9 @@ class CuraEngineBackend(Backend): view = Application.getInstance().getController().getActiveView() if view.getPluginId() == "LayerView": self._layer_view_active = True - if self._stored_layer_data: + # There is data and we're not slicing at the moment + # if we are slicing, there is no need to re-calculate the data as it will be invalid in a moment. + if self._stored_layer_data and not self._slicing: job = ProcessSlicedObjectListJob.ProcessSlicedObjectListJob(self._stored_layer_data) job.start() self._stored_layer_data = None diff --git a/plugins/CuraEngineBackend/ProcessSlicedObjectListJob.py b/plugins/CuraEngineBackend/ProcessSlicedObjectListJob.py index c802ca343b..464b605371 100644 --- a/plugins/CuraEngineBackend/ProcessSlicedObjectListJob.py +++ b/plugins/CuraEngineBackend/ProcessSlicedObjectListJob.py @@ -29,6 +29,7 @@ class ProcessSlicedObjectListJob(Job): if Application.getInstance().getController().getActiveView().getPluginId() == "LayerView": self._progress = Message(catalog.i18nc("@info:status", "Processing Layers"), 0, False, -1) self._progress.show() + Job.yieldThread() Application.getInstance().getController().activeViewChanged.connect(self._onActiveViewChanged)