Enable functions pauseSlicing and continueSlicing in combination with BlockSlicingDecorator. CURA-3361

This commit is contained in:
Jack Ha 2017-02-09 16:06:36 +01:00
parent 34793e06fb
commit c2bf88751e

View file

@ -72,6 +72,7 @@ class CuraEngineBackend(Backend):
self._scene.sceneChanged.connect(self._onSceneChanged) self._scene.sceneChanged.connect(self._onSceneChanged)
self._pause_slicing = False self._pause_slicing = False
self._block_slicing = False # continueSlicing does not have effect if True
# Workaround to disable layer view processing if layer view is not active. # Workaround to disable layer view processing if layer view is not active.
self._layer_view_active = False self._layer_view_active = False
@ -196,7 +197,7 @@ class CuraEngineBackend(Backend):
self.backendStateChange.emit(BackendState.Disabled) self.backendStateChange.emit(BackendState.Disabled)
def continueSlicing(self): def continueSlicing(self):
if self._pause_slicing: if self._pause_slicing and not self._block_slicing:
self._pause_slicing = False self._pause_slicing = False
self.backendStateChange.emit(BackendState.NotStarted) self.backendStateChange.emit(BackendState.NotStarted)
@ -315,15 +316,19 @@ class CuraEngineBackend(Backend):
if source is self._scene.getRoot(): if source is self._scene.getRoot():
return return
should_pause = False should_pause = self._pause_slicing
block_slicing = False
for node in DepthFirstIterator(self._scene.getRoot()): for node in DepthFirstIterator(self._scene.getRoot()):
if node.callDecoration("isBlockSlicing"): if node.callDecoration("isBlockSlicing"):
should_pause = True should_pause = True
block_slicing = True
gcode_list = node.callDecoration("getGCodeList") gcode_list = node.callDecoration("getGCodeList")
if gcode_list is not None: if gcode_list is not None:
self._scene.gcode_list = gcode_list self._scene.gcode_list = gcode_list
if should_pause: self._block_slicing = block_slicing
if should_pause and self._block_slicing:
self.pauseSlicing() self.pauseSlicing()
else: else:
self.continueSlicing() self.continueSlicing()