mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-15 18:14:14 +02:00
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:
@@ -34,6 +34,7 @@ class DiagramView;
|
||||
class Element;
|
||||
class Terminal;
|
||||
class Conductor;
|
||||
class ConductorProperties;
|
||||
class IndependentTextItem;
|
||||
class QetShapeItem;
|
||||
class DiagramImageItem;
|
||||
@@ -440,6 +441,11 @@ class QetScriptApi : public QObject
|
||||
Q_INVOKABLE bool setConductorProperty(int folioIndex, const QString &elementUuid,
|
||||
int terminalIndex, const QString &property,
|
||||
const QString &value);
|
||||
// The same, the wire named by its uuid (conductorUuids())
|
||||
Q_INVOKABLE QString conductorPropertyByUuid(int folioIndex, const QString &conductorUuid,
|
||||
const QString &property) const;
|
||||
Q_INVOKABLE bool setConductorPropertyByUuid(int folioIndex, const QString &conductorUuid,
|
||||
const QString &property, const QString &value);
|
||||
|
||||
// -- a conductor's own drawn path, not the whole potential's
|
||||
// properties above -- one conductor only, addressed the same way --
|
||||
@@ -648,6 +654,10 @@ class QetScriptApi : public QObject
|
||||
private:
|
||||
bool runFlag(const QString &flag, const QStringList &args);
|
||||
Diagram *built(Diagram *folio) const;
|
||||
Conductor *findConductorByUuid(int folioIndex, const QString &conductorUuid, const QString &caller);
|
||||
bool applyConductorProperties(Conductor *conductor, const ConductorProperties &properties);
|
||||
bool unbuiltConductorChange(int folioIndex, const QUuid &wire, const QString &property,
|
||||
const QString &value, bool *refused);
|
||||
std::optional<DiagramContext> unbuiltInformation(int folioIndex, const QString &elementUuid) const;
|
||||
Element *findElement(int folioIndex, const QString &elementUuid) const;
|
||||
Terminal *findTerminal(int folioIndex, const QString &elementUuid, int terminalIndex,
|
||||
|
||||
Reference in New Issue
Block a user