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

Fix #458

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