Turn function that allows prints to start when bed temp is 'target - 1' into a param in _globals.

This commit is contained in:
Bassam Husain
2025-05-17 20:39:44 -04:00
parent a60fcc71ef
commit 596532691a

View File

@@ -29,9 +29,11 @@ gcode:
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0
[gcode_macro _globals] [gcode_macro _globals]
# NOTE 0 = false; 1 = true
variable_filament_sensor_enabled: 1 # NOTE Enable(1) or disable(0) the filament sensor, if one is connected variable_filament_sensor_enabled: 1 # NOTE Enable(1) or disable(0) the filament sensor, if one is connected
variable_beeping_enabled: 1 # NOTE Enable(1) or disable(0) beeping everywhere except during gantry calibration variable_beeping_enabled: 1 # NOTE Enable(1) or disable(0) beeping everywhere except during gantry calibration
variable_bed_temp_over: 10 # NOTE Start print if bed temperature is over by this amount, otherwise wait for temperature drop variable_bed_temp_over: 10 # NOTE Start print if bed temperature is over by this amount, otherwise wait for temperature drop
variable_bed_temp_not_exact: 1 # NOTE Start print if bed temperature is `target temperature - 1` but continue to heat until target is reached
variable_kamp_enable: 0 # NOTE Enable(1) or disable(0) KAMP (adaptive mesh) variable_kamp_enable: 0 # NOTE Enable(1) or disable(0) KAMP (adaptive mesh)
variable_pre_purge_prime_length: 1.40 variable_pre_purge_prime_length: 1.40
gcode: gcode:
@@ -75,12 +77,20 @@ gcode:
[gcode_macro M190] [gcode_macro M190]
rename_existing: M99190 rename_existing: M99190
gcode: gcode:
# Variables
{% set bedtempNotExact = printer["gcode_macro _globals"].bed_temp_not_exact|default(1)|int %}
# Parameters # Parameters
{% set s = params.S|float %} {% set s = params.S|float %}
M140 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %} ; Set bed temp M140 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %} ; Set bed temp
{% if s != 0 %} {% if s != 0 %}
TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={s} MAXIMUM={s+1} ; Wait for bed temp (within 1 degree) {% if bedtempNotExact == 1 %}
TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={s-1} MAXIMUM={s+1} ; set & wait for bed temp (within -1 or +1 degree)
M140 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %} ; set & don't wait for bed temp
{% else %}
TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={s} MAXIMUM={s+1} ; Wait for bed temp (within +1 degree)
{% endif %}
{% endif %} {% endif %}
[gcode_macro PURGE_LINE] [gcode_macro PURGE_LINE]