Merge branch 'kliment_master' into AudioBot
commit
b77e446074
1
gviz.py
1
gviz.py
|
@ -55,7 +55,6 @@ class gviz(wx.Panel):
|
|||
|
||||
def clear(self):
|
||||
self.lastpos=[0,0,0,0,0]
|
||||
self.Bind(wx.EVT_PAINT,self.paint)
|
||||
self.lines={}
|
||||
self.pens={}
|
||||
self.layers=[]
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
from serial import Serial
|
||||
from threading import Thread
|
||||
import time
|
||||
import getopt, sys
|
||||
import sys
|
||||
|
||||
class printcore():
|
||||
def __init__(self,port=None,baud=None):
|
||||
|
|
|
@ -37,6 +37,7 @@ class Tee(object):
|
|||
class PronterWindow(wx.Frame,pronsole.pronsole):
|
||||
def __init__(self, filename=None,size=winsize):
|
||||
pronsole.pronsole.__init__(self)
|
||||
self.settings.last_file_path = ""
|
||||
self.filename=filename
|
||||
os.putenv("UBUNTU_MENUPROXY","0")
|
||||
wx.Frame.__init__(self,None,title="Printer Interface",size=size);
|
||||
|
@ -395,6 +396,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
|
|||
self.gwindow.Show()
|
||||
|
||||
def setfeeds(self,e):
|
||||
self.feedrates_changed = True
|
||||
try:
|
||||
self.settings._set("e_feedrate",self.efeedc.GetValue())
|
||||
except:
|
||||
|
@ -436,6 +438,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
|
|||
self.statuscheck=0
|
||||
self.p.recvcb=None
|
||||
self.p.disconnect()
|
||||
if hasattr(self,"feedrates_changed"):
|
||||
self.save_in_rc("set xy_feedrate","set xy_feedrate %d" % self.settings.xy_feedrate)
|
||||
self.save_in_rc("set z_feedrate","set z_feedrate %d" % self.settings.z_feedrate)
|
||||
self.save_in_rc("set e_feedrate","set e_feedrate %d" % self.settings.e_feedrate)
|
||||
|
@ -614,6 +617,8 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
|
|||
thread(target=self.skein_monitor).start()
|
||||
|
||||
def loadfile(self,event):
|
||||
basedir=self.settings.last_file_path
|
||||
if not os.path.exists(basedir):
|
||||
basedir = "."
|
||||
try:
|
||||
basedir=os.path.split(self.filename)[0]
|
||||
|
@ -626,7 +631,10 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
|
|||
if not(os.path.exists(name)):
|
||||
self.status.SetStatusText("File not found!")
|
||||
return
|
||||
if name.endswith(".stl"):
|
||||
path = os.path.split(name)[0]
|
||||
if path != self.settings.last_file_path:
|
||||
self.set("last_file_path",path)
|
||||
if name.lower().endswith(".stl"):
|
||||
self.skein(name)
|
||||
else:
|
||||
self.f=[i.replace("\n","").replace("\r","") for i in open(name)]
|
||||
|
@ -636,6 +644,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
|
|||
|
||||
def loadviz(self):
|
||||
self.gviz.clear()
|
||||
self.gwindow.p.clear()
|
||||
for i in self.f:
|
||||
self.gviz.addgcode(i)
|
||||
self.gwindow.p.addgcode(i)
|
||||
|
|
Loading…
Reference in New Issue