Sort terminal strips into the plan's own order

The strip sorted by label: X1:1, X1:2 ... with X1:N and X1:PE at the
end whatever the plan looks like, so a strip drawn across pages came
out in an order no cable follows. Sort it the way the plan is drawn
instead -- folio by folio, then left to right -- in both places that
order a strip: the auto import's own sort of the terminals it groups,
and SortTerminalStripCommand, which the import pushes for a strip it
just creates and which the editor's sort button and
qet.sortTerminalStrip() push as well. The two share one comparator
(SortTerminalStripCommand::planOrderLessThan), so they cannot fight
each other. A spare stands on no folio, has no place in the plan order
and goes last, by label; the label breaks the remaining ties, so two
terminals at the very same spot keep a stable order.
This commit is contained in:
Kellermorph
2026-10-19 20:48:06 +02:00
parent a12fb43bcb
commit 123c56bb13
6 changed files with 381 additions and 14 deletions
+3 -2
View File
@@ -3314,8 +3314,9 @@ bool QetScriptApi::bridgeTerminals(int stripIndex, const QVariantList &realTermi
/**
@brief QetScriptApi::sortTerminalStrip
Reorder a strip's physical positions into the canonical order the
editor's own "sort" button computes, through SortTerminalStripCommand.
Reorder a strip's physical positions into the order the plan is
drawn in -- folio by folio, then left to right -- the same
SortTerminalStripCommand the editor's own "sort" button pushes.
*/
bool QetScriptApi::sortTerminalStrip(int stripIndex)
{