Commit 241a6943 authored by Guillaume Seguin's avatar Guillaume Seguin

Fix #458

parent b8823717
...@@ -179,5 +179,11 @@ class GcodePlater(Plater): ...@@ -179,5 +179,11 @@ class GcodePlater(Plater):
if __name__ == '__main__': if __name__ == '__main__':
app = wx.App(False) app = wx.App(False)
main = GcodePlater(sys.argv[1:]) main = GcodePlater(sys.argv[1:])
for fn in main.filenames:
main.load_file(fn)
main.filenames = None
main.autoplate()
main.export_to("gcodeplate___test.gcode")
raise SystemExit
main.Show() main.Show()
app.MainLoop() app.MainLoop()
...@@ -366,7 +366,7 @@ class GCode(object): ...@@ -366,7 +366,7 @@ class GCode(object):
cur_z = line.z cur_z = line.z
elif line.is_move: elif line.is_move:
if line.z is not None: if line.z is not None:
if line.relative: if line.relative and cur_z is not None:
cur_z += line.z cur_z += line.z
else: else:
cur_z = line.z cur_z = line.z
......
...@@ -1390,6 +1390,9 @@ class pronsole(cmd.Cmd): ...@@ -1390,6 +1390,9 @@ class pronsole(cmd.Cmd):
if override is not None: if override is not None:
length = override length = override
feed = overridefeed feed = overridefeed
self.do_extrude_final(length, feed)
def do_extrude_final(self, length, feed):
if length > 0: if length > 0:
self.log(_("Extruding %fmm of filament.") % (length,)) self.log(_("Extruding %fmm of filament.") % (length,))
elif length < 0: elif length < 0:
......
...@@ -176,8 +176,8 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -176,8 +176,8 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self.cpbuttons = [ self.cpbuttons = [
SpecialButton(_("Motors off"), ("M84"), (250, 250, 250), None, 0, _("Switch all motors off")), SpecialButton(_("Motors off"), ("M84"), (250, 250, 250), None, 0, _("Switch all motors off")),
SpecialButton(_("Check temp"), ("M105"), (225, 200, 200), (2, 5), (1, 1), _("Check current hotend temperature")), SpecialButton(_("Check temp"), ("M105"), (225, 200, 200), (2, 5), (1, 1), _("Check current hotend temperature")),
SpecialButton(_("Extrude"), ("extrude"), (225, 200, 200), (4, 0), (1, 2), _("Advance extruder by set length")), SpecialButton(_("Extrude"), ("pront_extrude"), (225, 200, 200), (4, 0), (1, 2), _("Advance extruder by set length")),
SpecialButton(_("Reverse"), ("reverse"), (225, 200, 200), (4, 2), (1, 3), _("Reverse extruder by set length")), SpecialButton(_("Reverse"), ("pront_reverse"), (225, 200, 200), (4, 2), (1, 3), _("Reverse extruder by set length")),
] ]
self.custombuttons = [] self.custombuttons = []
self.btndict = {} self.btndict = {}
...@@ -365,21 +365,13 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -365,21 +365,13 @@ class PronterWindow(MainWindow, pronsole.pronsole):
if gline.is_move and hasattr(self.gviz, "set_current_gline"): if gline.is_move and hasattr(self.gviz, "set_current_gline"):
wx.CallAfter(self.gviz.set_current_gline, gline) wx.CallAfter(self.gviz.set_current_gline, gline)
def do_extrude(self, l = ""): def do_pront_extrude(self, l = ""):
try: feed = self.settings.e_feedrate
if not l.__class__ in (str, unicode) or not len(l): self.do_extrude_final(self.edit.GetValue(), feed)
l = str(self.edist.GetValue())
pronsole.pronsole.do_extrude(self, l)
except:
raise
def do_reverse(self, l = ""): def do_pront_reverse(self, l = ""):
try: feed = self.settings.e_feedrate
if not l.__class__ in (str, unicode) or not len(l): self.do_extrude_final(- self.edit.GetValue(), feed)
l = str(- float(self.edist.GetValue()))
pronsole.pronsole.do_extrude(self, l)
except:
pass
def setbedgui(self, f): def setbedgui(self, f):
self.bsetpoint = f self.bsetpoint = f
......
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