Add thread yields to several long running and heavy processing jobs

Contributes to CURA-358
This commit is contained in:
Arjen Hiemstra 2015-11-04 13:06:40 +01:00
parent 653b46d825
commit 0b2f0b2604
3 changed files with 11 additions and 1 deletions

View file

@ -38,10 +38,10 @@ class ProcessSlicedObjectListJob(Job):
for node in DepthFirstIterator(self._scene.getRoot()):
if type(node) is SceneNode and node.getMeshData():
if node.callDecoration("getLayerData"):
#if hasattr(node.getMeshData(), "layerData"):
self._scene.getRoot().removeChild(node)
else:
objectIdMap[id(node)] = node
Job.yieldThread()
settings = Application.getInstance().getMachineManager().getActiveProfile()
layerHeight = settings.getSettingValue("layer_height")
@ -91,6 +91,8 @@ class ProcessSlicedObjectListJob(Job):
layer_data.addPolygon(layer.id, polygon.type, points, polygon.line_width)
Job.yieldThread()
current_layer += 1
progress = (current_layer / layer_count) * 100
# TODO: Rebuild the layer data mesh once the layer has been processed.