mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 07:03:56 -06:00
Fixed error spam on progress sliced layer run
CURA-4349
This commit is contained in:
parent
355aa36bb4
commit
583b776c6c
1 changed files with 22 additions and 23 deletions
|
@ -47,7 +47,7 @@ class ProcessSlicedLayersJob(Job):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self._layers = layers
|
self._layers = layers
|
||||||
self._scene = Application.getInstance().getController().getScene()
|
self._scene = Application.getInstance().getController().getScene()
|
||||||
self._progress = None
|
self._progress_message = Message(catalog.i18nc("@info:status", "Processing Layers"), 0, False, -1)
|
||||||
self._abort_requested = False
|
self._abort_requested = False
|
||||||
|
|
||||||
## Aborts the processing of layers.
|
## Aborts the processing of layers.
|
||||||
|
@ -62,12 +62,11 @@ class ProcessSlicedLayersJob(Job):
|
||||||
def run(self):
|
def run(self):
|
||||||
start_time = time()
|
start_time = time()
|
||||||
if Application.getInstance().getController().getActiveView().getPluginId() == "LayerView":
|
if Application.getInstance().getController().getActiveView().getPluginId() == "LayerView":
|
||||||
self._progress = Message(catalog.i18nc("@info:status", "Processing Layers"), 0, False, -1)
|
self._progress_message.show()
|
||||||
self._progress.show()
|
|
||||||
Job.yieldThread()
|
Job.yieldThread()
|
||||||
if self._abort_requested:
|
if self._abort_requested:
|
||||||
if self._progress:
|
if self._progress_message:
|
||||||
self._progress.hide()
|
self._progress_message.hide()
|
||||||
return
|
return
|
||||||
|
|
||||||
Application.getInstance().getController().activeViewChanged.connect(self._onActiveViewChanged)
|
Application.getInstance().getController().activeViewChanged.connect(self._onActiveViewChanged)
|
||||||
|
@ -80,8 +79,8 @@ class ProcessSlicedLayersJob(Job):
|
||||||
node.getParent().removeChild(node)
|
node.getParent().removeChild(node)
|
||||||
break
|
break
|
||||||
if self._abort_requested:
|
if self._abort_requested:
|
||||||
if self._progress:
|
if self._progress_message:
|
||||||
self._progress.hide()
|
self._progress_message.hide()
|
||||||
return
|
return
|
||||||
|
|
||||||
# Force garbage collection.
|
# Force garbage collection.
|
||||||
|
@ -159,11 +158,11 @@ class ProcessSlicedLayersJob(Job):
|
||||||
# This needs some work in LayerData so we can add the new layers instead of recreating the entire mesh.
|
# This needs some work in LayerData so we can add the new layers instead of recreating the entire mesh.
|
||||||
|
|
||||||
if self._abort_requested:
|
if self._abort_requested:
|
||||||
if self._progress:
|
if self._progress_message:
|
||||||
self._progress.hide()
|
self._progress_message.hide()
|
||||||
return
|
return
|
||||||
if self._progress:
|
if self._progress_message:
|
||||||
self._progress.setProgress(progress)
|
self._progress_message.setProgress(progress)
|
||||||
|
|
||||||
# We are done processing all the layers we got from the engine, now create a mesh out of the data
|
# We are done processing all the layers we got from the engine, now create a mesh out of the data
|
||||||
|
|
||||||
|
@ -197,8 +196,8 @@ class ProcessSlicedLayersJob(Job):
|
||||||
layer_mesh = layer_data.build(material_color_map, line_type_brightness)
|
layer_mesh = layer_data.build(material_color_map, line_type_brightness)
|
||||||
|
|
||||||
if self._abort_requested:
|
if self._abort_requested:
|
||||||
if self._progress:
|
if self._progress_message:
|
||||||
self._progress.hide()
|
self._progress_message.hide()
|
||||||
return
|
return
|
||||||
|
|
||||||
# Add LayerDataDecorator to scene node to indicate that the node has layer data
|
# Add LayerDataDecorator to scene node to indicate that the node has layer data
|
||||||
|
@ -216,15 +215,15 @@ class ProcessSlicedLayersJob(Job):
|
||||||
if not settings.getProperty("machine_center_is_zero", "value"):
|
if not settings.getProperty("machine_center_is_zero", "value"):
|
||||||
new_node.setPosition(Vector(-settings.getProperty("machine_width", "value") / 2, 0.0, settings.getProperty("machine_depth", "value") / 2))
|
new_node.setPosition(Vector(-settings.getProperty("machine_width", "value") / 2, 0.0, settings.getProperty("machine_depth", "value") / 2))
|
||||||
|
|
||||||
if self._progress:
|
if self._progress_message:
|
||||||
self._progress.setProgress(100)
|
self._progress_message.setProgress(100)
|
||||||
|
|
||||||
view = Application.getInstance().getController().getActiveView()
|
view = Application.getInstance().getController().getActiveView()
|
||||||
if view.getPluginId() == "LayerView":
|
if view.getPluginId() == "LayerView":
|
||||||
view.resetLayerData()
|
view.resetLayerData()
|
||||||
|
|
||||||
if self._progress:
|
if self._progress_message:
|
||||||
self._progress.hide()
|
self._progress_message.hide()
|
||||||
|
|
||||||
# Clear the unparsed layers. This saves us a bunch of memory if the Job does not get destroyed.
|
# Clear the unparsed layers. This saves us a bunch of memory if the Job does not get destroyed.
|
||||||
self._layers = None
|
self._layers = None
|
||||||
|
@ -234,10 +233,10 @@ class ProcessSlicedLayersJob(Job):
|
||||||
def _onActiveViewChanged(self):
|
def _onActiveViewChanged(self):
|
||||||
if self.isRunning():
|
if self.isRunning():
|
||||||
if Application.getInstance().getController().getActiveView().getPluginId() == "LayerView":
|
if Application.getInstance().getController().getActiveView().getPluginId() == "LayerView":
|
||||||
if not self._progress:
|
if not self._progress_message:
|
||||||
self._progress = Message(catalog.i18nc("@info:status", "Processing Layers"), 0, False, 0, catalog.i18nc("@info:title", "Information"))
|
self._progress_message = Message(catalog.i18nc("@info:status", "Processing Layers"), 0, False, 0, catalog.i18nc("@info:title", "Information"))
|
||||||
if self._progress.getProgress() != 100:
|
if self._progress_message.getProgress() != 100:
|
||||||
self._progress.show()
|
self._progress_message.show()
|
||||||
else:
|
else:
|
||||||
if self._progress:
|
if self._progress_message:
|
||||||
self._progress.hide()
|
self._progress_message.hide()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue