Commit 64bd0694 authored by Guillaume Seguin's avatar Guillaume Seguin

Add "off" command to pronsole (#409)

parent 13591644
...@@ -911,6 +911,9 @@ class pronsole(cmd.Cmd): ...@@ -911,6 +911,9 @@ class pronsole(cmd.Cmd):
def help_pause(self): def help_pause(self):
self.log(_("Pauses a running print")) self.log(_("Pauses a running print"))
def pause(self, event):
return self.do_pause(None)
def do_resume(self, l): def do_resume(self, l):
if not self.paused: if not self.paused:
self.logError(_("Not paused, unable to resume. Start a print first.")) self.logError(_("Not paused, unable to resume. Start a print first."))
...@@ -1417,6 +1420,19 @@ class pronsole(cmd.Cmd): ...@@ -1417,6 +1420,19 @@ class pronsole(cmd.Cmd):
self.log(_("home e - set extruder position to zero (Using G92)")) self.log(_("home e - set extruder position to zero (Using G92)"))
self.log(_("home xyze - homes all axes and zeroes the extruder (Using G28 and G92)")) self.log(_("home xyze - homes all axes and zeroes the extruder (Using G28 and G92)"))
def do_off(self, l):
if self.p.online:
if self.p.printing: self.pause(None)
self.onecmd("M84; motors off")
self.onecmd("M104 S0; extruder off")
self.onecmd("M140 S0; heatbed off")
self.onecmd("M81; power supply off")
else:
self.logError(_("Printer is not online. Unable to turn it off."))
def help_off(self):
self.log(_("Turns off everything on the printer"))
def add_cmdline_arguments(self, parser): def add_cmdline_arguments(self, parser):
parser.add_argument('-c','--conf','--config', help = _("load this file on startup instead of .pronsolerc ; you may chain config files, if so settings auto-save will use the last specified file"), action = "append", default = []) parser.add_argument('-c','--conf','--config', help = _("load this file on startup instead of .pronsolerc ; you may chain config files, if so settings auto-save will use the last specified file"), action = "append", default = [])
parser.add_argument('-e','--execute', help = _("executes command after configuration/.pronsolerc is loaded ; macros/settings from these commands are not autosaved"), action = "append", default = []) parser.add_argument('-e','--execute', help = _("executes command after configuration/.pronsolerc is loaded ; macros/settings from these commands are not autosaved"), action = "append", default = [])
......
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