Keep the slave total in slots, and label the breakdown as contacts

Two units were being stacked in the same block. The line above reports
max_slaves, which is a number of slots, so reporting the line below in
contacts made a coil with one 4 pole slave read "maximum 4 / used 4"
while three slots were still free.

The total goes back to counting linked elements, matching the unit of
the line above it and restoring the original behaviour of that line.

The per-type breakdown keeps the pole multiplier, because that is the
question it answers -- how many contacts an auxiliary block must
provide -- and is now prefixed "Contacts :" so the two units are not
mistaken for each other.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
ispyisail
2026-09-09 11:46:34 +12:00
parent 7307128fc3
commit 73e9473db4
+6 -6
View File
@@ -390,20 +390,20 @@ QWidget *ElementPropertiesWidget::generalWidget()
? QString(tr("Nombre maximum de contacts esclaves définis : non défini\n"))
: QString(tr("Nombre maximum de contacts esclaves définis : %1\n")).arg(max_slaves);
//Counted in contacts rather than in linked elements, so that a
//slave standing for several contacts is reported as the number
//of contacts it actually uses.
//Left as a count of linked elements: the line above is a number
//of slots, and a slave fills one slot however many contacts it
//carries, so the two stay in the same unit.
description_string += QString(tr("Nombre de contacts esclaves utilisés : %1\n")).arg(m_element->linkedElements().count());
const ContactUsage usage =
static_cast<MasterElement *>(m_element.data())->contactUsage();
description_string += QString(tr("Nombre de contacts esclaves utilisés : %1\n")).arg(usage.total());
//The breakdown is what tells you which auxiliary block would
//satisfy this coil, so it is only worth printing once there is
//something to break down.
if (usage.total() > 0)
{
description_string += QString(tr(" NO : %1, NC : %2, inverseurs : %3, autres : %4\n"))
description_string += QString(tr(" Contacts : NO : %1, NC : %2, inverseurs : %3, autres : %4\n"))
.arg(usage.no)
.arg(usage.nc)
.arg(usage.sw)