chiark / gitweb /
Raise head on "pause at Z" so you can flush the nozzle when changing colors.
authordaid303 <daid303@gmail.com>
Thu, 20 Dec 2012 12:32:02 +0000 (13:32 +0100)
committerdaid303 <daid303@gmail.com>
Thu, 20 Dec 2012 12:32:02 +0000 (13:32 +0100)
Cura/gui/firmwareInstall.py
Cura/gui/preview3d.py
Cura/plugins/pauseAtZ.py

index efb791a5cf5bb7cca94968fc6f0e058fdb80ef29..b65a07ca75b0713994cc7068de0fbe3f753bb736 100644 (file)
@@ -12,6 +12,10 @@ from Cura.util import resources
 
 def getDefaultFirmware():
        if profile.getPreference('machine_type') == 'ultimaker':
+               if profile.getPreferenceFloat('extruder_amount') > 1:
+                       return None
+               if profile.getPreference('has_heated_bed') == 'True':
+                       return None
                if sys.platform.startswith('linux'):
                        return resources.getPathForFirmware("ultimaker_115200.hex")
                else:
@@ -21,12 +25,12 @@ def getDefaultFirmware():
 class InstallFirmware(wx.Dialog):
        def __init__(self, filename = None, port = None):
                super(InstallFirmware, self).__init__(parent=None, title="Firmware install", size=(250, 100))
-               if port == None:
+               if port is None:
                        port = profile.getPreference('serial_port')
-               if filename == None:
+               if filename is None:
                        filename = getDefaultFirmware()
-               if filename == None:
-                       wx.MessageBox('Cura does not ship with a default firmware for your machine.', 'Firmware update', wx.OK | wx.ICON_ERROR)
+               if filename is None:
+                       wx.MessageBox('I am sorry, but Cura does not ship with a default firmware for your machine configuration.', 'Firmware update', wx.OK | wx.ICON_ERROR)
                        self.Destroy()
                        return
 
index 9cc852e76628a6e3f4eb7137ff9c71ff98e15f77..527e47bb7f22649d582e25d9cccbfd4b8b713468 100644 (file)
@@ -505,7 +505,7 @@ class PreviewGLCanvas(glcanvas.GLCanvas):
                        p1 = numpy.array(gluUnProject(e.GetX(), self.viewport[1] + self.viewport[3] - e.GetY(), 1, self.modelMatrix, self.projMatrix, self.viewport))
                        cursorZ0 = p0 - (p1 - p0) * (p0[2] / (p1[2] - p0[2]))
                        cursorXY = math.sqrt((cursorZ0[0] * cursorZ0[0]) + (cursorZ0[1] * cursorZ0[1]))
-                       if cursorXY >= radius * 1.1 and cursorXY <= radius * 1.3:
+                       if radius * 1.1 <= cursorXY <= radius * 1.3:
                                self.SetCursor(wx.StockCursor(wx.CURSOR_SIZING))
                        else:
                                self.SetCursor(wx.StockCursor(wx.CURSOR_DEFAULT))
@@ -513,7 +513,7 @@ class PreviewGLCanvas(glcanvas.GLCanvas):
                if e.Dragging() and e.LeftIsDown():
                        if self.dragType == '':
                                #Define the drag type depending on the cursor position.
-                               if cursorXY >= radius * 1.1 and cursorXY <= radius * 1.3 and self.viewMode != 'GCode' and self.viewMode == 'Mixed':
+                               if radius * 1.1 <= cursorXY <= radius * 1.3 and self.viewMode != 'GCode' and self.viewMode != 'Mixed':
                                        self.dragType = 'modelRotate'
                                        self.dragStart = math.atan2(cursorZ0[0], cursorZ0[1])
                                else:
@@ -794,7 +794,7 @@ class PreviewGLCanvas(glcanvas.GLCanvas):
                glTranslate(self.parent.machineCenter.x, self.parent.machineCenter.y, 0)
                
                #Draw the rotate circle
-               if self.parent.objectsMaxV != None and self.viewMode != 'GCode' and self.viewMode == 'Mixed':
+               if self.parent.objectsMaxV is not None and self.viewMode != 'GCode' and self.viewMode != 'Mixed':
                        glDisable(GL_LIGHTING)
                        glDisable(GL_CULL_FACE)
                        glEnable(GL_BLEND)
index 52d190a0c3c74909c82ed1baa6336f55fda26064..4404884aeea99fd10c885e07a880adfd1197ed7a 100644 (file)
@@ -45,6 +45,8 @@ with open(filename, "w") as f:
                                        f.write("G1 E-%f F6000\n" % (retractAmount))
                                        #Move the head away
                                        f.write("G1 X%f Y%f F9000\n" % (parkX, parkY))
+                                       if z < 15:
+                                               f.write("G1 Z15 F300\n")
                                        #Wait till the user continues printing
                                        f.write("M0\n")
                                        #Move the head back