Port accessory firmware versions, cold-pull state and filament checks

This commit is contained in:
SoftFever
2026-07-17 02:49:45 +08:00
parent 8d211ce878
commit 0feca8d442
3 changed files with 135 additions and 2 deletions

View File

@@ -267,8 +267,18 @@ void DevCalib::ExtrusionCalibGetResultParse(const json &jj)
auto ams_id = f.value("ams_id", 0);
auto slot_id = f.value("slot_id", 0);
if(f.contains("tray_id")){
// Orca: no GetTrayIdByAmsSlotId in Orca DevFilaSystem; standard AMS tray formula
f["tray_id"] = ams_id * 4 + slot_id;
// Orca: Orca's DevFilaSystem has no GetTrayIdByAmsSlotId; mirror its
// semantics via a reverse lookup over GetTrayIndexMap() (correct for
// non-4-slot AMS layouts, unlike a fixed ams_id*4+slot_id formula).
int mapped_tray_id = -1;
const auto tray_ams_slot_map = GetOwner()->GetFilaSystem()->GetTrayIndexMap();
for (const auto& item : tray_ams_slot_map) {
if (item.second.first == ams_id && item.second.second == slot_id) {
mapped_tray_id = item.first;
break;
}
}
f["tray_id"] = mapped_tray_id;
}
}
}