Fix third-party filaments unusable in AMS + remaining weight never updating (#11937) - #12060
Fix third-party filaments unusable in AMS + remaining weight never updating (#11937)#12060JaKuBisz wants to merge 1 commit into
Conversation
|
I sure hope this fix gets adopted by Bambu. |
8506f1f to
43e22a4
Compare
|
@JaKuBisz Thanks for your contribution! We really appreciate the time and effort you've put into this PR to help improve our codebase. |
…dates (bambulab#11937) - persist print weight deductions to cloud - weight tracking for background printers + legacy id migration coverage - fix MSVC build: explicitly capture constexpr kPageSize in lambda
43e22a4 to
a0ade3b
Compare
|
Done — all commits squashed into a single one. Thanks! @XinZhangBambu |
|
@JaKuBisz Thanks for squashing, and thanks for the detailed write-up. We've received this and logged the underlying issue — the fix itself is Thanks again for the time and effort you put into this. |
Description
Fixes #11937: filaments manually added via the web Filament Manager showed
up in the manager list but appeared greyed out under "Unsupported
Filaments" in the AMS slot-assignment dialog and could not be selected.
Remaining filament weight also never updated after a print for non-RFID
spools.
Root cause
FilamentSpool::setting_idis compared everywhere againstPreset::filament_id, but the web "Add filament" dialog could persist acloud user-settings id, or nothing at all for a free-typed third-party
brand, instead of a real
Preset::filament_id. There was also noslicer-side consumption bookkeeping, so non-RFID spools (which always
report firmware remain = -1) never had their weight updated.
Changes
libslic3r/PresetBundle: addresolve_filament_for_spool(), a tolerantlookup (filament_id → setting_id → vendor+type → "Generic ") used
to make already-broken spools selectable instead of requiring an exact
match.
AMSMaterialsSetting.cpp: use the new resolver at all three gates(bucketing, confirm, fast-path) so previously "Unsupported" spools
become selectable in the AMS slot dialog.
setting_idresolution toprefer
filament_idoversetting_id, with a fallback to a Genericpreset id so
setting_idis never persisted empty for a hand-typedbrand.
SelectMachine.cpp/.hpp: at print-send time, compute per-slotgrams-used locally from the gcode result (LAN-safe, no cloud dependency)
and record a pending consumption entry for the job.
wgtFilaManagerStore/wgtFilaManagerSync: add a dedicated, idempotentdeduct_consumption()path that applies pending consumption to thebound spool on the print FINISH transition, recomputing
remain_percent/status locally, and pushes the update to the cloud
immediately (guarded against being overwritten by a subsequent pull
before the push confirms).
wgtFilaManagerCloudSync.cpp: one-time backfill of brokensetting_idfor manually-entered spools during cloud pull (scoped to
entry_method == "manual"/empty, so RFID-authoritative data isuntouched); fixed cloud spool-list pagination that previously only ever
fetched the first 20 spools.
printers, and an MSVC-only build break (
error C3493, constexpr lambdacapture) introduced along the way.
All fixes are local-only (no cloud/RFID dependency for detection), so
behavior is correct in LAN-only mode too.
Testing
universal x86_64+arm64) via the fork's Build All CI pipeline — all green:
https://github.com/JaKuBisz/BambuStudio/actions/runs/33274025249
Related issues
Fixes #11937. The same problem is also reported in #11562, #11654 and
#11871. #12078 was closed as a duplicate (its investigation confirmed this
root cause), and #12079 is a minimal one-file variant — and mentioned this PR as the more
complete fix which should take precedence.