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 67a2abd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 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()

2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Auto Towers Generator",
"author": "Brad Kartchner",
"version": "2.4.0",
"version": "2.4.1",
"api": 7,
"supported_sdk_versions": ["7.9.0", "8.0.0", "8.1.0", "8.2.0"],
"description": "Automates the generation of several parameterized calibration models.",
Expand Down

0 comments on commit 67a2abd

Please sign in to comment.