def connect(self, port = 'COM3', speed = 115200):\r
if self.serial != None:\r
self.close()\r
- self.serial = Serial(port, speed, timeout=1)\r
+ try:\r
+ self.serial = Serial(port, speed, timeout=1)\r
+ except Serial.SerialException as e:\r
+ raise ispBase.IspError("Failed to open serial port")\r
self.seq = 1\r
\r
#Reset the controller\r
def ifSettingAboveZero(name):
return lambda setting: float(getProfileSetting(name, '0.0')) > 0
-def ifSettingIs(name, value):
- return lambda setting: getProfileSetting(name) == value
+def ifSettingIs(name, value, default):
+ return lambda setting: getProfileSetting(name, default) == value
def storedPercentSetting(name):
return lambda setting: float(getProfileSetting(name, setting.value)) / 100
'Infill_Begin_Rotation_degrees': DEFSET,
'Infill_Begin_Rotation_Repeat_layers': DEFSET,
'Infill_Odd_Layer_Extra_Rotation_degrees': DEFSET,
- 'Grid_Circular': ifSettingIs('infill_type', 'Grid Circular'),
- 'Grid_Hexagonal': ifSettingIs('infill_type', 'Grid Hexagonal'),
- 'Grid_Rectangular': ifSettingIs('infill_type', 'Grid Rectangular'),
- 'Line': ifSettingIs('infill_type', 'Line'),
+ 'Grid_Circular': ifSettingIs('infill_type', 'Grid Circular', 'Line'),
+ 'Grid_Hexagonal': ifSettingIs('infill_type', 'Grid Hexagonal', 'Line'),
+ 'Grid_Rectangular': ifSettingIs('infill_type', 'Grid Rectangular', 'Line'),
+ 'Line': ifSettingIs('infill_type', 'Line', 'Line'),
'Infill_Perimeter_Overlap_ratio': DEFSET,
'Infill_Solidity_ratio': storedPercentSetting('fill_density'),
'Infill_Width': storedSetting("nozzle_size"),
\r
wx.CallAfter(self.AddProgressText, "Disabling step motors...")\r
if self.DoCommCommandWithTimeout('M84') == False:\r
- wx.CallAfter(self.AddProgressText, "Error: Missing reply to M84.")\r
+ wx.CallAfter(self.AddProgressText, "Error: Missing reply to Deactivate steppers (M84).")\r
+ wx.CallAfter(self.AddProgressText, "Possible cause: Temperature MIN/MAX.\nCheck temperature sensor connections.")\r
return\r
\r
wx.MessageBox('Please move the printer head to the center of the machine\nalso move the platform so it is not at the highest or lowest position,\nand make sure the machine is powered on.', 'Machine check', wx.OK | wx.ICON_INFORMATION)\r
idleTemp = self.readTemp()\r
\r
wx.CallAfter(self.AddProgressText, "Checking heater and temperature sensor...")\r
+ wx.CallAfter(self.AddProgressText, "(This takes about 30 seconds)")\r
if self.DoCommCommandWithTimeout("M104 S100") == False:\r
wx.CallAfter(self.AddProgressText, "Failed to set temperature")\r
return\r
\r
- time.sleep(20)\r
+ time.sleep(25)\r
tempInc = self.readTemp() - idleTemp\r
\r
if self.DoCommCommandWithTimeout("M104 S0") == False:\r
wx.CallAfter(self.AddProgressText, "Failed to set temperature")\r
return\r
\r
- if tempInc < 20:\r
+ if tempInc < 15:\r
wx.CallAfter(self.AddProgressText, "Your temperature sensor or heater is not working!")\r
return\r
wx.CallAfter(self.AddProgressText, "Heater and temperature sensor working\nWarning: head might still be hot!")\r
def StoreData(self):\r
settings.putProfileSetting('filament_diameter', self.filamentDiameter.GetValue())\r
\r
+class UltimakerCalibrateStepsPerEPage(InfoPage):\r
+ def __init__(self, parent):\r
+ super(UltimakerCalibrateStepsPerEPage, self).__init__(parent, "Ultimaker Calibration")\r
+ \r
+ self.AddText("Calibrating the Steps Per E requires some manual actions.")\r
+ self.AddText("First remove any filament from your machine.")\r
+ self.AddText("Next put in your filament so the tip is aligned with the\ntop of the extruder drive.")\r
+ self.AddText("We'll push the filament 100mm")\r
+ self.AddText("[BUTTON:PUSH 100mm]")\r
+ self.AddText("Now measure the amount of extruded filament:\n(this can be more or less then 100mm)")\r
+ self.AddText("[INPUT:MEASUREMENT][BUTTON:SAVE]")\r
+ self.AddText("This results in the following steps per E:")\r
+ self.AddText("[INPUT:E_RESULT]")\r
+ self.AddText("You can repeat these steps to get better calibration.")\r
+\r
class configWizard(wx.wizard.Wizard):\r
def __init__(self):\r
super(configWizard, self).__init__(None, -1, "Configuration Wizard")\r
\r
self.Bind(wx.wizard.EVT_WIZARD_PAGE_CHANGED, self.OnPageChanged)\r
self.Bind(wx.wizard.EVT_WIZARD_PAGE_CHANGING, self.OnPageChanging)\r
- \r
+\r
self.firstInfoPage = FirstInfoPage(self)\r
self.machineSelectPage = MachineSelectPage(self)\r
self.ultimakerFirmwareUpgradePage = FirmwareUpgradePage(self)\r
self.ultimakerCheckupPage = UltimakerCheckupPage(self)\r
self.ultimakerCalibrationPage = UltimakerCalibrationPage(self)\r
+ self.ultimakerCalibrateStepsPerEPage = UltimakerCalibrateStepsPerEPage(self)\r
self.repRapInfoPage = RepRapInfoPage(self)\r
- \r
+\r
wx.wizard.WizardPageSimple.Chain(self.firstInfoPage, self.machineSelectPage)\r
wx.wizard.WizardPageSimple.Chain(self.machineSelectPage, self.ultimakerFirmwareUpgradePage)\r
wx.wizard.WizardPageSimple.Chain(self.ultimakerFirmwareUpgradePage, self.ultimakerCheckupPage)\r
wx.wizard.WizardPageSimple.Chain(self.ultimakerCheckupPage, self.ultimakerCalibrationPage)\r
+ wx.wizard.WizardPageSimple.Chain(self.ultimakerCalibrationPage, self.ultimakerCalibrateStepsPerEPage)\r
\r
self.FitToPage(self.firstInfoPage)\r
self.GetPageAreaSizer().Add(self.firstInfoPage)\r
i+=1
except:
pass
- return baselist+glob.glob('/dev/ttyUSB*') + glob.glob('/dev/ttyACM*') +glob.glob("/dev/tty.*")+glob.glob("/dev/cu.*")+glob.glob("/dev/rfcomm*")
+ return baselist+glob.glob('/dev/ttyUSB*') + glob.glob('/dev/ttyACM*') +glob.glob("/dev/tty.usb*")+glob.glob("/dev/cu.*")+glob.glob("/dev/rfcomm*")
class InstallFirmware(wx.Dialog):
def __init__(self, filename, port = 'AUTO'):
for self.port in serialList():
try:
programmer.connect(self.port)
+ break
except ispBase.IspError:
pass
else:
programmer.connect(port)
programmer.close()
self.serial = Serial(port, baudrate, timeout=5)
+ break
except ispBase.IspError:
pass
programmer.close()
def main():
app = wx.App(False)
+ if settings.getPreference('wizardDone', 'False') == 'False':
+ configWizard.configWizard()
+ settings.putPreference("wizardDone", "True")
mainWindow()
app.MainLoop()
wx.EVT_CLOSE(self, self.OnClose)
- if settings.getPreference('wizardDone', 'False') == 'False':
- configWizard.configWizard()
-
menubar = wx.MenuBar()
fileMenu = wx.Menu()
i = fileMenu.Append(-1, 'Open Profile...')
if path['layerNr'] != self.parent.layerSpin.GetValue():\r
if path['layerNr'] < self.parent.layerSpin.GetValue():\r
c = 0.5 - (self.parent.layerSpin.GetValue() - path['layerNr']) * 0.1\r
- if c < -0.5:\r
- continue\r
if c < 0.1:\r
c = 0.1\r
else:\r
glColor3f(c,0,0)\r
if path['type'] == 'retract':\r
glColor3f(0,c,c)\r
- if path['type'] == 'extrude':\r
+ if c > 0.1 and path['type'] == 'extrude':\r
if path['pathType'] == 'FILL':\r
lineWidth = self.fillLineWidth / 2\r
else:\r
"""
from __future__ import absolute_import
+import __init__
import sys
import platform