self.stepsPerEInput = wx.TextCtrl(self, -1, settings.getPreference('steps_per_e', '865.888'))\r
self.GetSizer().Add(self.stepsPerEInput, 0, wx.LEFT, 5)\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.heatButton = self.AddButton("Heatup for filament removal")\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
def OnSaveLengthClick(self, e):\r
currentEValue = float(self.stepsPerEInput.GetValue())\r
self.lengthInput.SetValue("100")\r
\r
def OnExtrudeClick(self, e):\r
- threading.Thread(target=self.OnRun).start()\r
+ threading.Thread(target=self.OnExtrudeRun).start()\r
\r
- def OnRun(self):\r
+ def OnExtrudeRun(self):\r
+ self.heatButton.Enable(False)\r
+ self.extrudeButton.Enable(False)\r
currentEValue = float(self.stepsPerEInput.GetValue())\r
self.comm = machineCom.MachineCom()\r
while True:\r
self.sendGCommand("M92 E%f" % (currentEValue));\r
self.sendGCommand("G92 E0");\r
self.sendGCommand("G1 E100 F300");\r
- time.sleep(5)\r
+ time.sleep(10)\r
+ self.comm.close()\r
+ self.extrudeButton.Enable()\r
+ self.heatButton.Enable()\r
+\r
+ def OnHeatClick(self, e):\r
+ threading.Thread(target=self.OnHeatRun).start()\r
+ \r
+ def OnHeatRun(self, e):\r
+ self.comm = machineCom.MachineCom()\r
+ while True:\r
+ line = self.comm.readline()\r
+ if line == '':\r
+ return\r
+ if line.startswith('start'):\r
+ break\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
+ self.sendGCommand('M104 S0')\r
+ time.sleep(1)\r
self.comm.close()\r
\r
def sendGCommand(self, cmd):\r