I want to set up a system that asks if I want to heat soak the bed before starting a print (for times if I need to restart a print and the bed is already hot so resoaking isn't necessary). I have everything working the way I want to, but the way the code executes makes it not work the right way and in the right order that I originally thought. Here's how I have it setup:
print_start macro:
# Use PRINT_START for the slicer starting script - please customise for your slicer of choice
gcode:
{% set BED_TEMP = params.BED|float or params.BED_TEMP|default(110)|float %} # Setup bed temp parameter and give it a default value
{% set EXTRUDER_TEMP = params.EXTRUDER|float or params.EXTRUDER_TEMP|default(260)|float %} # Setup extruder temp parameter and give it a default value
M140 S{BED_TEMP} # Start bed heating using the declared or default value
STATUS_HEATING
M190 S{BED_TEMP} # Wait for bed to reach temperature
HEATSOAK_QUESTION
heatsoaking macros (first one sets up question gui, other ones execute based on response to first one called in print_start):
gcode:
RESPOND TYPE=command MSG="action:prompt_begin Question"
RESPOND TYPE=command MSG="action:prompt_text Would you like to heatsoak the printer?"
RESPOND TYPE=command MSG="action:prompt_footer_button Yes (10 minutes)|HEATSOAK_TEN|primary"
RESPOND TYPE=command MSG="action:prompt_footer_button Yes (20 minutes)|HEATSOAK_TWENTY|warning"
RESPOND TYPE=command MSG="action:prompt_footer_button No|HEATSOAK_NO|error"
RESPOND TYPE=command MSG="action:prompt_show"
[gcode_macro HEATSOAK_TEN]
gcode:
M118 Heat soaking for 10 minutes
RESPOND type="command" msg="action:prompt_end"
STATUS_BUSY
G4 P600000
G32 ; home all axes and level gantry
G90 ; absolute positioning
G1 Z20 F3000
STATUS_HEATING
M109 S{EXTRUDER_TEMP}
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1
STATUS_PRINTING
[gcode_macro HEATSOAK_TWENTY]
gcode:
M118 Heat soaking for 20 minutes
RESPOND type="command" msg="action:prompt_end"
STATUS_BUSY
G4 P1200000
G32 ; home all axes and level gantry
G90 ; absolute positioning
G1 Z20 F3000
STATUS_HEATING
M109 S{EXTRUDER_TEMP}
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1
STATUS_PRINTING
[gcode_macro HEATSOAK_NO]
gcode:
RESPOND type="command" msg="action:prompt_end"
G32 ; home all axes and level gantry
G90 ; absolute positioning
G1 Z20 F3000
STATUS_HEATING
M109 S{EXTRUDER_TEMP}
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1
STATUS_PRINTING
The problem I have is that since the print_start macro is technically finished after it runs the heatsoak_question macro, it tries to continue the print process even though theres other things I want to happen first. I'm not sure how I would put these in the slicer starting gcode in a way to make this work but if someone else has a better idea on how to execute this, I'm all ears.
Thanks