Restrict pause_position and cancel_position to relevant GCODE scripts

This commit is contained in:
Gina Häußge 2016-11-23 17:41:43 +01:00
parent 6cc3846512
commit ccf77a5dae

View file

@ -678,10 +678,14 @@ class MachineCom(object):
context.update(replacements)
context.update(dict(
printer_profile=self._printerProfileManager.get_current_or_default(),
last_position=self.last_position,
pause_position=self.pause_position
last_position=self.last_position
))
if scriptName == "afterPrintPaused" or scriptName == "beforePrintResumed":
context.update(dict(pause_position=self.pause_position))
elif scriptName == "afterPrintCancelled":
context.update(dict(cancel_position=self.cancel_position))
template = settings().loadScript("gcode", scriptName, context=context)
if template is None:
scriptLines = []