Report composite texts: element information and the partner's label

A folio report whose text is a composite text replaced only %{label}
and the conductor variables. The report's own information is now
replaced as well, as on any other element, so a report can name the
device and terminal it leads to: "%{comment} %{label}" reads
"-XS27:N +UV1/2 UG Raum - 1.1" like EPLAN's interruption points.

Changing a report's information rebuilt such a text the way an ordinary
element's is built, turning %{label} into the report's stored label,
where its partner was when last saved. It now takes the same text
updateReportText() builds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
DaTweety
2026-10-17 20:22:57 +02:00
parent 1080188f6e
commit ff65b85357
@@ -1143,7 +1143,12 @@ void DynamicElementTextItem::elementInfoChanged()
if (m_composite_text.contains("%{label}"))
setupFormulaConnection();
final_text = autonum::AssignVariables::replaceVariable(m_composite_text, dc);
//A report's %{label} is where its partner is, not its own
//label: the same text updateReportText() builds
if (m_parent_element && (m_parent_element.data()->linkType() & Element::AllReport))
final_text = reportReplacedCompositeText();
else
final_text = autonum::AssignVariables::replaceVariable(m_composite_text, dc);
}
else if (m_text_from == UserText)
final_text = m_text;
@@ -1584,6 +1589,13 @@ QString DynamicElementTextItem::reportReplacedCompositeText() const
if(string.contains("%{conductor_section}"))
string.replace("%{conductor_section}", "");
}
//What is left is the report's own information, as in the
//composite text of any other element: a report can then say
//which device and terminal it leads to (%{comment}), the way
//EPLAN prints "-XS27:N 2 UG Raum - 1.1"
string = autonum::AssignVariables::replaceVariable(
string, m_parent_element.data()->elementInformations());
}
return string;