Skip to content

Commit

Permalink
Add macro descriptions, use M600 with incorrect filaments
Browse files Browse the repository at this point in the history
  • Loading branch information
bofh69 committed Mar 15, 2024
1 parent 05c0734 commit df26f8a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion klipper-spoolman.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# These are from Spoolman:
[gcode_macro SET_ACTIVE_SPOOL]
description: Set loaded spool's Spoolman ID in Moonraker
gcode:
{% if params.ID %}
{% set id = params.ID|int %}
Expand All @@ -12,6 +13,7 @@ gcode:
{% endif %}
[gcode_macro CLEAR_ACTIVE_SPOOL]
description: Remove active spool ID in Moonraker
gcode:
{action_call_remote_method(
"spoolman_set_active_spool",
Expand All @@ -25,6 +27,7 @@ gcode:
# SPDX-License-Identifier: CC0-1.0
[gcode_macro SET_ACTIVE_FILAMENT]
description: Set loaded filament's Spoolman ID
gcode:
{% if params.ID %}
{% set id = params.ID|int %}
Expand All @@ -34,12 +37,13 @@ gcode:
{% endif %}

[gcode_macro ASSERT_ACTIVE_FILAMENT]
description: PAUSE print if wrong filament's Spoolman ID != ID
gcode:
{% if params.ID %}
{% set id = params.ID|int %}
{% set current_id = printer.save_variables.variables["active_filament"]|int %}
{% if id != current_id %}
{action_raise_error("Wrong filament is loaded, should be " + id|string)}
M600
{% endif %}
{% else %}
{action_respond_info("Parameter 'ID' is required")}
Expand Down

0 comments on commit df26f8a

Please sign in to comment.