mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-11 01:41:03 +00:00
Stop duplicate mode names from trapping a plate's mode cycle
The editor only replaced an empty name, so a row could be given a name another row already had. A plate stores its mode by name and find_imex_mode() takes the first row with it, so the second row was unreachable, and the plate's mode list repeated the name: left-click stuck on it, or looped without getting back to Primary. An edited name that another row already carries, or the reserved Primary name in any case, is now replaced when the edit is committed: "copy" becomes "copy 2". The edited row yields, so plates keep resolving to the row they meant, and tabbing through a field without changing it checks nothing. Resetting a row to a saved name that another row has since taken does the same. The plate's mode list comes from imex_plate_mode_choices(), which lists each name once, so a profile that already has duplicates still cycles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
8af5fa45e7
commit
9c5f4ebe47
@@ -1330,6 +1330,14 @@ TEST_CASE("imex_mode_table - every row agrees with find_imex_mode on that name",
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("A plate offers Primary then each mode name once in table order", "[IMEX]") {
|
||||
// A profile can carry the same name twice; a plate stores a mode by name, so only the
|
||||
// first row of a name is reachable, and listing it twice traps the plate's mode cycle.
|
||||
const DynamicPrintConfig cfg = mode_cfg({ "copy", "mirror", "copy", "", "primary", "iq-copy" }, {}, {});
|
||||
REQUIRE(imex_plate_mode_choices(cfg) == std::vector<std::string>{ kImexPrimaryMode, "copy", "mirror", "iq-copy" });
|
||||
REQUIRE(imex_plate_mode_choices(mode_cfg({}, {}, {})) == std::vector<std::string>{ kImexPrimaryMode });
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// imex_resolve_routing — the one derivation shared by the hard block and the warning
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user