chiark / gitweb /
Updated the E calibration with a heatup button. Also disable extrude/heat button...
authordaid <daid303@gmail.com>
Thu, 15 Mar 2012 15:31:49 +0000 (16:31 +0100)
committerdaid <daid303@gmail.com>
Thu, 15 Mar 2012 15:31:49 +0000 (16:31 +0100)
SkeinPyPy_NewUI/newui/configWizard.py

index 5c6360dc0d18ca603ef3f1a354f24ad0c736d5ad..60f5682df4d94ce89d43e2805c75bd5af7b67c7b 100644 (file)
@@ -328,9 +328,13 @@ class UltimakerCalibrateStepsPerEPage(InfoPage):
                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
@@ -340,9 +344,11 @@ class UltimakerCalibrateStepsPerEPage(InfoPage):
                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
@@ -355,7 +361,26 @@ class UltimakerCalibrateStepsPerEPage(InfoPage):
                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