Skip to content

fix: PA profiles not shown in AMS dialog for main extruder (extruder 0)#10850

Open
BenJule wants to merge 3 commits into
bambulab:masterfrom
BenJule:fix/10845-pa-profiles-missing-main-extruder
Open

fix: PA profiles not shown in AMS dialog for main extruder (extruder 0)#10850
BenJule wants to merge 3 commits into
bambulab:masterfrom
BenJule:fix/10845-pa-profiles-missing-main-extruder

Conversation

@BenJule

@BenJule BenJule commented May 21, 2026

Copy link
Copy Markdown
Contributor

Root cause

AMSMaterialsSetting::Popup requests the PA calibration history with this guard (introduced in the post-fix of commit 33b62ed / re-applied in 2263815):

int ext_id = obj->GetFilaSystem()->GetExtruderIdByAmsId(std::to_string(ams_id));
if (ext_id > 0) {          // ← BUG
    CalibUtils::emit_get_PA_calib_infos(cali_info);

MAIN_EXTRUDER_ID is 0 (defined in DevDefs.h:94). Any AMS unit bound to the first extruder returns ext_id = 0, which fails > 0, so the extrusion_cali_get MQTT command is never sent. The profile dropdown then contains only the hard-coded "Default" entry — even though the printer has saved profiles.

GetExtruderIdByAmsId returns -1 as its "not found" sentinel, so the correct guard is >= 0.

Fix

-        if (ext_id > 0) {
+        if (ext_id >= 0) {

One character. Extruder 0 now triggers the request; the -1 sentinel still suppresses it when the AMS ID is unknown.

Affected printers

Any printer where an AMS unit is bound to extruder 0 (virtually all single-extruder printers, and at least one AMS unit on dual-extruder printers like X2D). Reported as #10845.

Test plan

  • Open AMS Materials Setting dialog for a filament slot on an AMS unit bound to extruder 0
  • Confirm PA profile dropdown shows profiles saved on the printer, not just "Default"
  • Open dialog for an AMS on extruder 1 (X2D) — profiles still shown
  • AMS ID not found in fila system → ext_id = -1 → no request sent (no regression)

Closes #10845.

BenJule added 3 commits May 21, 2026 10:52
The upstream build_all.yml only listed 'main' as a push trigger.
BenJule/BambuStudio uses 'master' as its default branch, so CI never
fired on fork-local pushes. Adding 'master' alongside 'main' makes
the full multi-platform build run when master is updated.
AMSMaterialsSetting::Popup used `if (ext_id > 0)` to guard the PA
history request. MAIN_EXTRUDER_ID is 0, so any AMS unit bound to the
first extruder failed this check and never sent the `extrusion_cali_get`
command. The dropdown then showed only the hard-coded "Default" entry.

Fix: change `> 0` to `>= 0` so extruder 0 triggers the request while
the existing `return -1` sentinel (not found) is still excluded.

Fixes bambulab#10845.
@BenJule BenJule force-pushed the fix/10845-pa-profiles-missing-main-extruder branch from 4f94365 to 5237588 Compare May 21, 2026 08:55
@BenJule BenJule closed this Jun 7, 2026
@BenJule BenJule deleted the fix/10845-pa-profiles-missing-main-extruder branch June 7, 2026 10:09
@BenJule BenJule restored the fix/10845-pa-profiles-missing-main-extruder branch June 7, 2026 11:37
@BenJule BenJule reopened this Jun 7, 2026
@BenJule

BenJule commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

Apologies — this PR was closed by mistake on 2026-06-07, and that was an error on my side, not a deliberate decision to withdraw the change.

It happened as an unintended side effect of a branch cleanup in my fork: deleting the head branch automatically closed this PR. The contribution still stands. I have restored the branch and reopened the PR. Sorry for the noise and any confusion this caused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Studio beta 2.7.0.55 no longer shows PA profiles after updating to X2D firmware 01.01.01.00

1 participant