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

Cables are drawn line objects (toolbar button next to the auto
break/reconnect button, click-move-click, right click cancels), not
components. The type comes from a CSV catalog following the material
list pattern (designation, cores, core colours, editable through the
entry dialog with "Nouvelle entrée" / "Modifier l'entrée").

Each core is bound to the wire its colour label stands on, and the
cable reference is generated per core and written into the Conductor
entry via Conductor::setCableReference(label, cable uuid, slot). The
conductor entry is where it has to live because the terminal strip
plan (Klemmenplan) consumes it in the next step.

Numbering: "Cables" rule under Programmeinstellungen/Neues
Projekt/Nummerierung auto (mirrored in project properties), literal
"W" fallback without a rule, French gate dialog when no rule exists,
Nummerierung menu with the renumber dialog (preferred axis, per-folio
counter, rule and counter state written back, hand-typed names ask,
whole-project scope).

Also included: label block and under-line texts with per-text font and
alignment plus the material-list cell margins, free-core placement and
right-click removal, claim questions for wires of other cables,
multi-selection drag as one undo step, type change with confirmation,
cross-references for type "Cable" (%f-%l%c, own font, clickable links
in exported PDFs), report propagation of the cable definition,
Listes menu (table of contents, material list, terminal strip manager,
terminal generator plugin, cable list), cable list with freely
selectable columns (installation/localisation of cable, start and end,
Blatt start/end, length, used cores...), CSV export dialog with column
pick and preview in the Projekt menu, script API (addTable kind
"cable_list", exportCableList) and a unit test for the type catalog.
This commit is contained in:
Kellermorph
2026-10-08 15:56:00 +02:00
parent 1ca13ce62d
commit bf9b34398d
108 changed files with 18482 additions and 293 deletions
+35
View File
@@ -18,13 +18,16 @@
#ifndef ELEMENTS_MOVER_H
#define ELEMENTS_MOVER_H
#include <QHash>
#include <QPointF>
#include <QPointer>
#include "diagramcontent.h"
class CablePart;
class ConductorTextItem;
class Diagram;
class QStatusBar;
class QUndoCommand;
/**
This class manages the interactive movement of different items (elements,
@@ -53,6 +56,27 @@ class ElementsMover {
void continueMovement(const QPointF &);
void endMovement();
bool holds(const QGraphicsItem *item) const;
/**
Steps of items this mover does not move itself -- the
cable lines the user dragged himself, which know how to
carry their own colour labels along -- handed over so
that the end of this movement pushes them together with
its own: one gesture, one undo step, whatever the
selection is made of.
@param steps the commands, given away with them
*/
void addExtraCommands(const QList<QUndoCommand *> &steps);
/**
Call the whole movement off without writing anything:
every element goes back to the place the gesture found it
and every line of the selection puts itself back too (see
CablePart), so nothing at all has to be undone.
Answering "Annuler" to a question asked while the lines
settle is what calls it: one gesture is written as a
whole or not at all.
*/
void cancelMovement();
// attributes
private:
@@ -63,6 +87,17 @@ class ElementsMover {
bool m_driver_held{false};
DiagramContent m_moved_content;
QPointer<QStatusBar> m_status_bar;
///The cable lines marked together with the elements, moved
///by this mover from one gesture to the next (see
///CablePart::beginLineGesture) -- empty whenever the finger
///is on a line itself, since a line then carries its own
QList<CablePart *> m_moved_cables;
///Steps handed over by a line the user dragged himself, to
///be pushed together with the rest of the movement
QList<QUndoCommand *> m_extra_commands;
///Where every item of the movement stood when it began, so
///that calling it off puts them all back exactly there
QHash<QGraphicsItem *, QPointF> m_start_positions;
};
#endif