Terminal strip editor: cable cells worked out from the project cables

The Cable and Color / wire number columns now show what the cables of
the project say (designation and core colour or number), worked out
from the conductors wired to the terminal, instead of only the values
typed in by hand (patch by Laurent);

Values typed in by hand are still shown, and the cells still editable,
when no cable of the project is wired to the terminal;

A value worked out from a cable is never written back into the element,
so a cable renamed or removed cannot leave a stale value behind.
This commit is contained in:
Kellermorph
2026-10-19 18:40:56 +02:00
parent a12fb43bcb
commit 9e37fa2ca7
5 changed files with 95 additions and 5 deletions
@@ -245,8 +245,13 @@ void TerminalStripEditor::apply()
current_data.m_informations.addValue(key, value);
}
};
set_info(RealTerminal::cableInfoKey(), data_.cable_);
set_info(RealTerminal::cableWireInfoKey(), data_.cable_wire);
//A cable worked out from the cables of the project is
//never written in the element: it would stay there,
//out of date, once the cable is renamed or removed
if (!data_.cable_auto_) {
set_info(RealTerminal::cableInfoKey(), data_.cable_);
set_info(RealTerminal::cableWireInfoKey(), data_.cable_wire);
}
set_info(RealTerminal::shieldInfoKey(), data_.shield_ ? QStringLiteral("true") : QString());
//The color and the section are stored with the dot as decimal separator, whatever the locale
set_info(RealTerminal::colorInfoKey(), TerminalColor::toSpec(data_.color_, data_.stripe_color_));