-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathklipper-spoolman.cfg
51 lines (46 loc) · 1.39 KB
/
klipper-spoolman.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# 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 %}
{action_call_remote_method(
"spoolman_set_active_spool",
spool_id=id
)}
{% else %}
{action_respond_info("Parameter 'ID' is required")}
{% endif %}
[gcode_macro CLEAR_ACTIVE_SPOOL]
description: Remove active spool ID in Moonraker
gcode:
{action_call_remote_method(
"spoolman_set_active_spool",
spool_id=None
)}
#####################################################################
# This is the configuration for filament handling:
#
# SPDX-FileCopyrightText: 2024 Sebastian Andersson <sebastian@bittr.nu>
# 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 %}
SAVE_VARIABLE VARIABLE=active_filament VALUE={id}
{% else %}
{action_respond_info("Parameter 'ID' is required")}
{% 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 %}
M600
{% endif %}
{% else %}
{action_respond_info("Parameter 'ID' is required")}
{% endif %}