v2.4: fix calibration in menu

This commit is contained in:
Konstantin Koslowski 2021-10-03 11:55:03 +02:00
parent a264277df2
commit 8ef8f70661

View file

@ -74,23 +74,37 @@ name: Z offset
[menu __main __setup __calib __Z_offset __start] [menu __main __setup __calib __Z_offset __start]
type: input type: input
enable: {not printer.idle_timeout.state == "Printing"} enable: {not printer.idle_timeout.state == "Printing"}
name: Do {['None','Probe','Endstop'][menu.input|int]} name: Do {['None','Home','Probe','Endstop'][menu.input|int]}
input: 0 input: 0
input_min: 0 input_min: 0
input_max: 2 input_max: 3
input_step: 1 input_step: 1
gcode: gcode:
{%- if menu.event == 'long_click' -%} {%- if menu.event == 'long_click' -%}
{menu.back()} {menu.back()}
{%- endif -%}
{%- if menu.input|int == 1 -%} {%- if menu.input|int == 1 -%}
{action_respond_info("Start Probe calibration")} {action_respond_info("Start Homing")}
PROBE_CALIBRATE G28
{%- elif menu.input|int == 2 -%} {%- elif menu.input|int == 2 -%}
{% if "xyz" in printer.toolhead.homed_axes %}
{action_respond_info("Start Probe calibration")}
G0 X150 Y150 F10000
PROBE_CALIBRATE
{%- else -%}
{action_respond_info("Printer not homed")}
{%- endif -%}
{%- elif menu.input|int == 3 -%}
{% if "xyz" in printer.toolhead.homed_axes %}
{action_respond_info(" Start Z-Endstop calibration")} {action_respond_info(" Start Z-Endstop calibration")}
G0 X150 Y150 F10000
Z_ENDSTOP_CALIBRATE Z_ENDSTOP_CALIBRATE
{%- else -%}
{action_respond_info("Printer not homed")}
{%- endif -%} {%- endif -%}
{%- endif -%} {%- endif -%}
[menu __main __setup __calib __Z_offset __move_z] [menu __main __setup __calib __Z_offset __move_z]
type: input type: input
name: Move Z: {'%03.2f' % menu.input} name: Move Z: {'%03.2f' % menu.input}
@ -143,3 +157,8 @@ gcode: ACCEPT
type: command type: command
name: Abort name: Abort
gcode: ABORT gcode: ABORT
[menu __main __setup __calib __Z_offset __saveconfig]
type: command
name: Save config
gcode: SAVE_CONFIG