Fix terminal grouping: use functiondefinition block, not pin designation

The previous grouping compared `connectionDesignation` values (e.g. "1",
"2", "3") to detect group boundaries.  Those values are pin position
numbers within a terminal block, not functional group identifiers, so
devices like the ABB ACS880 produced 11+ tiny single-pin "groups" instead
of the ~8 functional blocks (AC-IN, Motor-OUT, DC-Bus, Brake-Resistor,
Analog-I/O, Digital-I/O, ...) the reviewer identified.

Fix:
- Add `group` field to EdzPin, populated from the `functiondefinition`
  attribute on <functiontemplate> (newer EPLAN) or its parent <function>
  element (older EPLAN).
- Sort pins by group first (preserving XML appearance order per group),
  then by designation within each group using natural sort.
- Use `groupKey()` — group when present, designation as fallback — for
  the group-break detection that drives separator lines and Y-gaps.

Parts without any functiondefinition data retain the previous
designation-based behaviour unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Shane Ringrose
2026-06-21 01:54:23 +12:00
parent 27534a379b
commit 756cfd98c0
3 changed files with 28 additions and 7 deletions
+1
View File
@@ -26,6 +26,7 @@
struct EdzPin {
QString designation; ///< terminal id, e.g. "1", "PE"
QString description; ///< function label, e.g. "L+"
QString group; ///< functiondefinition block, e.g. "FINP", "MOUT"
};
/**