mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
D6: Moved backend pausing to itself
This commit is contained in:
parent
b967f045fe
commit
cb428c70de
2 changed files with 23 additions and 17 deletions
|
@ -585,15 +585,9 @@ class CuraApplication(QtApplication):
|
|||
def updatePlatformActivity(self, node = None):
|
||||
count = 0
|
||||
scene_bounding_box = None
|
||||
should_pause = False
|
||||
for node in DepthFirstIterator(self.getController().getScene().getRoot()):
|
||||
if type(node) is not SceneNode or (not node.getMeshData() and not node.callDecoration("isBlockSlicing")):
|
||||
continue
|
||||
if node.callDecoration("isBlockSlicing"):
|
||||
should_pause = True
|
||||
gcode_list = node.callDecoration("getGCodeList")
|
||||
if gcode_list is not None:
|
||||
self.getController().getScene().gcode_list = gcode_list
|
||||
|
||||
count += 1
|
||||
if not scene_bounding_box:
|
||||
|
@ -603,16 +597,6 @@ class CuraApplication(QtApplication):
|
|||
if other_bb is not None:
|
||||
scene_bounding_box = scene_bounding_box + node.getBoundingBox()
|
||||
|
||||
print_information = self.getPrintInformation()
|
||||
if should_pause:
|
||||
self.getBackend().pauseSlicing()
|
||||
if print_information:
|
||||
print_information.setPreSliced(True)
|
||||
else:
|
||||
self.getBackend().continueSlicing()
|
||||
if print_information:
|
||||
print_information.setPreSliced(False)
|
||||
|
||||
if not scene_bounding_box:
|
||||
scene_bounding_box = AxisAlignedBox.Null
|
||||
|
||||
|
|
|
@ -12,6 +12,8 @@ from UM.PluginRegistry import PluginRegistry
|
|||
from UM.Resources import Resources
|
||||
from UM.Settings.Validator import ValidatorState #To find if a setting is in an error state. We can't slice then.
|
||||
from UM.Platform import Platform
|
||||
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
||||
|
||||
|
||||
import cura.Settings
|
||||
|
||||
|
@ -313,6 +315,26 @@ class CuraEngineBackend(Backend):
|
|||
if source is self._scene.getRoot():
|
||||
return
|
||||
|
||||
application = Application.getInstance()
|
||||
|
||||
should_pause = False
|
||||
for node in DepthFirstIterator(self._scene.getRoot()):
|
||||
if node.callDecoration("isBlockSlicing"):
|
||||
should_pause = True
|
||||
gcode_list = node.callDecoration("getGCodeList")
|
||||
if gcode_list is not None:
|
||||
self._scene.gcode_list = gcode_list
|
||||
|
||||
print_information = application.getPrintInformation()
|
||||
if should_pause:
|
||||
self.pauseSlicing()
|
||||
if print_information:
|
||||
print_information.setPreSliced(True)
|
||||
else:
|
||||
self.continueSlicing()
|
||||
if print_information:
|
||||
print_information.setPreSliced(False)
|
||||
|
||||
if source.getMeshData() is None:
|
||||
return
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue