Merge master into feat/qetz-db-truth-v2

The .qetz files take this branch's side: it already holds #1473, and
adds the folio parts to join().

qetscriptapi.cpp: #1456 gave setConductorProperty() the voltage that
crosses a function separated terminal element; here that function hands
its work to applyConductorProperties(), so the change goes there, with
the properties captured before the pushes. The database path for folios
not built already gives up at such a terminal, so it builds the folio and
takes the same route.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ispyisail
2026-10-14 18:57:29 +13:00
28 changed files with 708 additions and 44 deletions
+31
View File
@@ -88,6 +88,37 @@ void ConductorPropertiesDialog::PropertiesDialog(Conductor *conductor,
}
}
//A function separated terminal element (element information
//potential_isolating) keeps the two sides of the terminal apart:
//every property but one stays local to the side it was edited on.
//The voltage / protocol still crosses, because it describes the
//electrical node and not one side of it.
if (cpd.applyAll())
{
//Only an edit that really changed the voltage / protocol passes
//it on, so the comparison is the edit itself -- what the dialog
//was filled with, against what the user left in it -- and never
//the far wire's own value, which differs from it just as often
//as not (a 24 V side against a 0 V one, say) and would then be
//overwritten by every edit, voltage included.
const ConductorProperties shown = conductor->properties();
foreach (Conductor *separated_conductor, conductor->functionSeparatedConductors())
{
ConductorProperties separated_properties = separated_conductor->properties();
separated_properties.applyTensionProtocolChange(
shown,
cpd.properties());
if (separated_properties == separated_conductor->properties())
continue;
QVariant separated_old_value, separated_new_value;
separated_old_value.setValue(separated_conductor->properties());
separated_new_value.setValue(separated_properties);
new QPropertyUndoCommand (separated_conductor, "properties",
separated_old_value, separated_new_value, undo);
}
}
conductor->diagram()->undoStack().push(undo);
}
+10 -5
View File
@@ -346,7 +346,10 @@ void ConductorPropertiesEditorWidget::updateUi()
When "apply to all" is ticked, every conductor on the same potential as
an edited one is updated too, in the same undo step (one undo reverts
them all), as the modal dialog does
(ConductorPropertiesDialog::PropertiesDialog).
(ConductorPropertiesDialog::PropertiesDialog). A terminal element with
its function separation enabled is not crossed by any of that -- its
other side keeps its own text, function, color... -- but the voltage /
protocol still crosses (@see Conductor::functionSeparatedConductors).
*/
QUndoCommand *ConductorPropertiesEditorWidget::associatedUndo() const
{
@@ -360,10 +363,12 @@ QUndoCommand *ConductorPropertiesEditorWidget::associatedUndo() const
if (c)
selected << c.data();
return ConductorMultiEdit::undo(
ConductorMultiEdit::targets(
selected, m_apply_all_cb && m_apply_all_cb->isChecked()),
m_shown, edited);
QSet<Conductor *> function_separated;
const QList<Conductor *> targets = ConductorMultiEdit::targets(
selected, m_apply_all_cb && m_apply_all_cb->isChecked(),
&function_separated);
return ConductorMultiEdit::undo(targets, m_shown, edited, function_separated);
}
/**
+3 -2
View File
@@ -313,8 +313,9 @@ void ElementInfoWidget::buildInterface()
ui->scroll_vlayout->addStretch();
// Existing potential isolating checkbox
m_potential_isolating_cb = new QCheckBox(tr("Potential separation"), this);
// Existing function separation checkbox (stored as the
// "potential_isolating" element information)
m_potential_isolating_cb = new QCheckBox(tr("Function separation"), this);
m_potential_isolating_cb->setStyleSheet(QStringLiteral("margin: 5px; font-weight: bold;"));
// English: Initialize and style the BOM exclusion checkbox