-
Notifications
You must be signed in to change notification settings - Fork 23
/
cartographer_ci_test.cfg
36 lines (32 loc) · 1.61 KB
/
cartographer_ci_test.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
[respond]
[gcode_macro CARTOGRAPHER_CI_TEST]
variable_stages = ["G28", "PROBE", "PROBE_ACCURACY", "BED_MESH_CALIBRATE", "CARTOGRAPHER_CALIBRATE METHOD=manual", "CARTOGRAPHER_THRESHOLD_SCAN", "CARTOGRAPHER_CALIBRATE", "CARTOGRAPHER_TOUCH"]
variable_stage_index = 0
gcode:
{% set stage_count = stages | length %}
{action_respond_info("Executing %s" % (stages[stage_index]))}
{stages[stage_index]}
M400
G28 Z
{% set next_index = stage_index + 1 %}
RESPOND TYPE=command MSG='{"action:prompt_begin Cartographer CI Tests [%d / %d]" % (next_index, stage_count)}'
{% if next_index < stage_count %}
RESPOND TYPE=command MSG='{"action:prompt_text Next test is %s" % (stages[next_index])}'
RESPOND TYPE=command MSG="action:prompt_footer_button ABORT|_CARTOGRAPHER_CI_TEST_ABORT|error"
RESPOND TYPE=command MSG="action:prompt_footer_button Continue|_CARTOGRAPHER_CI_TEST_CONTINUE|primary"
{% else %}
RESPOND TYPE=command MSG="action:prompt_text All tests completed!!"
SET_GCODE_VARIABLE MACRO=CARTOGRAPHER_CI_TEST VARIABLE=stage_index VALUE=0
{% endif %}
RESPOND TYPE=command MSG="action:prompt_show"
[gcode_macro _CARTOGRAPHER_CI_TEST_CONTINUE]
gcode:
RESPOND TYPE=command MSG="action:prompt_end"
{% set vars = printer["gcode_macro CARTOGRAPHER_CI_TEST"]%}
SET_GCODE_VARIABLE MACRO=CARTOGRAPHER_CI_TEST VARIABLE=stage_index VALUE={vars.stage_index + 1}
CARTOGRAPHER_CI_TEST
[gcode_macro _CARTOGRAPHER_CI_TEST_ABORT]
gcode:
RESPOND TYPE=command MSG="action:prompt_end"
SET_GCODE_VARIABLE MACRO=CARTOGRAPHER_CI_TEST VARIABLE=stage_index VALUE=0
{action_respond_info("Cartographer CI tests aborted.")}