Newer
Older
jeltz-klipper-config / config / variable_macros.cfg
@Cory Tucker Cory Tucker 10 days ago 1 KB fix #1, fix #8, add in a QUERY_FILAMENT macro
  1. [save_variables]
  2. filename: ~/printer_data/config/storage/variables.cfg
  3.  
  4. [gcode_macro VARIABLES]
  5. variable_mesh_bed_temp: 0 # stores the temperature of the bed at the last bed mesh calibrate
  6. variable_mesh_bed_temp_leeway: 15 # +- leeway (K) outside of which another bed mesh will be performed
  7. gcode:
  8.  
  9. [gcode_macro SET_FILAMENT_LOAD_STATE]
  10. description: Sets the load state of the filament and saves it.
  11. gcode:
  12. {% if params.STATE in ['primed', 'loaded', 'unloaded', 'unloaded_waiting', 'processing'] %}
  13. SAVE_VARIABLE VARIABLE=filament_load_state VALUE="'{params.STATE}'"
  14. {action_respond_info("Filament state set to: %s " %(params.STATE) )}
  15. {% else %}
  16. {action_respond_info("filament state : %s : nope" %(params.STATE))}
  17. {% endif %}
  18.  
  19. [gcode_macro SET_HOTEND_FILAMENT]
  20. gcode:
  21. {% if params.NAME in printer.filaments.presets|map(attribute='name',default='None')%}
  22. SAVE_VARIABLE VARIABLE=filament_hotend VALUE="'{params.NAME}'"
  23. {action_respond_info("Hotend filament set to: %s " %(params.NAME) )}
  24. {% else %}
  25. {action_respond_info("invalid hotend filament name : %s : nope" %(params.NAME))}
  26. {% endif %}
  27. [gcode_macro SET_EXTRUDER_FILAMENT]
  28. gcode:
  29. {action_respond_info("%s " %(params.NAME) )}
  30. {% if (params.NAME in printer.filaments.presets|map(attribute='name',default='None')) or (params.NAME|string == "None") %}
  31. SAVE_VARIABLE VARIABLE=filament_extruder VALUE="'{params.NAME}'"
  32. {action_respond_info("Extruder filament set to: %s " %(params.NAME) )}
  33. {% else %}
  34. {action_respond_info("invalid extruder filament name : %s : nope" %(params.NAME))}
  35. {% endif %}