Use the assigned filament's settings in the PA Line calibration test (#16882)

The PA Line test took its speed limit, line width and extrusion from filament 0, whatever filament the test was assigned to. On any other AMS slot or filament, the test printed with the wrong speeds and the wrong extrusion (#16530).

The test now uses the filament the G-code generator has selected for it:
- the fast lines are capped by that filament's max volumetric speed;
- the line width uses the nozzle diameter of that filament's extruder;
- the lines and the number box use Extruder::e_per_mm() times print_flow_ratio, like a regular print.

With one filament whose flow ratio is not 1, the PA lines now use that flow ratio too. PA Pattern output is unchanged.

Adds a regression test that checks the PA line feedrate and extrusion for a test assigned to the second of two different filaments.

(cherry picked from commit 4b68224ff4)
This commit is contained in:
Gazi Faysal Jubayer authored and SoftFever committed 2026-11-01 09:53:53 +08:00
1 parent 9af2f10adf
commit bbffe8f4df
5 files changed
+194 -29

No files matched your search

+4 -1
View File
@@ -4581,7 +4581,10 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
CalibPressureAdvanceLine pa_test(this);
auto fast_speed = CalibPressureAdvance::find_optimal_PA_speed(print.full_print_config(), pa_test.line_width(), pa_test.height_layer());
// Cap the speed by the volumetric speed of the filament the test prints with, selected above.
const Extruder *pa_filament = m_writer.filament();
auto fast_speed = CalibPressureAdvance::find_optimal_PA_speed(print.full_print_config(), pa_test.line_width(), pa_test.height_layer(),
int(pa_filament->extruder_id()), pa_filament->config_index());
auto slow_speed = std::max(10.0, fast_speed / 10.0);
if (fast_speed < slow_speed + 5)
fast_speed = slow_speed + 5;