diff --git a/SkeinPyPy/newui/gcodeInterpreter.py b/SkeinPyPy/newui/gcodeInterpreter.py index 64d4667..79c278d 100644 --- a/SkeinPyPy/newui/gcodeInterpreter.py +++ b/SkeinPyPy/newui/gcodeInterpreter.py @@ -8,8 +8,9 @@ from newui import util3d class gcode(): def __init__(self, filename): - print os.stat(filename).st_size - f = open(filename, 'r') + fileSize = os.stat(filename).st_size + filePos = 0 + gcodeFile = open(filename, 'r') pos = util3d.Vector3() posOffset = util3d.Vector3() currentE = 0.0 @@ -25,7 +26,10 @@ class gcode(): startCodeDone = False currentPath = {'type': 'move', 'pathType': pathType, 'list': [pos.copy()], 'layerNr': layerNr} currentPath['list'][-1].e = totalExtrusion - for line in f: + for line in gcodeFile: + if filePos != gcodeFile.tell(): + filePos = gcodeFile.tell() + #print float(filePos) / float(fileSize) if line.startswith(';TYPE:'): pathType = line[6:].strip() if pathType != "CUSTOM": @@ -144,6 +148,7 @@ class gcode(): pass else: print "Unknown M code:" + str(M) + gcodeFile.close() self.layerCount = layerNr self.pathList = pathList self.extrusionAmount = maxExtrusion diff --git a/SkeinPyPy/newui/mainWindow.py b/SkeinPyPy/newui/mainWindow.py index 69e2f42..9d04138 100644 --- a/SkeinPyPy/newui/mainWindow.py +++ b/SkeinPyPy/newui/mainWindow.py @@ -187,7 +187,6 @@ class mainWindow(configBase.configWindowBase): self.SetMinSize(self.GetSize()) self.Centre() self.Show(True) - print self.GetSize() def OnLoadProfile(self, e): dlg=wx.FileDialog(self, "Select profile file to load", self.lastPath, style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST) diff --git a/SkeinPyPy/newui/preview3d.py b/SkeinPyPy/newui/preview3d.py index a888ba7..7d0c1b1 100644 --- a/SkeinPyPy/newui/preview3d.py +++ b/SkeinPyPy/newui/preview3d.py @@ -8,6 +8,8 @@ import os from wx import glcanvas import wx try: + import OpenGL + OpenGL.ERROR_CHECKING = False from OpenGL.GLU import * from OpenGL.GL import * hasOpenGLlibs = True