+# coding=utf-8\r
from __future__ import absolute_import\r
-import __init__\r
\r
-import wx, os, platform, types, webbrowser, threading, time, re\r
+import webbrowser\r
+import threading\r
+import time\r
+\r
+import wx\r
import wx.wizard\r
\r
from gui import firmwareInstall\r
from gui import printWindow\r
from util import machineCom\r
from util import profile\r
+from util.resources import getPathForImage\r
\r
class InfoBox(wx.Panel):\r
def __init__(self, parent):\r
super(InfoBox, self).__init__(parent)\r
self.SetBackgroundColour('#FFFF80')\r
- \r
+\r
self.sizer = wx.GridBagSizer(5, 5)\r
self.SetSizer(self.sizer)\r
- \r
- self.attentionBitmap = toolbarUtil.getBitmapImage('attention.png')\r
- self.errorBitmap = toolbarUtil.getBitmapImage('error.png')\r
- self.readyBitmap = toolbarUtil.getBitmapImage('ready.png')\r
- self.busyBitmap = [toolbarUtil.getBitmapImage('busy-0.png'), toolbarUtil.getBitmapImage('busy-1.png'), toolbarUtil.getBitmapImage('busy-2.png'), toolbarUtil.getBitmapImage('busy-3.png')]\r
- \r
+\r
+ self.attentionBitmap = wx.Bitmap(getPathForImage('attention.png'))\r
+ self.errorBitmap = wx.Bitmap(getPathForImage('error.png'))\r
+ self.readyBitmap = wx.Bitmap(getPathForImage('ready.png'))\r
+ self.busyBitmap = [\r
+ wx.Bitmap(getPathForImage('busy-0.png')),\r
+ wx.Bitmap(getPathForImage('busy-1.png')),\r
+ wx.Bitmap(getPathForImage('busy-2.png')),\r
+ wx.Bitmap(getPathForImage('busy-3.png'))\r
+ ]\r
+\r
self.bitmap = wx.StaticBitmap(self, -1, wx.EmptyBitmapRGBA(24, 24, red=255, green=255, blue=255, alpha=1))\r
self.text = wx.StaticText(self, -1, '')\r
self.extraInfoButton = wx.Button(self, -1, 'i', style=wx.BU_EXACTFIT)\r
- self.sizer.Add(self.bitmap, pos=(0,0), flag=wx.ALL, border=5)\r
- self.sizer.Add(self.text, pos=(0,1), flag=wx.TOP|wx.BOTTOM|wx.ALIGN_CENTER_VERTICAL, border=5)\r
+ self.sizer.Add(self.bitmap, pos=(0, 0), flag=wx.ALL, border=5)\r
+ self.sizer.Add(self.text, pos=(0, 1), flag=wx.TOP | wx.BOTTOM | wx.ALIGN_CENTER_VERTICAL, border=5)\r
self.sizer.Add(self.extraInfoButton, pos=(0,2), flag=wx.ALL|wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, border=5)\r
self.sizer.AddGrowableCol(1)\r
- \r
+\r
self.extraInfoButton.Show(False)\r
- \r
+\r
self.extraInfoUrl = ''\r
self.busyState = None\r
self.timer = wx.Timer(self)\r
self.Layout()\r
self.SetErrorIndicator()\r
self.Refresh()\r
- \r
+\r
def SetAttention(self, info):\r
self.SetBackgroundColour('#FFFF80')\r
self.text.SetLabel(info)\r
self.extraInfoButton.Show(False)\r
self.SetAttentionIndicator()\r
self.Refresh()\r
- \r
+\r
def SetBusyIndicator(self):\r
self.busyState = 0\r
self.bitmap.SetBitmap(self.busyBitmap[self.busyState])\r
- \r
+\r
+ def doExtraInfo(self, e):\r
+ webbrowser.open(self.extraInfoUrl)\r
+\r
def doBusyUpdate(self, e):\r
if self.busyState == None:\r
return\r
if self.busyState >= len(self.busyBitmap):\r
self.busyState = 0\r
self.bitmap.SetBitmap(self.busyBitmap[self.busyState])\r
- \r
- def doExtraInfo(self, e):\r
- webbrowser.open(self.extraInfoUrl)\r
- \r
+\r
def SetReadyIndicator(self):\r
self.busyState = None\r
self.bitmap.SetBitmap(self.readyBitmap)\r
- \r
+\r
def SetErrorIndicator(self):\r
self.busyState = None\r
self.bitmap.SetBitmap(self.errorBitmap)\r
- \r
+\r
def SetAttentionIndicator(self):\r
self.busyState = None\r
self.bitmap.SetBitmap(self.attentionBitmap)\r
\r
+\r
class InfoPage(wx.wizard.WizardPageSimple):\r
def __init__(self, parent, title):\r
wx.wizard.WizardPageSimple.__init__(self, parent)\r
\r
title = wx.StaticText(self, -1, title)\r
title.SetFont(wx.Font(18, wx.SWISS, wx.NORMAL, wx.BOLD))\r
- sizer.Add(title, pos=(0, 0), span=(1,2), flag=wx.ALIGN_CENTRE|wx.ALL)\r
- sizer.Add(wx.StaticLine(self, -1), pos=(1,0), span=(1,2), flag=wx.EXPAND|wx.ALL)\r
+ sizer.Add(title, pos=(0, 0), span=(1, 2), flag=wx.ALIGN_CENTRE | wx.ALL)\r
+ sizer.Add(wx.StaticLine(self, -1), pos=(1, 0), span=(1, 2), flag=wx.EXPAND | wx.ALL)\r
sizer.AddGrowableCol(1)\r
- \r
+\r
self.rowNr = 2\r
- \r
- def AddText(self,info):\r
+\r
+ def AddText(self, info):\r
text = wx.StaticText(self, -1, info)\r
- self.GetSizer().Add(text, pos=(self.rowNr, 0), span=(1,2), flag=wx.LEFT|wx.RIGHT)\r
+ self.GetSizer().Add(text, pos=(self.rowNr, 0), span=(1, 2), flag=wx.LEFT | wx.RIGHT)\r
self.rowNr += 1\r
return text\r
- \r
+\r
def AddSeperator(self):\r
- self.GetSizer().Add(wx.StaticLine(self, -1), pos=(self.rowNr, 0), span=(1,2), flag=wx.EXPAND|wx.ALL)\r
+ self.GetSizer().Add(wx.StaticLine(self, -1), pos=(self.rowNr, 0), span=(1, 2), flag=wx.EXPAND | wx.ALL)\r
self.rowNr += 1\r
- \r
+\r
def AddHiddenSeperator(self):\r
self.AddText('')\r
\r
def AddInfoBox(self):\r
infoBox = InfoBox(self)\r
- self.GetSizer().Add(infoBox, pos=(self.rowNr, 0), span=(1,2), flag=wx.LEFT|wx.RIGHT|wx.EXPAND)\r
+ self.GetSizer().Add(infoBox, pos=(self.rowNr, 0), span=(1, 2), flag=wx.LEFT | wx.RIGHT | wx.EXPAND)\r
self.rowNr += 1\r
return infoBox\r
- \r
- def AddRadioButton(self, label, style = 0):\r
+\r
+ def AddRadioButton(self, label, style=0):\r
radio = wx.RadioButton(self, -1, label, style=style)\r
- self.GetSizer().Add(radio, pos=(self.rowNr, 0), span=(1,2), flag=wx.EXPAND|wx.ALL)\r
+ self.GetSizer().Add(radio, pos=(self.rowNr, 0), span=(1, 2), flag=wx.EXPAND | wx.ALL)\r
self.rowNr += 1\r
return radio\r
\r
- def AddCheckbox(self, label, checked = False):\r
+ def AddCheckbox(self, label, checked=False):\r
check = wx.CheckBox(self, -1)\r
text = wx.StaticText(self, -1, label)\r
check.SetValue(checked)\r
- self.GetSizer().Add(text, pos=(self.rowNr, 0), span=(1,1), flag=wx.LEFT|wx.RIGHT)\r
- self.GetSizer().Add(check, pos=(self.rowNr, 1), span=(1,2), flag=wx.ALL)\r
+ self.GetSizer().Add(text, pos=(self.rowNr, 0), span=(1, 1), flag=wx.LEFT | wx.RIGHT)\r
+ self.GetSizer().Add(check, pos=(self.rowNr, 1), span=(1, 2), flag=wx.ALL)\r
self.rowNr += 1\r
return check\r
- \r
+\r
def AddButton(self, label):\r
button = wx.Button(self, -1, label)\r
- self.GetSizer().Add(button, pos=(self.rowNr, 0), span=(1,2), flag=wx.LEFT)\r
+ self.GetSizer().Add(button, pos=(self.rowNr, 0), span=(1, 2), flag=wx.LEFT)\r
self.rowNr += 1\r
return button\r
- \r
+\r
def AddDualButton(self, label1, label2):\r
button1 = wx.Button(self, -1, label1)\r
self.GetSizer().Add(button1, pos=(self.rowNr, 0), flag=wx.RIGHT)\r
self.GetSizer().Add(button2, pos=(self.rowNr, 1))\r
self.rowNr += 1\r
return button1, button2\r
- \r
+\r
def AddTextCtrl(self, value):\r
ret = wx.TextCtrl(self, -1, value)\r
- self.GetSizer().Add(ret, pos=(self.rowNr, 0), span=(1,2), flag=wx.LEFT)\r
+ self.GetSizer().Add(ret, pos=(self.rowNr, 0), span=(1, 2), flag=wx.LEFT)\r
self.rowNr += 1\r
return ret\r
\r
def AddLabelTextCtrl(self, info, value):\r
text = wx.StaticText(self, -1, info)\r
ret = wx.TextCtrl(self, -1, value)\r
- self.GetSizer().Add(text, pos=(self.rowNr, 0), span=(1,1), flag=wx.LEFT)\r
- self.GetSizer().Add(ret, pos=(self.rowNr, 1), span=(1,1), flag=wx.LEFT)\r
+ self.GetSizer().Add(text, pos=(self.rowNr, 0), span=(1, 1), flag=wx.LEFT)\r
+ self.GetSizer().Add(ret, pos=(self.rowNr, 1), span=(1, 1), flag=wx.LEFT)\r
self.rowNr += 1\r
return ret\r
- \r
+\r
def AddTextCtrlButton(self, value, buttonText):\r
text = wx.TextCtrl(self, -1, value)\r
button = wx.Button(self, -1, buttonText)\r
- self.GetSizer().Add(text, pos=(self.rowNr, 0), span=(1,1), flag=wx.LEFT)\r
- self.GetSizer().Add(button, pos=(self.rowNr, 1), span=(1,1), flag=wx.LEFT)\r
+ self.GetSizer().Add(text, pos=(self.rowNr, 0), span=(1, 1), flag=wx.LEFT)\r
+ self.GetSizer().Add(button, pos=(self.rowNr, 1), span=(1, 1), flag=wx.LEFT)\r
self.rowNr += 1\r
return text, button\r
\r
def AddBitmap(self, bitmap):\r
bitmap = wx.StaticBitmap(self, -1, bitmap)\r
- self.GetSizer().Add(bitmap, pos=(self.rowNr, 0), span=(1,2), flag=wx.LEFT|wx.RIGHT)\r
+ self.GetSizer().Add(bitmap, pos=(self.rowNr, 0), span=(1, 2), flag=wx.LEFT | wx.RIGHT)\r
self.rowNr += 1\r
return bitmap\r
\r
def AddCheckmark(self, label, bitmap):\r
check = wx.StaticBitmap(self, -1, bitmap)\r
text = wx.StaticText(self, -1, label)\r
- self.GetSizer().Add(text, pos=(self.rowNr, 0), span=(1,1), flag=wx.LEFT|wx.RIGHT)\r
- self.GetSizer().Add(check, pos=(self.rowNr, 1), span=(1,1), flag=wx.ALL)\r
+ self.GetSizer().Add(text, pos=(self.rowNr, 0), span=(1, 1), flag=wx.LEFT | wx.RIGHT)\r
+ self.GetSizer().Add(check, pos=(self.rowNr, 1), span=(1, 1), flag=wx.ALL)\r
self.rowNr += 1\r
return check\r
- \r
+\r
def AllowNext(self):\r
return True\r
- \r
+\r
def StoreData(self):\r
pass\r
\r
+\r
class FirstInfoPage(InfoPage):\r
def __init__(self, parent):\r
super(FirstInfoPage, self).__init__(parent, "First time run wizard")\r
self.AddText('* Configure Cura for your machine')\r
self.AddText('* Upgrade your firmware')\r
self.AddText('* Check if your machine is working safely')\r
+\r
#self.AddText('* Calibrate your machine')\r
#self.AddText('* Do your first print')\r
\r
+\r
class RepRapInfoPage(InfoPage):\r
def __init__(self, parent):\r
super(RepRapInfoPage, self).__init__(parent, "RepRap information")\r
- self.AddText('RepRap machines are vastly different, and there is no\ndefault configuration in Cura for any of them.')\r
+ self.AddText(\r
+ 'RepRap machines are vastly different, and there is no\ndefault configuration in Cura for any of them.')\r
self.AddText('If you like a default profile for your machine added,\nthen make an issue on github.')\r
self.AddSeperator()\r
self.AddText('You will have to manually install Marlin or Sprinter firmware.')\r
profile.putProfileSetting('wall_thickness', float(profile.getProfileSettingFloat('nozzle_size')) * 2)\r
profile.putPreference('has_heated_bed', str(self.heatedBed.GetValue()))\r
\r
+\r
class MachineSelectPage(InfoPage):\r
def __init__(self, parent):\r
super(MachineSelectPage, self).__init__(parent, "Select your machine")\r
self.UltimakerRadio.Bind(wx.EVT_RADIOBUTTON, self.OnUltimakerSelect)\r
self.OtherRadio = self.AddRadioButton("Other (Ex: RepRap)")\r
self.OtherRadio.Bind(wx.EVT_RADIOBUTTON, self.OnOtherSelect)\r
- \r
+\r
def OnUltimakerSelect(self, e):\r
wx.wizard.WizardPageSimple.Chain(self, self.GetParent().ultimakerFirmwareUpgradePage)\r
- \r
+\r
def OnOtherSelect(self, e):\r
wx.wizard.WizardPageSimple.Chain(self, self.GetParent().repRapInfoPage)\r
- \r
+\r
def StoreData(self):\r
if self.UltimakerRadio.GetValue():\r
profile.putPreference('machine_width', '205')\r
profile.putProfileSetting('nozzle_size', '0.5')\r
profile.putProfileSetting('wall_thickness', float(profile.getProfileSetting('nozzle_size')) * 2)\r
\r
+\r
class SelectParts(InfoPage):\r
def __init__(self, parent):\r
super(SelectParts, self).__init__(parent, "Select upgraded parts you have")\r
if getPreference('ultimaker_extruder_upgrade') == 'True':\r
putProfileSetting('retraction_enable', 'True')\r
\r
+\r
class FirmwareUpgradePage(InfoPage):\r
def __init__(self, parent):\r
super(FirmwareUpgradePage, self).__init__(parent, "Upgrade Ultimaker Firmware")\r
- self.AddText('Firmware is the piece of software running directly on your 3D printer.\nThis firmware controls the step motors, regulates the temperature\nand ultimately makes your printer work.')\r
+ self.AddText(\r
+ 'Firmware is the piece of software running directly on your 3D printer.\nThis firmware controls the step motors, regulates the temperature\nand ultimately makes your printer work.')\r
self.AddHiddenSeperator()\r
- self.AddText('The firmware shipping with new Ultimakers works, but upgrades\nhave been made to make better prints, and make calibration easier.')\r
+ self.AddText(\r
+ 'The firmware shipping with new Ultimakers works, but upgrades\nhave been made to make better prints, and make calibration easier.')\r
self.AddHiddenSeperator()\r
- self.AddText('Cura requires these new features and thus\nyour firmware will most likely need to be upgraded.\nYou will get the chance to do so now.')\r
+ self.AddText(\r
+ 'Cura requires these new features and thus\nyour firmware will most likely need to be upgraded.\nYou will get the chance to do so now.')\r
upgradeButton, skipUpgradeButton = self.AddDualButton('Upgrade to Marlin firmware', 'Skip upgrade')\r
upgradeButton.Bind(wx.EVT_BUTTON, self.OnUpgradeClick)\r
skipUpgradeButton.Bind(wx.EVT_BUTTON, self.OnSkipClick)\r
self.AddText('* Have other changes in the firmware')\r
button = self.AddButton('Goto this page for a custom firmware')\r
button.Bind(wx.EVT_BUTTON, self.OnUrlClick)\r
- \r
+\r
def AllowNext(self):\r
return False\r
- \r
+\r
def OnUpgradeClick(self, e):\r
if firmwareInstall.InstallFirmware():\r
self.GetParent().FindWindowById(wx.ID_FORWARD).Enable()\r
- \r
+\r
def OnSkipClick(self, e):\r
self.GetParent().FindWindowById(wx.ID_FORWARD).Enable()\r
- \r
+\r
def OnUrlClick(self, e):\r
webbrowser.open('http://daid.mine.nu/~daid/marlin_build/')\r
\r
+\r
class UltimakerCheckupPage(InfoPage):\r
def __init__(self, parent):\r
super(UltimakerCheckupPage, self).__init__(parent, "Ultimaker Checkup")\r
\r
- self.checkBitmap = toolbarUtil.getBitmapImage('checkmark.png')\r
- self.crossBitmap = toolbarUtil.getBitmapImage('cross.png')\r
- self.unknownBitmap = toolbarUtil.getBitmapImage('question.png')\r
- self.endStopNoneBitmap = toolbarUtil.getBitmapImage('endstop_none.png')\r
- self.endStopXMinBitmap = toolbarUtil.getBitmapImage('endstop_xmin.png')\r
- self.endStopXMaxBitmap = toolbarUtil.getBitmapImage('endstop_xmax.png')\r
- self.endStopYMinBitmap = toolbarUtil.getBitmapImage('endstop_ymin.png')\r
- self.endStopYMaxBitmap = toolbarUtil.getBitmapImage('endstop_ymax.png')\r
- self.endStopZMinBitmap = toolbarUtil.getBitmapImage('endstop_zmin.png')\r
- self.endStopZMaxBitmap = toolbarUtil.getBitmapImage('endstop_zmax.png')\r
-\r
- self.AddText('It is a good idea to do a few sanity checks now on your Ultimaker.\nYou can skip these if you know your machine is functional.')\r
+ self.checkBitmap = wx.Bitmap(getPathForImage('checkmark.png'))\r
+ self.crossBitmap = wx.Bitmap(getPathForImage('cross.png'))\r
+ self.unknownBitmap = wx.Bitmap(getPathForImage('question.png'))\r
+ self.endStopNoneBitmap = wx.Bitmap(getPathForImage('endstop_none.png'))\r
+ self.endStopXMinBitmap = wx.Bitmap(getPathForImage('endstop_xmin.png'))\r
+ self.endStopXMaxBitmap = wx.Bitmap(getPathForImage('endstop_xmax.png'))\r
+ self.endStopYMinBitmap = wx.Bitmap(getPathForImage('endstop_ymin.png'))\r
+ self.endStopYMaxBitmap = wx.Bitmap(getPathForImage('endstop_ymax.png'))\r
+ self.endStopZMinBitmap = wx.Bitmap(getPathForImage('endstop_zmin.png'))\r
+ self.endStopZMaxBitmap = wx.Bitmap(getPathForImage('endstop_zmax.png'))\r
+\r
+ self.AddText(\r
+ 'It is a good idea to do a few sanity checks now on your Ultimaker.\nYou can skip these if you know your machine is functional.')\r
b1, b2 = self.AddDualButton('Run checks', 'Skip checks')\r
b1.Bind(wx.EVT_BUTTON, self.OnCheckClick)\r
b2.Bind(wx.EVT_BUTTON, self.OnSkipClick)\r
self.yMaxStop = False\r
self.zMinStop = False\r
self.zMaxStop = False\r
- \r
+\r
self.Bind(wx.EVT_BUTTON, self.OnErrorLog, self.errorLogButton)\r
\r
def __del__(self):\r
if self.comm != None:\r
self.comm.close()\r
- \r
+\r
def AllowNext(self):\r
self.endstopBitmap.Show(False)\r
return False\r
- \r
+\r
def OnSkipClick(self, e):\r
self.GetParent().FindWindowById(wx.ID_FORWARD).Enable()\r
- \r
- def OnCheckClick(self, e = None):\r
+\r
+ def OnCheckClick(self, e=None):\r
self.errorLogButton.Show(False)\r
if self.comm != None:\r
self.comm.close()\r
self.stopState.SetBitmap(self.unknownBitmap)\r
self.checkupState = 0\r
self.comm = machineCom.MachineCom(callbackObject=self)\r
- \r
+\r
def OnErrorLog(self, e):\r
printWindow.LogWindow('\n'.join(self.comm.getLog()))\r
\r
wx.CallAfter(self.Layout)\r
else:\r
wx.CallAfter(self.machineState.SetLabel, 'Communication State: %s' % (self.comm.getStateString()))\r
- \r
+\r
def mcMessage(self, message):\r
if self.checkupState >= 3 and self.checkupState < 10 and 'x_min' in message:\r
for data in message.split(' '):\r
if tag == 'z_max':\r
self.zMaxStop = (value == 'H')\r
self.comm.sendCommand('M119')\r
- \r
+\r
if self.checkupState == 3:\r
if not self.xMinStop and not self.xMaxStop and not self.yMinStop and not self.yMaxStop and not self.zMinStop and not self.zMaxStop:\r
self.checkupState = 4\r
\r
def mcProgress(self, lineNr):\r
pass\r
- \r
+\r
def mcZChange(self, newZ):\r
pass\r
\r
+\r
class UltimakerCalibrationPage(InfoPage):\r
def __init__(self, parent):\r
super(UltimakerCalibrationPage, self).__init__(parent, "Ultimaker Calibration")\r
- \r
+\r
self.AddText("Your Ultimaker requires some calibration.")\r
self.AddText("This calibration is needed for a proper extrusion amount.")\r
self.AddSeperator()\r
self.AddSeperator()\r
self.AddText("First we need the diameter of your filament:")\r
self.filamentDiameter = self.AddTextCtrl(profile.getProfileSetting('filament_diameter'))\r
- self.AddText("If you do not own digital Calipers that can measure\nat least 2 digits then use 2.89mm.\nWhich is the average diameter of most filament.")\r
+ self.AddText(\r
+ "If you do not own digital Calipers that can measure\nat least 2 digits then use 2.89mm.\nWhich is the average diameter of most filament.")\r
self.AddText("Note: This value can be changed later at any time.")\r
\r
def StoreData(self):\r
profile.putProfileSetting('filament_diameter', self.filamentDiameter.GetValue())\r
\r
+\r
class UltimakerCalibrateStepsPerEPage(InfoPage):\r
def __init__(self, parent):\r
super(UltimakerCalibrateStepsPerEPage, self).__init__(parent, "Ultimaker Calibration")\r
\r
if profile.getPreference('steps_per_e') == '0':\r
profile.putPreference('steps_per_e', '865.888')\r
- \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.stepsPerEInput = self.AddTextCtrl(profile.getPreference('steps_per_e'))\r
self.AddText("You can repeat these steps to get better calibration.")\r
self.AddSeperator()\r
- self.AddText("If you still have filament in your printer which needs\nheat to remove, press the heat up button below:")\r
+ self.AddText(\r
+ "If you still have filament in your printer which needs\nheat to remove, press the heat up button below:")\r
self.heatButton = self.AddButton("Heatup for filament removal")\r
- \r
+\r
self.saveLengthButton.Bind(wx.EVT_BUTTON, self.OnSaveLengthClick)\r
self.extrudeButton.Bind(wx.EVT_BUTTON, self.OnExtrudeClick)\r
self.heatButton.Bind(wx.EVT_BUTTON, self.OnHeatClick)\r
- \r
+\r
def OnSaveLengthClick(self, e):\r
currentEValue = float(self.stepsPerEInput.GetValue())\r
realExtrudeLength = float(self.lengthInput.GetValue())\r
newEValue = currentEValue * 100 / realExtrudeLength\r
self.stepsPerEInput.SetValue(str(newEValue))\r
self.lengthInput.SetValue("100")\r
- \r
+\r
def OnExtrudeClick(self, e):\r
threading.Thread(target=self.OnExtrudeRun).start()\r
\r
currentEValue = float(self.stepsPerEInput.GetValue())\r
self.comm = machineCom.MachineCom()\r
if not self.comm.isOpen():\r
- wx.MessageBox("Error: Failed to open serial port to machine\nIf this keeps happening, try disconnecting and reconnecting the USB cable", 'Printer error', wx.OK | wx.ICON_INFORMATION)\r
+ wx.MessageBox(\r
+ "Error: Failed to open serial port to machine\nIf this keeps happening, try disconnecting and reconnecting the USB cable",\r
+ 'Printer error', wx.OK | wx.ICON_INFORMATION)\r
self.heatButton.Enable(True)\r
self.extrudeButton.Enable(True)\r
return\r
return\r
if 'start' in line:\r
break\r
- #Wait 3 seconds for the SD card init to timeout if we have SD in our firmware but there is no SD card found.\r
+ #Wait 3 seconds for the SD card init to timeout if we have SD in our firmware but there is no SD card found.\r
time.sleep(3)\r
- \r
+\r
self.sendGCommand('M302') #Disable cold extrusion protection\r
self.sendGCommand("M92 E%f" % (currentEValue))\r
self.sendGCommand("G92 E0")\r
\r
def OnHeatClick(self, e):\r
threading.Thread(target=self.OnHeatRun).start()\r
- \r
+\r
def OnHeatRun(self):\r
self.heatButton.Enable(False)\r
self.extrudeButton.Enable(False)\r
self.comm = machineCom.MachineCom()\r
if not self.comm.isOpen():\r
- wx.MessageBox("Error: Failed to open serial port to machine\nIf this keeps happening, try disconnecting and reconnecting the USB cable", 'Printer error', wx.OK | wx.ICON_INFORMATION)\r
+ wx.MessageBox(\r
+ "Error: Failed to open serial port to machine\nIf this keeps happening, try disconnecting and reconnecting the USB cable",\r
+ 'Printer error', wx.OK | wx.ICON_INFORMATION)\r
self.heatButton.Enable(True)\r
self.extrudeButton.Enable(True)\r
return\r
return\r
if 'start' in line:\r
break\r
- #Wait 3 seconds for the SD card init to timeout if we have SD in our firmware but there is no SD card found.\r
+ #Wait 3 seconds for the SD card init to timeout if we have SD in our firmware but there is no SD card found.\r
time.sleep(3)\r
- \r
+\r
self.sendGCommand('M104 S200') #Set the temperature to 200C, should be enough to get PLA and ABS out.\r
- wx.MessageBox('Wait till you can remove the filament from the machine, and press OK.\n(Temperature is set to 200C)', 'Machine heatup', wx.OK | wx.ICON_INFORMATION)\r
+ wx.MessageBox(\r
+ 'Wait till you can remove the filament from the machine, and press OK.\n(Temperature is set to 200C)',\r
+ 'Machine heatup', wx.OK | wx.ICON_INFORMATION)\r
self.sendGCommand('M104 S0')\r
time.sleep(1)\r
self.comm.close()\r
self.heatButton.Enable(True)\r
self.extrudeButton.Enable(True)\r
- \r
+\r
def sendGCommand(self, cmd):\r
self.comm.sendCommand(cmd) #Disable cold extrusion protection\r
while True:\r
return\r
if line.startswith('ok'):\r
break\r
- \r
+\r
def StoreData(self):\r
profile.putPreference('steps_per_e', self.stepsPerEInput.GetValue())\r
\r
+\r
class configWizard(wx.wizard.Wizard):\r
def __init__(self):\r
super(configWizard, self).__init__(None, -1, "Configuration Wizard")\r
- \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
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
+\r
self.FitToPage(self.firstInfoPage)\r
self.GetPageAreaSizer().Add(self.firstInfoPage)\r
- \r
+\r
self.RunWizard(self.firstInfoPage)\r
self.Destroy()\r
\r
\r
def OnPageChanged(self, e):\r
if e.GetPage().AllowNext():\r
- self.FindWindowById(wx.ID_FORWARD).Enable() \r
+ self.FindWindowById(wx.ID_FORWARD).Enable()\r
else:\r
- self.FindWindowById(wx.ID_FORWARD).Disable() \r
- self.FindWindowById(wx.ID_BACKWARD).Disable() \r
+ self.FindWindowById(wx.ID_FORWARD).Disable()\r
+ self.FindWindowById(wx.ID_BACKWARD).Disable()\r