Restrict pause_position and cancel_position to relevant GCODE scripts
This commit is contained in:
parent
6cc3846512
commit
ccf77a5dae
1 changed files with 6 additions and 2 deletions
|
|
@ -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 = []
|
||||
|
|
|
|||
Loading…
Reference in a new issue