From ec1f67e45575a1ec7d1624056d69a1acba720298 Mon Sep 17 00:00:00 2001 From: MangaValk Date: Wed, 14 Oct 2026 15:17:20 +0200 Subject: [PATCH] PA_CALIBRATE_ALL_LANES: skip lanes without filament Lanes whose AFC prep and load sensors do not both see filament are skipped with a message, as are names that are not AFC lanes. The "complete" message is now a RESPOND, so it appears after the calibrations instead of before them. Co-Authored-By: Claude Opus 5.5 --- macros/pressure_advance/bd_pa_spoolman.cfg | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/macros/pressure_advance/bd_pa_spoolman.cfg b/macros/pressure_advance/bd_pa_spoolman.cfg index 00443b3..19b27ad 100644 --- a/macros/pressure_advance/bd_pa_spoolman.cfg +++ b/macros/pressure_advance/bd_pa_spoolman.cfg @@ -557,11 +557,18 @@ gcode: {action_respond_info("PA_CALIBRATE_ALL_LANES starting for: %s" % raw_lanes)} {% for lane in lane_list %} {% set lane = lane.strip() %} - {% if lane != "" %} + {% set obj = "AFC_stepper " ~ lane %} + {% if lane == "" %} + {% elif obj not in printer %} + RESPOND MSG="PA_CALIBRATE_ALL_LANES: {lane} is not an AFC lane, skipped" + {% elif not (printer[obj].prep and printer[obj].load) %} + RESPOND MSG="PA_CALIBRATE_ALL_LANES: {lane} has no filament loaded, skipped" + {% else %} LANE_CALIBRATE_PA LANE={lane} FORCE={force} {% endif %} {% endfor %} - {action_respond_info("PA_CALIBRATE_ALL_LANES complete.")} + # RESPOND runs in order, after the calibrations above + RESPOND MSG="PA_CALIBRATE_ALL_LANES complete." # ---------------------------------------------------------------------------