Erase gcode of build plates that are determined to be empty

You don't want to start a new slice, but you should still erase the g-code there.

Contributes to issue CURA-4525.
This commit is contained in:
Ghostkeeper 2018-01-05 13:34:39 +01:00
parent fefb20deb7
commit a8ad956c92
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A

View file

@ -206,12 +206,16 @@ class CuraEngineBackend(QObject, Backend):
Logger.log("d", " ## Process layers job still busy, trying later")
return
if not hasattr(self._scene, "gcode_list"):
self._scene.gcode_list = {}
# see if we really have to slice
active_build_plate = Application.getInstance().getBuildPlateModel().activeBuildPlate
build_plate_to_be_sliced = self._build_plates_to_be_sliced.pop(0)
Logger.log("d", "Going to slice build plate [%s]!" % build_plate_to_be_sliced)
num_objects = self._numObjects()
if build_plate_to_be_sliced not in num_objects or num_objects[build_plate_to_be_sliced] == 0:
self._scene.gcode_list[build_plate_to_be_sliced] = []
Logger.log("d", "Build plate %s has 0 objects to be sliced, skipping", build_plate_to_be_sliced)
return
@ -229,8 +233,6 @@ class CuraEngineBackend(QObject, Backend):
self.processingProgress.emit(0.0)
self.backendStateChange.emit(BackendState.NotStarted)
if not hasattr(self._scene, "gcode_list"):
self._scene.gcode_list = {}
self._scene.gcode_list[build_plate_to_be_sliced] = [] #[] indexed by build plate number
self._slicing = True
self.slicingStarted.emit()