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:
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
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))
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:
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)
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