chiark / gitweb /
Added first endstop check (still need to verify if it works)
authordaid <daid303@gmail.com>
Wed, 7 Mar 2012 16:42:36 +0000 (17:42 +0100)
committerdaid <daid303@gmail.com>
Wed, 7 Mar 2012 16:42:36 +0000 (17:42 +0100)
Changed a few messages

SkeinPyPy_NewUI/newui/configWizard.py

index 0995b0685dcadf15b3146dc6556329d1ea87c8b9..50b64523443ba8445382a00e5fb9c85d6756f8e5 100644 (file)
@@ -138,7 +138,7 @@ class FirmwareUpgradePage(InfoPage):
 class UltimakerCheckupPage(InfoPage):\r
        def __init__(self, parent):\r
                super(UltimakerCheckupPage, self).__init__(parent, "Ultimaker Checkup")\r
-               self.AddText('It is a good idea to do a few sanity checks\nnow on your Ultimaker. But you can skip these\nif you know your machine is functional.')\r
+               self.AddText('It is a good idea to do a few sanity checks\nnow on your Ultimaker.\nBut you can skip these if you know your\nmachine 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
@@ -181,15 +181,27 @@ class UltimakerCheckupPage(InfoPage):
 \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
                wx.CallAfter(self.AddProgressText, "Checking endstops")\r
-               if self.DoCommCommandWithTimeout('M119') != "ok x_min:l x_max:l y_min:l y_max:l z_min:l z_max:l":\r
-                       wx.CallAfter(self.AddProgressText, "Error: There is a problem in your endstops!")\r
-                       wx.CallAfter(self.AddProgressText, "Error: One of them seems to be pressed while it shouldn't")\r
+               if not self.DoCommCommandWithTimeout('M119') != "ok x_min:l x_max:l y_min:l y_max:l z_min:l z_max:l":\r
+                       wx.CallAfter(self.AddProgressText, "Error: There is a problem in your endstops!\nOne of them seems to be pressed while it shouldn't\ncheck the cable connections and the switches themselfs.")\r
+                       return\r
+\r
+               wx.CallAfter(self.AddProgressText, "Please press the X end switch in the front left corner.")\r
+               if not self.DoCommCommandAndWaitForReply('M119', "ok x_min:h x_max:l y_min:l y_max:l z_min:l z_max:l"):\r
+                       wx.CallAfter(self.AddProgressText, "Failed to check the x_min endstop!")\r
                        return\r
 \r
                wx.CallAfter(self.AddProgressText, "Done!")\r
                wx.CallAfter(self.GetParent().FindWindowById(wx.ID_FORWARD).Enable)\r
                self.comm.close()\r
        \r
+       def DoCommCommandAndWaitForReply(self, cmd, reply):\r
+               while True:\r
+                       ret = DoCommCommandWithTimeout(cmd)\r
+                       if ret == reply:\r
+                               return True\r
+                       if ret == False:\r
+                               return False\r
+       \r
        def DoCommCommandWithTimeout(self, cmd = None, replyStart = 'ok'):\r
                if cmd != None:\r
                        self.comm.sendCommand(cmd)\r