Removed checkSSE2, check is included in pypy now.
Updated to the config wizard, check endstops (work in progress, untested)master
parent
200221ae4f
commit
b3ed15c2bf
|
@ -579,14 +579,6 @@ class SkeinforgeRepository:
|
||||||
self.executeTitle = 'Skeinforge a file...'
|
self.executeTitle = 'Skeinforge a file...'
|
||||||
|
|
||||||
def getPyPyExe(self):
|
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":
|
if platform.system() == "Windows":
|
||||||
pypyExe = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../pypy/pypy.exe"));
|
pypyExe = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../pypy/pypy.exe"));
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -150,7 +150,6 @@ class UltimakerCheckupPage(InfoPage):
|
||||||
|
|
||||||
def OnSkipClick(self, e):
|
def OnSkipClick(self, e):
|
||||||
self.GetParent().FindWindowById(wx.ID_FORWARD).Enable()
|
self.GetParent().FindWindowById(wx.ID_FORWARD).Enable()
|
||||||
self.comm.serial.close()
|
|
||||||
|
|
||||||
def OnCheckClick(self, e):
|
def OnCheckClick(self, e):
|
||||||
if self.checkPanel != None:
|
if self.checkPanel != None:
|
||||||
|
@ -168,26 +167,43 @@ class UltimakerCheckupPage(InfoPage):
|
||||||
|
|
||||||
def OnRun(self):
|
def OnRun(self):
|
||||||
wx.CallAfter(self.AddProgressText, "Connecting to machine...")
|
wx.CallAfter(self.AddProgressText, "Connecting to machine...")
|
||||||
comm = machineCom.MachineCom()
|
self.comm = machineCom.MachineCom()
|
||||||
self.comm = comm
|
|
||||||
wx.CallAfter(self.AddProgressText, "Checking start message...")
|
wx.CallAfter(self.AddProgressText, "Checking start message...")
|
||||||
t = threading.Timer(5, self.OnSerialTimeout)
|
if self.DoCommCommandWithTimeout(None, 'start') == False:
|
||||||
t.start()
|
|
||||||
line = comm.readline()
|
|
||||||
hasStart = False
|
|
||||||
while line != '':
|
|
||||||
if line.startswith('start'):
|
|
||||||
hasStart = True
|
|
||||||
break
|
|
||||||
line = comm.readline()
|
|
||||||
t.cancel()
|
|
||||||
if not hasStart:
|
|
||||||
wx.CallAfter(self.AddProgressText, "Error: Missing start message.")
|
wx.CallAfter(self.AddProgressText, "Error: Missing start message.")
|
||||||
comm.close()
|
|
||||||
return
|
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.AddProgressText, "Done!")
|
||||||
wx.CallAfter(self.GetParent().FindWindowById(wx.ID_FORWARD).Enable)
|
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):
|
def OnSerialTimeout(self):
|
||||||
self.comm.close()
|
self.comm.close()
|
||||||
|
|
|
@ -122,3 +122,9 @@ class MachineCom():
|
||||||
if self.serial != None:
|
if self.serial != None:
|
||||||
self.serial.close()
|
self.serial.close()
|
||||||
self.serial = None
|
self.serial = None
|
||||||
|
|
||||||
|
def sendCommand(self, cmd):
|
||||||
|
if self.serial == None:
|
||||||
|
return
|
||||||
|
self.serial.write(cmd + '\n')
|
||||||
|
|
||||||
|
|
|
@ -6,14 +6,6 @@ from skeinforge_application.skeinforge_utilities import skeinforge_craft
|
||||||
|
|
||||||
def getPyPyExe():
|
def getPyPyExe():
|
||||||
"Return the path to the pypy executable if we can find it. Else return False"
|
"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":
|
if platform.system() == "Windows":
|
||||||
pypyExe = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../pypy/pypy.exe"));
|
pypyExe = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../pypy/pypy.exe"));
|
||||||
else:
|
else:
|
||||||
|
|
10
build.sh
10
build.sh
|
@ -130,16 +130,6 @@ rm -rf ${TARGET_DIR}/pypy/lib-python/2.7/test
|
||||||
#add Skeinforge
|
#add Skeinforge
|
||||||
cp -a SkeinPyPy_NewUI ${TARGET_DIR}/SkeinPyPy
|
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
|
#add printrun
|
||||||
mv Printrun ${TARGET_DIR}/Printrun
|
mv Printrun ${TARGET_DIR}/Printrun
|
||||||
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
CC ?= gcc
|
|
||||||
TARGET ?= checkSSE2
|
|
||||||
|
|
||||||
$(TARGET): main.c
|
|
||||||
$(CC) -o $(TARGET) main.c -Os
|
|
||||||
|
|
|
@ -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;
|
|
||||||
}
|
|
Loading…
Reference in New Issue