chiark / gitweb /
Make the endstop check in the first run wizard in a better order, and make re-running...
authordaid303 <daid303@gmail.com>
Thu, 8 Nov 2012 09:13:58 +0000 (10:13 +0100)
committerdaid303 <daid303@gmail.com>
Thu, 8 Nov 2012 09:13:58 +0000 (10:13 +0100)
Cura/gui/configWizard.py

index c1ddc96f9c6d8f09799d72701ac32f07af089335..740832f6006c6b6b5110c172e5e823e814f3224f 100644 (file)
@@ -331,10 +331,13 @@ class UltimakerCheckupPage(InfoPage):
        def OnSkipClick(self, e):\r
                self.GetParent().FindWindowById(wx.ID_FORWARD).Enable()\r
        \r
-       def OnCheckClick(self, e):\r
+       def OnCheckClick(self, e = None):\r
                if self.comm != None:\r
                        self.comm.close()\r
                        del self.comm\r
+                       self.comm = None\r
+                       wx.CallAfter(self.OnCheckClick)\r
+                       return\r
                self.infoBox.SetInfo('Connecting to machine.')\r
                self.infoBox.SetBusyIndicator()\r
                self.commState.SetBitmap(self.unknownBitmap)\r
@@ -398,6 +401,7 @@ class UltimakerCheckupPage(InfoPage):
                elif self.comm.isError():\r
                        wx.CallAfter(self.commState.SetBitmap, self.crossBitmap)\r
                        wx.CallAfter(self.infoBox.SetError, 'Failed to establish connection with the printer.')\r
+                       wx.CallAfter(self.endstopBitmap.Show, False)\r
                wx.CallAfter(self.machineState.SetLabel, 'Communication State: %s' % (self.comm.getStateString()))\r
        \r
        def mcMessage(self, message):\r
@@ -422,15 +426,15 @@ class UltimakerCheckupPage(InfoPage):
                        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
-                                       wx.CallAfter(self.infoBox.SetAttention, 'Please press the left X endstop.')\r
-                                       wx.CallAfter(self.endstopBitmap.SetBitmap, self.endStopXMinBitmap)\r
-                       elif self.checkupState == 4:\r
-                               if 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 = 5\r
                                        wx.CallAfter(self.infoBox.SetAttention, 'Please press the right X endstop.')\r
                                        wx.CallAfter(self.endstopBitmap.SetBitmap, self.endStopXMaxBitmap)\r
-                       elif self.checkupState == 5:\r
+                       elif self.checkupState == 4:\r
                                if not self.xMinStop and self.xMaxStop and not self.yMinStop and not self.yMaxStop and not self.zMinStop and not self.zMaxStop:\r
+                                       self.checkupState = 5\r
+                                       wx.CallAfter(self.infoBox.SetAttention, 'Please press the left X endstop.')\r
+                                       wx.CallAfter(self.endstopBitmap.SetBitmap, self.endStopXMinBitmap)\r
+                       elif self.checkupState == 5:\r
+                               if 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 = 6\r
                                        wx.CallAfter(self.infoBox.SetAttention, 'Please press the front Y endstop.')\r
                                        wx.CallAfter(self.endstopBitmap.SetBitmap, self.endStopYMinBitmap)\r