Disable OpenGL error checking, which makes the 3D preview a lot faster.
This commit is contained in:
parent
2612610381
commit
a1ce9a995b
3 changed files with 10 additions and 4 deletions
|
@ -8,8 +8,9 @@ from newui import util3d
|
||||||
|
|
||||||
class gcode():
|
class gcode():
|
||||||
def __init__(self, filename):
|
def __init__(self, filename):
|
||||||
print os.stat(filename).st_size
|
fileSize = os.stat(filename).st_size
|
||||||
f = open(filename, 'r')
|
filePos = 0
|
||||||
|
gcodeFile = open(filename, 'r')
|
||||||
pos = util3d.Vector3()
|
pos = util3d.Vector3()
|
||||||
posOffset = util3d.Vector3()
|
posOffset = util3d.Vector3()
|
||||||
currentE = 0.0
|
currentE = 0.0
|
||||||
|
@ -25,7 +26,10 @@ class gcode():
|
||||||
startCodeDone = False
|
startCodeDone = False
|
||||||
currentPath = {'type': 'move', 'pathType': pathType, 'list': [pos.copy()], 'layerNr': layerNr}
|
currentPath = {'type': 'move', 'pathType': pathType, 'list': [pos.copy()], 'layerNr': layerNr}
|
||||||
currentPath['list'][-1].e = totalExtrusion
|
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:'):
|
if line.startswith(';TYPE:'):
|
||||||
pathType = line[6:].strip()
|
pathType = line[6:].strip()
|
||||||
if pathType != "CUSTOM":
|
if pathType != "CUSTOM":
|
||||||
|
@ -144,6 +148,7 @@ class gcode():
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
print "Unknown M code:" + str(M)
|
print "Unknown M code:" + str(M)
|
||||||
|
gcodeFile.close()
|
||||||
self.layerCount = layerNr
|
self.layerCount = layerNr
|
||||||
self.pathList = pathList
|
self.pathList = pathList
|
||||||
self.extrusionAmount = maxExtrusion
|
self.extrusionAmount = maxExtrusion
|
||||||
|
|
|
@ -187,7 +187,6 @@ class mainWindow(configBase.configWindowBase):
|
||||||
self.SetMinSize(self.GetSize())
|
self.SetMinSize(self.GetSize())
|
||||||
self.Centre()
|
self.Centre()
|
||||||
self.Show(True)
|
self.Show(True)
|
||||||
print self.GetSize()
|
|
||||||
|
|
||||||
def OnLoadProfile(self, e):
|
def OnLoadProfile(self, e):
|
||||||
dlg=wx.FileDialog(self, "Select profile file to load", self.lastPath, style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST)
|
dlg=wx.FileDialog(self, "Select profile file to load", self.lastPath, style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST)
|
||||||
|
|
|
@ -8,6 +8,8 @@ import os
|
||||||
from wx import glcanvas
|
from wx import glcanvas
|
||||||
import wx
|
import wx
|
||||||
try:
|
try:
|
||||||
|
import OpenGL
|
||||||
|
OpenGL.ERROR_CHECKING = False
|
||||||
from OpenGL.GLU import *
|
from OpenGL.GLU import *
|
||||||
from OpenGL.GL import *
|
from OpenGL.GL import *
|
||||||
hasOpenGLlibs = True
|
hasOpenGLlibs = True
|
||||||
|
|
Loading…
Reference in a new issue