Merge branch 'main' into feat/generic-extruders-and-ams

This commit is contained in:
Ian Chua committed 2026-11-12 20:13:50 +08:00
commit b08d553a3e
1745 files changed
+172814 -162962

No files matched your search

+22
View File
@@ -273,6 +273,28 @@ TEST_CASE("A generic AMS unit reports its reported tray count", "[DevFilaSystem]
REQUIRE(ams_list.at("1")->GetSlotCount() == 1);
}
TEST_CASE("An AMS unit is shown under the name its status gives it", "[DevFilaSystem]")
{
MachineObject obj(nullptr, nullptr, "test", "test_dev", "127.0.0.1");
const json named = json::parse(R"({
"ams": { "ams": [ { "id": "0", "info": "00000001", "display_name": "Qidi Box 1", "tray": [] } ] }
})");
DevFilaSystemParser::ParseV1_0(named, &obj, obj.GetFilaSystem().get(), false);
DevAms* ams = obj.GetFilaSystem()->GetAmsById("0");
REQUIRE(ams != nullptr);
CHECK(ams->GetDisplayName().ToStdString() == "Qidi Box 1");
// Without a name the unit falls back to its type: an AMS (info type 1) with id 0 is AMS-1
const json unnamed = json::parse(R"({
"ams": { "ams": [ { "id": "0", "info": "00000001", "tray": [] } ] }
})");
DevFilaSystemParser::ParseV1_0(unnamed, &obj, obj.GetFilaSystem().get(), false);
CHECK(ams->GetDisplayName().ToStdString() == "AMS-1");
}
TEST_CASE("Switch-bound AMS trays map to the left extruder", "[DevMapping]")
{
MachineObject obj(nullptr, nullptr, "test", "test_dev", "127.0.0.1");