mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-10 22:12:49 +00:00
The agent fetch_filament_info() path does not fire for Creality K-series hosts because Sidebar::build_filament_ams_list() short-circuits when no MachineObject is bound. MachineObject is a BBL cloud-connected-printer concept that does not apply to LAN Moonraker-style hosts like the K2 -- the AMS-sync icon click was a no-op for them. Mirror what Creality Print own slicer does (explicit Auto Mapping button bypassing the BBL plumbing): when the user clicks the existing AMS-sync icon and host_type=crealityprint, dispatch to a new Sidebar::sync_filaments_from_creality_cfs() that reads the active printer host config, confirms the printer is a CFS-capable K-series board, queries boxsInfo over the printer WS on port 9999, scores each loaded slot against the user filament presets and builds a filament_ams_list entry with the matched filament_id, colour and slot indices, then routes through PresetBundle::sync_ams_list so the filament combo widgets get the same rebuild as BBL printers and runs the BBL post-sync refresh sequence (on_filament_count_change + combo update + select_preset + export_selections + update_dynamic_filament_list). No new UI surface -- the existing AMS-sync icon does the right thing per host_type. Match-and-resolve logic is hoisted out of the agent anonymous namespace into public statics so the sidebar can call it without duplicating scoring rules.