Reapply "Add cable management: drawing, cores, numbering, cross-references and cable list"

This reverts commit 2bb3343d2d.
This commit is contained in:
Laurent Trinques
2026-10-11 05:00:01 +02:00
parent 124a889be3
commit 1cd8fadbc4
113 changed files with 18793 additions and 209 deletions
@@ -17,6 +17,7 @@
*/
#include "linkelementcommand.h"
#include "../cable/cablemanager.h"
#include "../conductorautonumerotation.h"
#include "../diagram.h"
#include "../diagramposition.h"
@@ -59,6 +60,23 @@ static QString plcCrossRefText(Element *master, Element *slave)
xrp.slaveLabel(), seq, master->diagram(), master);
}
/**
@brief refreshCableLabelsForReport
A folio report carries a cable core over to the next sheet, so
making or breaking such a link changes which wires belong to which
cable. Work the cable fields out again straight away, so the wire
coming out of the linked arrow shows the cable right after the link
is made -- and drops it right after the link is taken away.
@param element the element the link was made or broken on
*/
static void refreshCableLabelsForReport(Element *element)
{
if (!element || !(element->linkType() & Element::AllReport)) return;
if (Diagram *diagram = element->diagram()) {
CableManager::refreshLabels(diagram->project());
}
}
/**
@brief LinkElementCommand::LinkElementCommand
Constructor
@@ -302,6 +320,7 @@ void LinkElementCommand::undo()
}
makeLink(m_linked_before);
refreshCableLabelsForReport(m_element);
QUndoCommand::undo();
}
@@ -329,6 +348,7 @@ void LinkElementCommand::redo()
}
m_first_redo = false;
}
refreshCableLabelsForReport(m_element);
QUndoCommand::redo();
}