Terminal strip: realistic drawing styles and separator plates

Add two realistic drawing styles for the terminal strip plan, besides
the existing schematic one:
- Realistic (push-in) and Realistic (screw): the strip seen from above,
  at scale (real width of each terminal), like a cabinet mounting
  drawing: end stops, group marker carrier with the strip name, one row
  of wire entries per level, bridge channels with red bridges, marker
  tags with the terminal number, type symbol (fuse, LED, diode,
  sectional, ground...), green/yellow PE and terminal color.

The style is chosen for each plan in the "Add terminal strip plan"
dialog and saved with the item (attribute draw_style of
terminal_strip_item). Items saved before keep the schematic style.
Several plans of the same strip can use different styles.

The values used by the realistic styles are in the layout (scale in
px/mm, terminal length in mm, end stops, group marker) and can be set
in the layout editor, whose style combo box only changes the preview.

Separator plates: a new "Separator plate after" check box column in
the terminal strip editor, stored in the terminal element informations
(key terminal_separator). Drawn as a plate at scale in the realistic
styles and as a thick line in the schematic style.

New files: realisticterminalstripdrawer.{h,cpp} (realistic drawing) and
terminalstripdrawerhelpers.h (helpers shared with the schematic drawer).
This commit is contained in:
Laurent Trinques
2026-10-17 20:21:35 +02:00
parent f4dcbcc366
commit 34557928d1
23 changed files with 1057 additions and 2 deletions
+11
View File
@@ -95,6 +95,12 @@ QDomElement TerminalStripItemXml::toXml(TerminalStripItem *item, QDomDocument &d
dom_element.appendChild(QETXML::qGraphicsItemPosToXml(item, document));
//Drawing style of the item, not saved for the default (schematic) style
if (item->drawStyle() != TerminalStripLayoutPattern::DrawStyle::Schematic) {
dom_element.setAttribute(QStringLiteral("draw_style"),
TerminalStripLayoutPattern::drawStyleToString(item->drawStyle()));
}
return dom_element;
} else {
return QDomElement();
@@ -134,6 +140,11 @@ bool TerminalStripItemXml::fromXml(TerminalStripItem *item, QETProject *project,
bool b{QETXML::qGraphicsItemPosFromXml(item,
xml_elmt.firstChildElement(QStringLiteral("pos")))};
//Item saved before the drawing styles : no attribute, schematic style
item->setDrawStyle(TerminalStripLayoutPattern::drawStyleFromString(
xml_elmt.attribute(QStringLiteral("draw_style")),
TerminalStripLayoutPattern::DrawStyle::Schematic));
return (a && b);
}
return false;