Skip to content

Commit

Permalink
Fix for issue #26
Browse files Browse the repository at this point in the history
This fixes an error reported when saving a project with an AutoTower
  • Loading branch information
kartchnb committed Nov 1, 2022
1 parent 2c1cd9d commit 910fd5c
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions AutoTowersGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,15 +549,21 @@ def _postProcess(self, output_device)->None:
# Retrieve the g-code for the current build plate
active_build_plate_id = CuraApplication.getInstance().getMultiBuildPlateModel().activeBuildPlate
gcode = gcode_dict[active_build_plate_id]
except TypeError:
except (TypeError, KeyError):
# If there is no g-code for the current build plate, there's nothing more to do
return

# Proceed if the g-code has not already been post-processed
if self._gcodeProcessedMarker not in gcode[0]:
try:
# Proceed if the g-code has not already been post-processed
if self._gcodeProcessedMarker not in gcode[0]:

# Mark the g-code as having been post-processed
gcode[0] = gcode[0] + self._gcodeProcessedMarker + '\n'

# Mark the g-code as having been post-processed
gcode[0] = gcode[0] + self._gcodeProcessedMarker + '\n'
# Call the tower controller post-processing callback to modify the g-code
gcode = self._towerControllerPostProcessingCallback(gcode, self.displayOnLcdSetting)
except IndexError:
return

# Call the tower controller post-processing callback to modify the g-code
gcode = self._towerControllerPostProcessingCallback(gcode, self.displayOnLcdSetting)
Message('AutoTowersGenerator post-processing completed', title=self._pluginName).show()

0 comments on commit 910fd5c

Please sign in to comment.