From 2dad4e40e9d2016e181e3ab44ba4db3c138b084b Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Wed, 11 Aug 2021 17:03:35 +0200 Subject: [PATCH] display_menu: cleanup, add things --- display_menu.cfg | 127 +++++++++++++++++++++++++++++++++++++++++++++++ macros.cfg | 4 +- printer.cfg | 3 ++ 3 files changed, 132 insertions(+), 2 deletions(-) create mode 100644 display_menu.cfg diff --git a/display_menu.cfg b/display_menu.cfg new file mode 100644 index 0000000..5fbf2c6 --- /dev/null +++ b/display_menu.cfg @@ -0,0 +1,127 @@ +## +# Display Menu definition # +## + +# Removed items +[menu __main __octoprint] +type: disabled + +## PreHeat +[menu __main __temp __preheat_pla] +type: disabled + +[menu __main __temp __preheat_abs] +type: disabled + +## use own load and unload macro +[menu __main __filament __loadf] +type: disabled + +[menu __main __filament __loads] +type: disabled + +[menu __main __filament __unloadf] +type: disabled + +[menu __main __filament __unloads] +type: disabled + +## Delta Calibration +[menu __main __setup __calib __delta_calib_auto] +type: disabled + +[menu __main __setup __calib __delta_calib_man] +type: disabled + + +# Added Items to the Stock menu # +[menu __main __filament __load] +type: command +name: Load Filament +gcode: + FILAMENT_LOAD + +[menu __main __filament __unload] +type: command +name: Unload Filament +gcode: + FILAMENT_UNLOAD + +## Probe & Endstop Z-Offset calibration +[menu __main __setup __calib __Z_offset] +type: list +enable: {not printer.idle_timeout.state == "Printing"} +name: Z offset + +[menu __main __setup __calib __Z_offset __start] +type: input +enable: {not printer.idle_timeout.state == "Printing"} +name: Do {['None','Probe','Endstop'][menu.input|int]} +input: 0 +input_min: 0 +input_max: 2 +input_step: 1 +gcode: + {%- if menu.event == 'long_click' -%} + {menu.back()} + {%- if menu.input|int == 1 -%} + {action_respond_info("Start Probe calibration")} + PROBE_CALIBRATE + {%- elif menu.input|int == 2 -%} + {action_respond_info(" Start Z-Endstop calibration")} + Z_ENDSTOP_CALIBRATE + {%- endif -%} + {%- endif -%} + +[menu __main __setup __calib __Z_offset __move_z] +type: input +name: Move Z: {'%03.2f' % menu.input} +input: {printer.gcode_move.gcode_position.z} +input_step: 1 +realtime: True +gcode: + {%- if menu.event == 'change' -%} + G1 Z{'%.2f' % menu.input} + {%- elif menu.event == 'long_click' -%} + G1 Z{'%.2f' % menu.input} + SAVE_GCODE_STATE NAME=__move__axis + G91 + G1 Z2 + G1 Z-2 + RESTORE_GCODE_STATE NAME=__move__axis + {%- endif -%} + +[menu __main __setup __calib __Z_offset __test_z] +type: input +name: Test Z: {['++','+','+.01','+.05','+.1','+.5','-.5','-.1','-.05','-.01','-','--'][menu.input|int]} +input: 5 +input_min: 0 +input_max: 11 +input_step: 1 +gcode: + {%- if menu.event == 'long_click' -%} + TESTZ Z={['++','+','+.01','+.05','+.1','+.5','-.5','-.1','-.05','-.01','-','--'][menu.input|int]} + {%- endif -%} + +[menu __main __setup __calib __Z_offset __test_z_live] +type: input +name: Test Z : {'%03.3f' % menu.input} +input: 0 +input_min: -5.0 +input_max: 5.0 +input_step: 0.01 +realtime: True +gcode: + {%- if menu.event == 'long_click' -%} + TESTZ Z={'%.3f' % menu.input} + {%- endif -%} + +[menu __main __setup __calib __Z_offset __accept] +type: command +name: Accept +gcode: ACCEPT + +[menu __main __setup __calib __Z_offset __abort] +type: command +name: Abort +gcode: ABORT diff --git a/macros.cfg b/macros.cfg index ff97a42..c72f60e 100644 --- a/macros.cfg +++ b/macros.cfg @@ -116,7 +116,7 @@ gcode: TURN_OFF_HEATERS CANCEL_PRINT_BASE -[gcode_macro UNLOAD] +[gcode_macro FILAMENT_UNLOAD] description: unload filament gcode: {% if printer.extruder.can_extrude|lower == 'true' %} @@ -127,7 +127,7 @@ gcode: {action_respond_info("extruder not hot enough")} {% endif %} -[gcode_macro LOAD] +[gcode_macro FILAMENT_LOAD] description: load filament gcode: {% if printer.extruder.can_extrude|lower == 'true' %} diff --git a/printer.cfg b/printer.cfg index d639a64..9457e30 100644 --- a/printer.cfg +++ b/printer.cfg @@ -24,6 +24,9 @@ path: ~/gcode_files ## macros [include macros.cfg] +## display menu +[include display_menu.cfg] + ## web [pause_resume]