mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-14 17:44:13 +02:00
Terminal: rename potential separation to function separation
The checkbox of a terminal element was an all-or-nothing switch: while it was unticked every conductor property (function, wire colour, section, number...) crossed to the other side of the terminal, and once it was ticked nothing did at all. Rename it to "Function separation" and let one property still cross: the voltage / protocol, which describes the electrical node itself rather than one side of it. Conductor::functionSeparatedConductors() returns the conductors reachable only by crossing such a terminal -- the potential computed with the separations ignored, minus the one that respects them -- and ConductorProperties::applyTensionProtocolChange() gives them that one property, in the conductor properties dialog, the selection panel multi-edit, the script API and search/replace. The stored element information stays "potential_isolating", so existing symbols and projects keep their setting, and the existing sub-case of terminals sharing a potential-group identifier is untouched. The German translation of the new label is deliberately left out of this commit and belongs with the other .ts updates.
This commit is contained in:
@@ -88,6 +88,30 @@ 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())
|
||||
{
|
||||
foreach (Conductor *separated_conductor, conductor->functionSeparatedConductors())
|
||||
{
|
||||
ConductorProperties separated_properties = separated_conductor->properties();
|
||||
separated_properties.applyTensionProtocolChange(
|
||||
separated_conductor->properties(),
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user