Removed checkSSE2, check is included in pypy now.

Updated to the config wizard, check endstops (work in progress, untested)
master
daid 2012-03-07 12:17:03 +01:00
parent 200221ae4f
commit b3ed15c2bf
7 changed files with 39 additions and 70 deletions

View File

@ -579,14 +579,6 @@ class SkeinforgeRepository:
self.executeTitle = 'Skeinforge a file...'
def getPyPyExe(self):
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:

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()

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')

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:

View File

@ -130,16 +130,6 @@ rm -rf ${TARGET_DIR}/pypy/lib-python/2.7/test
#add Skeinforge
cp -a SkeinPyPy_NewUI ${TARGET_DIR}/SkeinPyPy
#Add the SSE2 check if we can build it, else we skip it.
# If we don't have it SkeinPyPy will still function. But crash on machines that don't have SSE2
if [ $BUILD_TARGET = "win32" ]; then
WINCC=`whereis i386-mingw32-gcc`
if [ "$WINCC" != "" ]; then
make -C checkSSE2 CC=${WINCC} TARGET=checkSSE2.exe
cp checkSSE2/checkSSE2.exe ${TARGET_DIR}/SkeinPyPy
fi
fi
#add printrun
mv Printrun ${TARGET_DIR}/Printrun

View File

@ -1,6 +0,0 @@
CC ?= gcc
TARGET ?= checkSSE2
$(TARGET): main.c
$(CC) -o $(TARGET) main.c -Os

View File

@ -1,21 +0,0 @@
#include <stdlib.h>
#include <stdio.h>
//Read CPU flags, and return 0 if we support SSE2, else return 1
//See: http://en.wikipedia.org/wiki/CPUID#EAX.3D1:_Processor_Info_and_Feature_Bits
int main(int argc, char** argv)
{
int features;
//Read the CPU features.
asm("mov $1, %%eax\n"
"cpuid\n"
"mov %%edx, %0"
: "=r"(features) : : "%eax", "%edx", "%ecx");
//Check bit 26, this indicates SSE2 support
if (features & (1 << 26))
return 0;
return 1;
}