chiark / gitweb /
Add some more protection against the bug #220
authordaid <daid303@gmail.com>
Thu, 27 Sep 2012 09:08:33 +0000 (11:08 +0200)
committerdaid <daid303@gmail.com>
Thu, 27 Sep 2012 09:08:33 +0000 (11:08 +0200)
Cura/gui/projectPlanner.py

index 1e21b527510e255d4f826b37797eff9db2426f6c..ac231637c3be0840122cfb51ecffd351c432b8fa 100644 (file)
@@ -603,7 +603,7 @@ class projectPlanner(wx.Frame):
                                action.temperature = profile.getProfileSettingFloat('print_temperature')\r
                                action.extruder = item.extruder\r
                                action.filename = item.filename\r
-                               clearZ = max(clearZ, item.getMaximum()[2] * item.scale + 5.0)\r
+                               clearZ = max(clearZ, item.getSize()[2] * item.scale + 5.0)\r
                                action.clearZ = clearZ\r
                                action.leaveResultForNextSlice = False\r
                                action.usePreviousSlice = False\r
@@ -637,6 +637,7 @@ class projectPlanner(wx.Frame):
                        action.clearZ = 0\r
                        action.leaveResultForNextSlice = False\r
                        action.usePreviousSlice = False\r
+\r
                        actionList.append(action)\r
                        \r
                #Restore the old profile.\r
@@ -1011,7 +1012,7 @@ class ProjectSliceProgressWindow(wx.Frame):
                        wx.CallAfter(self.progressGauge2.SetValue, self.actionList.index(action) + 1)\r
                \r
                resultFile.write(';TYPE:CUSTOM\n')\r
-               if len(self.actionList) > 1:\r
+               if len(self.actionList) > 1 and self.actionList[-1].clearZ > 1:\r
                        #only move to higher Z if we have sliced more then 1 object. This solves the "move into print after printing" problem with the print-all-at-once option.\r
                        resultFile.write('G1 Z%f F%f\n' % (self.actionList[-1].clearZ, profile.getProfileSettingFloat('max_z_speed') * 60))\r
                resultFile.write(profile.getAlterationFileContents('end.gcode'))\r