-
Notifications
You must be signed in to change notification settings - Fork 101
/
basic_macro.cfg
54 lines (50 loc) · 1.99 KB
/
basic_macro.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
52
53
54
#####################################################################
# Macro
#####################################################################
#
# This section contains basic macros that needed in several other
# files. Getting them all to a single place should help to only
# use what needed without hunting down several other files.
#
#####################################################################
## Clear display output after Duration in seconds
## Use: UPDATE_DELAYED_GCODE ID=_CLEAR_DISPLAY DURATION=1
[delayed_gcode _CLEAR_DISPLAY]
gcode:
M117
## Reset SD File after Print_END or CANCEL_PRINT
## This will avoid the reprint option in Mainsail after a print is done
[delayed_gcode _DELAY_SDCARD_RESET_FILE]
gcode:
SDCARD_RESET_FILE
[gcode_macro DIRECT_MOVE]
gcode:
{% set out_param = ["G0"] %}
{% set _dummy = out_param.append("X%s" % params.X) if params.X %}
{% set _dummy = out_param.append("Y%s" % params.Y) if params.Y %}
{% set _dummy = out_param.append("Z%s" % params.Z) if params.Z %}
{% set _dummy = out_param.append("E%s" % params.E) if params.E %}
{% set _dummy = out_param.append("F%s" % params.F) if params.F %}
{out_param|join(" ")}
## action_respond_info will be always executed at the beginning of an macro evaluation.
## Use _PRINT_AR if you need the order of several console outputs in the order given by the macro
## Use: _PRINT_AR T="QGL forced by PRINT_START"
[gcode_macro _PRINT_AR]
description: Helper: Action response
gcode:
{% if params.SHOW_LCD|default('false') == 'true' %} M117 {params.T} {% endif %}
{action_respond_info(params.T)}
[gcode_macro M115]
description: Print host and mcu version
rename_existing: M115.1
gcode:
{% set out = ['mcu build version:'] %}
{% for name1 in printer %}
{% for name2 in printer[name1] %}
{% if name2 is in ['mcu_version'] %}
{% set _dummy = out.append("%s: %s" % (name1, printer[name1][name2])) %}
{% endif %}
{% endfor %}
{% endfor %}
{action_respond_info(out|join("\n"))}
M115.1