auto-sending machine specific headers / footers

This commit is contained in:
Teja 2015-02-01 12:34:32 +01:00
parent 2c37cd589a
commit 2800f53448
3 changed files with 17 additions and 4 deletions

View file

@ -272,10 +272,12 @@ class SvgToGcodePlugin(octoprint.plugin.SlicerPlugin,
dest_dir, dest_file = os.path.split(machinecode_path)
working_dir, _ = os.path.split(executable)
args = ['python "%s"' % executable, '-f "%s"' % dest_file, '-d "%s"' % dest_dir]
args += ['--no-header=True']
for k, v in engine_settings.items():
args += ['"%s=%s"' % (k, str(v))]
fill_enabled = False # disabled as highly experimental
args += ['--fill-areas=%s' % fill_enabled, '--create-log=%s' % log_enabled, '"--log-filename=%s"' % log_path,'"%s"' % model_path]
args += ['--fill-areas=%s' % fill_enabled]
args += ['--create-log=%s' % log_enabled, '"--log-filename=%s"' % log_path,'"%s"' % model_path]
#python ~/mrbeam-inkscape-ext/standalone.py -f output.gcode -d output/path --engraving-laser-speed=300
# --laser-intensity=1000 --create-log=false path/to/input.svg

View file

@ -430,7 +430,6 @@ def gcodeConvertCommand():
with open(output_path,'ab') as wfd:
for f in sources:
path = fileManager.get_absolute_path(f['origin'], f['name'])
print("files.py appendCallback", path)
wfd.write( "\n; "+ f['name'] + "\n")
with open(path,'rb') as fd:
@ -438,7 +437,6 @@ def gcodeConvertCommand():
wfd.write( "\nM05\n") # ensure that the laser is off.
print("files.py join done", output_path)
if command == "convert":

View file

@ -403,6 +403,13 @@ class MachineCom(object):
self._pauseWaitTimeLost = 0.0
try:
# TODO fetch init sequence from machine profile
self.sendCommand("$H")
self.sendCommand("G92X0Y0Z0")
self.sendCommand("G90")
self.sendCommand("M08")
self.sendCommand("G21")
self._currentFile.start()
wasPaused = self.isPaused()
@ -1135,7 +1142,7 @@ class MachineCom(object):
"remote": remote,
"time": self.getPrintTime()
}
self._currentFile = None
self._changeState(self.STATE_OPERATIONAL)
self._callback.mcFileTransferDone(remote)
@ -1151,6 +1158,12 @@ class MachineCom(object):
self._callback.mcPrintjobDone()
self._changeState(self.STATE_OPERATIONAL)
eventManager().fire(Events.PRINT_DONE, payload)
# TODO fetch finish sequence from machine profiles
self.sendCommand("M05");
self.sendCommand("G0X0Y0");
self.sendCommand("M09");
self.sendCommand("M02");
return
self._sendCommand(line, True)