Skip to content

Commit

Permalink
expose math functions to gcode macros by mental
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerlz committed Mar 21, 2024
1 parent a3cb2d6 commit a31b902
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ If I want my printer to light itself on fire, I should be able to make my printe

- [gcode: gcode_shell_command](https://github.com/DangerKlippers/danger-klipper/pull/26) ([klipper#2173](https://github.com/Klipper3d/klipper/pull/2173) / [kiuah](https://github.com/dw-0/kiauh/blob/master/resources/gcode_shell_command.py) )

- [gcode: expose math functions to gcode macros](https://github.com/DangerKlippers/danger-klipper/pull/173) ([klipper#4072](https://github.com/Klipper3d/klipper/pull/4072))

- [probe: dockable Probe](https://github.com/DangerKlippers/danger-klipper/pull/43) ([klipper#4328](https://github.com/Klipper3d/klipper/pull/4328))

- [probe: drop the first result](https://github.com/DangerKlippers/danger-klipper/pull/2) ([klipper#3397](https://github.com/Klipper3d/klipper/issues/3397))
Expand Down
4 changes: 3 additions & 1 deletion klippy/extras/gcode_macro.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
#
# This file may be distributed under the terms of the GNU GPLv3 license.
import traceback, logging, ast, copy, json
import jinja2
import jinja2, math


######################################################################
# Template handling
######################################################################


# Wrapper for access to printer object get_status() methods
class GetStatusWrapper:
def __init__(self, printer, eventtime=None):
Expand Down Expand Up @@ -120,6 +121,7 @@ def create_template_context(self, eventtime=None):
"action_respond_info": self._action_respond_info,
"action_raise_error": self._action_raise_error,
"action_call_remote_method": self._action_call_remote_method,
"math": math,
}


Expand Down

0 comments on commit a31b902

Please sign in to comment.