Change a wire's properties by uuid without building its folios (stage D5)

Scripts get conductorPropertyByUuid() and setConductorPropertyByUuid(),
the wire named by its uuid (conductorUuids()) rather than by a symbol's
terminal. A change goes to every wire at the wire's potential, as
setConductorProperty() does. When those wires are all on folios not
built, none is numbered by a formula, and what changes in each is what a
.qetz database holds in its own columns (number, function, voltage,
colour and section of the wire, cable, bus), it goes through the project
database: the store and the conductor rows, undoable by uuid. The
potential is followed in the database (projectDataBase::potentialWires():
through wire ends, folio reports and terminal blocks, as
Conductor::relatedPotentialConductors() follows it; a terminal block that
isolates its terminals answers nothing). Building a wire takes its change
(Conductor::fromXml()); a .qetz save writes it in the database, the folio
file copied; a folio written from its XML gets it there; a .qet builds.
Anything else builds the folio, as before.

tst_lazyfolios: every wire's potential from the database = as followed,
1 342 of 1 342 (industrial, eager and from a .qetz); a cable set by uuid
on a 14-wire potential builds no folio, reaches every wire, saves as when
built, undoes, shows once built (fails when building ignores the change,
and when the .qetz writer does). The test's run limit is raised (500 s ->
1 500 s, ctest 1 800 s): under load it ran past 500 s. ctest 96/96 both
ways.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ispyisail
2026-10-12 23:26:39 +13:00
parent b8390c853c
commit 798010cc83
10 changed files with 507 additions and 2 deletions
+9
View File
@@ -186,6 +186,11 @@ class projectDataBase : public QObject
QSet<QUuid> foliosWithUnbuiltEdits() const;
QHash<QUuid, DiagramContext> unbuiltEditsOnFolio(const QUuid &folio, bool *need_build = nullptr) const;
bool setPlacedElementInformation(const QUuid &element, const DiagramContext &information);
bool unbuiltWire(const QUuid &wire, QUuid *folio = nullptr) const;
void editUnbuiltConductorProperties(const QUuid &wire, const ConductorProperties &properties);
std::optional<ConductorProperties> takeUnbuiltWireEdit(const QUuid &wire);
QHash<QUuid, ConductorProperties> unbuiltWireEditsOnFolio(const QUuid &folio) const;
bool setPlacedConductorProperties(const QUuid &wire, const ConductorProperties &properties);
QHash<QUuid, QString> elementTypesOnFolios(const QSet<QUuid> &folios) const;
/// A symbol placed on a folio, as the element table has it
struct FolioSymbol {
@@ -203,6 +208,7 @@ class projectDataBase : public QObject
QList<FolioWire> wiresOnFolios(const QList<QUuid> &folios) const;
QString elementLabel(const QUuid &element) const;
QString terminalName(const QUuid &terminal, const QUuid &element) const;
std::optional<QSet<QUuid>> potentialWires(const QUuid &wire) const;
static QVariant sequenceValue(const autonum::sequentialNumbers &sequence);
static autonum::sequentialNumbers sequenceFromValue(const QVariant &value);
@@ -346,6 +352,9 @@ class projectDataBase : public QObject
/// each is on: building the symbol takes it (takeUnbuiltEdit())
struct UnbuiltEdit { DiagramContext information; QUuid folio; bool had_information; };
QHash<QUuid, UnbuiltEdit> m_unbuilt_edits;
/// The same for wires (editUnbuiltConductorProperties())
struct UnbuiltWireEdit { ConductorProperties properties; QUuid folio; };
QHash<QUuid, UnbuiltWireEdit> m_unbuilt_wire_edits;
QHash<QUuid, TitleBlockProperties> m_folio_titleblocks;
QHash<QUuid, QPointer<Diagram>> m_placed_folios;
QHash<QUuid, ConductorProperties> m_conductor_properties;