vcore/shell-macros.cfg
2023-01-30 14:37:48 +02:00

61 lines
2.9 KiB
INI

[gcode_shell_command generate_shaper_graph_x]
command: /home/pi/klipper_config/config/scripts/generate-shaper-graph-x.sh
timeout: 60.
verbose: True
[gcode_shell_command generate_shaper_graph_y]
command: /home/pi/klipper_config/config/scripts/generate-shaper-graph-y.sh
timeout: 60.
verbose: True
[gcode_shell_command compile_binaries]
command: /home/pi/klipper_config/config/scripts/compile-binaries.sh
timeout: 600.
[gcode_shell_command change_hostname]
command: /home/pi/klipper_config/config/scripts/change-hostname.sh
timeout: 10.
[gcode_macro GENERATE_SHAPER_GRAPHS]
description: Genarates input shaper resonances graphs for analysis. Uses the AXIS parameter for if you only want to do one axis at a time, (eg. GENERATE_SHAPER_GRAPHS AXIS=X)
gcode:
{% if params.AXIS is defined %}
{% if params.AXIS|lower == 'x' %}
MAYBE_HOME
TEST_RESONANCES AXIS=X
RUN_SHELL_COMMAND CMD=generate_shaper_graph_x
RESPOND MSG="Input shaper graph generated for the X axis. You'll find it in the input_shaper folder in the machine tab!"
{% elif params.AXIS|lower == 'y' %}
MAYBE_HOME
TEST_RESONANCES AXIS=Y
RUN_SHELL_COMMAND CMD=generate_shaper_graph_y
RESPOND MSG="Input shaper graph generated for the Y axis. You'll find it in the input_shaper folder in the machine tab!"
{% else %}
{action_raise_error("Unknown axis specified. Expected X or Y.")}
{% endif %}
{% else %}
MAYBE_HOME
TEST_RESONANCES AXIS=X
TEST_RESONANCES AXIS=Y
RUN_SHELL_COMMAND CMD=generate_shaper_graph_x
RUN_SHELL_COMMAND CMD=generate_shaper_graph_y
RESPOND MSG="Input shaper graphs generated for X and Y. You'll find them in the input_shaper folder in the machine tab!"
{% endif %}
[gcode_macro COMPILE_FIRMWARE]
description: Compiles firmware with currently installed klipper version for all supported RatOS boards. Note: this may take up to 10 minutes.
gcode:
RESPOND MSG="Compiling binaries.. This can take up to 10 minutes. Please do not turn off your Raspberry Pi!"
RUN_SHELL_COMMAND CMD=compile_binaries
RESPOND MSG="Firmware binaries compiled successfully! You can find them in the firmware_binaries folder in the machine tab!"
[gcode_macro CHANGE_HOSTNAME]
description: Change the hostname of your Raspberry Pi.
gcode:
{% if params.HOSTNAME is not defined %}
RESPOND MSG='You have to specify a new hostname with the HOSTNAME parameter. Ex: CHANGE_HOSTNAME HOSTNAME="MY_NEW_HOSTNAME"'
RESPOND MSG="Please note: RFCs mandate that a hostname's labels may contain only the ASCII letters 'a' through 'z' (case-insensitive), the digits '0' through '9', and the hyphen. Hostname labels cannot begin or end with a hyphen. No other symbols, punctuation characters, or blank spaces are permitted."
{% else %}
RUN_SHELL_COMMAND CMD=change_hostname PARAMS={params.HOSTNAME}
{% endif %}