feat: enable filament mapping and resolve printer-set AMS trays by material type

Drop the index-correlation gate so mapped prints are gated only on the filament_mapping capability
Resolve AMS trays set on the printer UI to the matching Generic preset using their material type and color
Skip the forced external-spool selection on printers without an AMS and add coverage for the mapping gates
This commit is contained in:
Lam Wei Lun
2026-10-05 18:22:26 +08:00
parent 38e57888a5
commit bf63eb1226
10 changed files with 331 additions and 60 deletions
+9 -6
View File
@@ -3612,14 +3612,17 @@ void SelectMachineDialog::on_send_print()
get_ams_mapping_result(ams_mapping_array,ams_mapping_array2, ams_mapping_info);
// A device with no AMS unit has one source, the external spool: OrcaSlicer's
// auto-mapping force-selects it, which is not a lane choice. Bambu unchanged.
if (obj_->printer_agent_id == ORCA_PRINTER_AGENT_ID)
drop_forced_external_selection(obj_->HasAms(), ams_mapping_array2);
// OrcaSonar: a mapped print requires the connector to advertise
// filament_mapping and the index correlation to be verified. Refuse rather
// than start with the map silently dropped; Bambu keeps its behavior.
// filament_mapping. Refuse rather than start with the map silently dropped;
// Bambu keeps its behavior.
if (obj_->printer_agent_id == ORCA_PRINTER_AGENT_ID) {
const bool mapping_available = obj_->is_support_filament_mapping && ORCA_FILAMENT_MAPPING_CORRELATION_VERIFIED;
if (!mapping_available && has_engaged_filament_mapping(ams_mapping_array2)) {
BOOST_LOG_TRIVIAL(warning) << "print_job: filament mapping unavailable (capability=" << obj_->is_support_filament_mapping
<< ", correlation_verified=" << ORCA_FILAMENT_MAPPING_CORRELATION_VERIFIED << "); refusing mapped print";
if (!obj_->is_support_filament_mapping && has_engaged_filament_mapping(ams_mapping_array2)) {
BOOST_LOG_TRIVIAL(warning) << "print_job: connector does not advertise filament_mapping; refusing mapped print";
m_status_bar->set_status_text(_L("AMS filament mapping is not available for this printer. Clear the AMS mapping before printing."));
Enable_Send_Button(true);
return;