Commit 1febba48 authored by kliment's avatar kliment

Merge pull request #27 from k-eex/master

Fixes for breaking movements, update pronterface fields based on settings too
parents 68793b06 6ed74e6a
......@@ -29,15 +29,14 @@ class Settings:
# defaults here.
# the initial value determines the type
self.port = ""
self.baudrate = 0
self.baudrate = 115200
self.temperature_pla = 210.0
self.temperature_abs = 230.0
self.bedtemp_pla = 60.0
self.bedtemp_abs = 110.0
self.x_feedrate = 3000.0
self.y_feedrate = 3000.0
self.z_feedrate = 200.0
self.e_feedrate = 300.0
self.xy_feedrate = 3000
self.z_feedrate = 200
self.e_feedrate = 300
def _set(self,key,value):
try:
value = getattr(self,"_%s_alias"%key)()[value]
......@@ -755,14 +754,12 @@ class pronsole(cmd.Cmd):
if not self.p.online:
print "Printer is not online. Unable to move."
return
feed=self.feedz
axis="E"
l=l.split()
if(l[0].lower()=="x"):
feed=self.settings.x_feedrate
feed=self.settings.xy_feedrate
axis="X"
elif(l[0].lower()=="y"):
feed=self.settings.y_feedrate
feed=self.settings.xy_feedrate
axis="Y"
elif(l[0].lower()=="z"):
feed=self.settings.z_feedrate
......@@ -789,9 +786,9 @@ class pronsole(cmd.Cmd):
def help_move(self):
print "Move an axis. Specify the name of the axis and the amount. "
print "move X 10 will move the X axis forward by 10mm at ",self.feedxy,"mm/min (default XY speed)"
print "move X 10 will move the X axis forward by 10mm at ",self.settings.xy_feedrate,"mm/min (default XY speed)"
print "move Y 10 5000 will move the Y axis forward by 10mm at 5000mm/min"
print "move Z -1 will move the Z axis down by 1mm at ",self.feedz,"mm/min (default Z speed)"
print "move Z -1 will move the Z axis down by 1mm at ",self.settings.z_feedrate,"mm/min (default Z speed)"
print "Common amounts are in the tabcomplete list."
def complete_move(self, text, line, begidx, endidx):
......@@ -810,7 +807,7 @@ class pronsole(cmd.Cmd):
def do_extrude(self,l,override=None,overridefeed=300):
length=5#default extrusion length
feed=self.feede#default speed
feed=self.settings.e_feedrate#default speed
if not self.p.online:
print "Printer is not online. Unable to move."
return
......@@ -850,7 +847,7 @@ class pronsole(cmd.Cmd):
def do_reverse(self, l):
length=5#default extrusion length
feed=self.feede#default speed
feed=self.settings.e_feedrate#default speed
if not self.p.online:
print "Printer is not online. Unable to move."
return
......
......@@ -212,6 +212,8 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
style=wx.CB_DROPDOWN|wx.CB_SORT, pos=(50,0))
try:
self.serialport.SetValue(scan[0])
if self.settings.port:
self.serialport.SetValue(self.settings.port)
except:
pass
uts.Add(self.serialport)
......@@ -219,7 +221,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.baud = wx.ComboBox(self.panel, -1,
choices=["2400", "9600", "19200", "38400", "57600", "115200"],
style=wx.CB_DROPDOWN|wx.CB_SORT, size=(110,30),pos=(275,0))
self.baud.SetValue("115200")
try:
self.baud.SetValue("115200")
self.baud.SetValue(str(self.settings.baudrate))
except:
pass
uts.Add(self.baud)
self.connectbtn=wx.Button(self.panel,-1,"Connect",pos=(380,0))
uts.Add(self.connectbtn)
......@@ -287,11 +293,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
#left pane
lls=self.lowerlsizer=wx.GridBagSizer()
lls.Add(wx.StaticText(self.panel,-1,"mm/min",pos=(60,69)),pos=(0,4),span=(1,4))
self.xyfeedc=wx.SpinCtrl(self.panel,-1,"3000",min=0,max=50000,size=(60,25),pos=(25,83))
self.xyfeedc=wx.SpinCtrl(self.panel,-1,str(self.settings.xy_feedrate),min=0,max=50000,size=(60,25),pos=(25,83))
lls.Add(wx.StaticText(self.panel,-1,"XY:",pos=(2,90-2)),pos=(1,0),span=(1,2))
lls.Add(self.xyfeedc,pos=(1,2),span=(1,4))
lls.Add(wx.StaticText(self.panel,-1,"Z:",pos=(90,90-2)),pos=(1,6),span=(1,2))
self.zfeedc=wx.SpinCtrl(self.panel,-1,"200",min=0,max=50000,size=(60,25),pos=(105,83))
self.zfeedc=wx.SpinCtrl(self.panel,-1,str(self.settings.z_feedrate),min=0,max=50000,size=(60,25),pos=(105,83))
lls.Add(self.zfeedc,pos=(1,8),span=(1,4))
#lls.Add((200,375))
......@@ -330,7 +336,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.edist.SetForegroundColour("black")
lls.Add(self.edist,pos=(13,3),span=(1,2))
lls.Add(wx.StaticText(self.panel,-1,"mm",pos=(130,407)),pos=(13,5),span=(1,2))
self.efeedc=wx.SpinCtrl(self.panel,-1,"300",min=0,max=50000,size=(60,25),pos=(70,397+28))
self.efeedc=wx.SpinCtrl(self.panel,-1,str(self.settings.e_feedrate),min=0,max=50000,size=(60,25),pos=(70,397+28))
self.efeedc.SetBackgroundColour((225,200,200))
self.efeedc.SetForegroundColour("black")
self.efeedc.Bind(wx.EVT_SPINCTRL,self.setfeeds)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment