Merge branch 'master' into python_type_hinting

This commit is contained in:
Simon Edwards 2017-02-13 16:31:31 +01:00
commit 92cee4a9d7
83 changed files with 23986 additions and 11140 deletions

View file

@ -68,6 +68,7 @@ class CuraEngineBackend(Backend):
self._scene.sceneChanged.connect(self._onSceneChanged)
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.
self._layer_view_active = False
@ -150,7 +151,7 @@ class CuraEngineBackend(Backend):
## Perform a slice of the scene.
def slice(self):
Logger.log("d", "Starting slice job...")
if self._pause_slicing:
if self._pause_slicing or self._block_slicing:
return
self._slice_start_time = time()
if not self._enabled or not self._global_container_stack: # We shouldn't be slicing.
@ -187,12 +188,13 @@ class CuraEngineBackend(Backend):
def pauseSlicing(self):
self.close()
self._pause_slicing = True
self.backendStateChange.emit(BackendState.Disabled)
if not self._pause_slicing:
self.close()
self._pause_slicing = True
self.backendStateChange.emit(BackendState.Disabled)
def continueSlicing(self):
if self._pause_slicing:
if self._pause_slicing and not self._block_slicing:
self._pause_slicing = False
self.backendStateChange.emit(BackendState.NotStarted)
@ -311,15 +313,19 @@ class CuraEngineBackend(Backend):
if source is self._scene.getRoot():
return
should_pause = False
should_pause = self._pause_slicing
block_slicing = False
for node in DepthFirstIterator(self._scene.getRoot()):
if node.callDecoration("isBlockSlicing"):
should_pause = True
block_slicing = True
gcode_list = node.callDecoration("getGCodeList")
if gcode_list is not None:
self._scene.gcode_list = gcode_list
if should_pause:
self._block_slicing = block_slicing
if should_pause or self._block_slicing:
self.pauseSlicing()
else:
self.continueSlicing()