Commit 87cb9419 authored by Guillaume Seguin's avatar Guillaume Seguin

Fix #562: Add start command

parent 2299962b
...@@ -1150,6 +1150,14 @@ class pronsole(cmd.Cmd): ...@@ -1150,6 +1150,14 @@ class pronsole(cmd.Cmd):
self.compute_eta = RemainingTimeEstimator(self.fgcode) self.compute_eta = RemainingTimeEstimator(self.fgcode)
else: else:
self.compute_eta = None self.compute_eta = None
if self.settings.start_command:
output = get_command_output(self.settings.start_command,
{"$s": str(self.filename),
"$t": format_time(time.time())})
if output:
self.log("Start command output:")
self.log(output.rstrip())
try: try:
powerset_print_start(reason = "Preventing sleep during print") powerset_print_start(reason = "Preventing sleep during print")
except: except:
......
...@@ -272,6 +272,7 @@ class Settings(object): ...@@ -272,6 +272,7 @@ class Settings(object):
self._add(SpinSetting("e_feedrate", 100, 0, 1000, _("E manual feedrate"), _("Feedrate for Control Panel Moves in Extrusions (mm/min)"), "Printer")) self._add(SpinSetting("e_feedrate", 100, 0, 1000, _("E manual feedrate"), _("Feedrate for Control Panel Moves in Extrusions (mm/min)"), "Printer"))
self._add(StringSetting("slicecommand", "python skeinforge/skeinforge_application/skeinforge_utilities/skeinforge_craft.py $s", _("Slice command"), _("Slice command"), "External")) self._add(StringSetting("slicecommand", "python skeinforge/skeinforge_application/skeinforge_utilities/skeinforge_craft.py $s", _("Slice command"), _("Slice command"), "External"))
self._add(StringSetting("sliceoptscommand", "python skeinforge/skeinforge_application/skeinforge.py", _("Slicer options command"), _("Slice settings command"), "External")) self._add(StringSetting("sliceoptscommand", "python skeinforge/skeinforge_application/skeinforge.py", _("Slicer options command"), _("Slice settings command"), "External"))
self._add(StringSetting("start_command", "", _("Start command"), _("Executable to run when the print is started"), "External"))
self._add(StringSetting("final_command", "", _("Final command"), _("Executable to run when the print is finished"), "External")) self._add(StringSetting("final_command", "", _("Final command"), _("Executable to run when the print is finished"), "External"))
self._add(StringSetting("error_command", "", _("Error command"), _("Executable to run when an error occurs"), "External")) self._add(StringSetting("error_command", "", _("Error command"), _("Executable to run when an error occurs"), "External"))
......
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