Removed checkSSE2, check is included in pypy now.

Updated to the config wizard, check endstops (work in progress, untested)
This commit is contained in:
daid committed 2012-03-07 12:17:03 +01:00
1 parent 200221ae4f
commit b3ed15c2bf
7 files changed
+39 -70

No files matched your search

+33 -17
View File
@@ -150,7 +150,6 @@ class UltimakerCheckupPage(InfoPage):
def OnSkipClick(self, e):
self.GetParent().FindWindowById(wx.ID_FORWARD).Enable()
self.comm.serial.close()
def OnCheckClick(self, e):
if self.checkPanel != None:
@@ -168,27 +167,44 @@ class UltimakerCheckupPage(InfoPage):
def OnRun(self):
wx.CallAfter(self.AddProgressText, "Connecting to machine...")
comm = machineCom.MachineCom()
self.comm = comm
self.comm = machineCom.MachineCom()
wx.CallAfter(self.AddProgressText, "Checking start message...")
t = threading.Timer(5, self.OnSerialTimeout)
t.start()
line = comm.readline()
hasStart = False
while line != '':
if line.startswith('start'):
hasStart = True
break
line = comm.readline()
t.cancel()
if not hasStart:
if self.DoCommCommandWithTimeout(None, 'start') == False:
wx.CallAfter(self.AddProgressText, "Error: Missing start message.")
comm.close()
return
wx.CallAfter(self.AddProgressText, "Disabling step motors...")
if self.DoCommCommandWithTimeout('M84') == False:
wx.CallAfter(self.AddProgressText, "Error: Missing reply to M84.")
return
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)
wx.CallAfter(self.AddProgressText, "Checking endstops")
if self.DoCommCommandWithTimeout('M119') != "ok x_min:l x_max:l y_min:l y_max:l z_min:l z_max:l"
wx.CallAfter(self.AddProgressText, "Error: There is a problem in your endstops!")
wx.CallAfter(self.AddProgressText, "Error: One of them seems to be pressed while it shouldn't")
return
wx.CallAfter(self.AddProgressText, "Done!")
wx.CallAfter(self.GetParent().FindWindowById(wx.ID_FORWARD).Enable)
comm.close()
self.comm.close()
def DoCommCommandWithTimeout(self, cmd = None, replyStart = 'ok'):
if cmd != None:
self.comm.sendCommand(cmd)
t = threading.Timer(5, self.OnSerialTimeout)
t.start()
while True:
line = self.comm.readline()
if line.startswith('start'):
break
if line == '':
self.comm.close()
return False
t.cancel()
return line.rstrip()
def OnSerialTimeout(self):
self.comm.close()
+6
View File
@@ -122,3 +122,9 @@ class MachineCom():
if self.serial != None:
self.serial.close()
self.serial = None
def sendCommand(self, cmd):
if self.serial == None:
return
self.serial.write(cmd + '\n')
-8
View File
@@ -6,14 +6,6 @@ from skeinforge_application.skeinforge_utilities import skeinforge_craft
def getPyPyExe():
"Return the path to the pypy executable if we can find it. Else return False"
if platform.system() == "Windows":
checkSSE2exe = os.path.dirname(os.path.abspath(__file__)) + "/checkSSE2.exe"
if os.path.exists(checkSSE2exe):
if subprocess.call(checkSSE2exe) != 0:
print "*****************************************************"
print "* Your CPU is lacking SSE2 support, cannot use PyPy *"
print "*****************************************************"
return False
if platform.system() == "Windows":
pypyExe = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../pypy/pypy.exe"));
else: