mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-10 22:12:49 +00:00
Per @SoftFever review on #13752, printer-specific filament sync logic belongs in the agent rather than in Sidebar. This consolidates the previously-duplicated code so all CFS-specific work lives in CrealityPrintAgent. Changes: - New: CrealityPrintAgent::sync_filaments_into_ams_list() — static method that builds a CrealityPrint host from a printer_cfg, queries CFS slots, populates PresetBundle::filament_ams_list, and triggers sync_ams_list(). GUI-free; returns a result struct (Status + counts + detail) so the caller decides what dialog to show. - New: nested CFSAmsListResult struct describing the five possible outcomes (Success / NotCfsCapable / QueryFailed / EmptySlots / NoMatches). - Removed: Sidebar::sync_filaments_from_creality_cfs() entirely (its body is now the agent method). - Plater.hpp loses the declaration; Plater.cpp dispatches to the agent inline within sync_ams_list() and owns only the dialog + post-sync UI refresh (combo updates, layout, preset selection, persistence). Two CFS-related entry points on the agent now coexist: - fetch_filament_info() — agent-driven path; publishes via AmsTrayData and build_ams_payload(). Active when a MachineObject is bound (BBL concept, not currently created for Creality LAN hosts). - sync_filaments_into_ams_list() — explicit-pull path used today by the Sidebar's "Sync filaments" button until the K-series MachineObject work catches up. No user-visible behaviour change — same end-to-end flow, the data work just lives in the agent now.