Export the wiring list without building every folio (stage D5)

The wiring list export read the project as QETProject::toXml() writes
it, which builds every folio. It now reads a document made without
building: a built folio written as saving writes it
(QETProject::folioXml(), which keeps its symbols' links to partners not
built), a folio not built copied from its XML, and what QElectroTech
computes for a wire's ends -- its symbols' labels, their last partner's
label, the terminals' names -- filled in from the symbols built and from
the project database. A symbol still waiting for a partner not built
takes its partners from the database, saved order.

136-folio .qetz, wiring list from the command line: 30.1 s with every
folio built, 4.5 s lazily, same file. tst_lazyfolios: the wiring list of
a .qet and of a .qetz as when built, building no folio. New corpus gate
(it fails on
all 6 projects tried with terminal names broken): --export-cables and
--export-wires lazily from the .qet and the .qetz = eager on 342
projects; one (forum f3386) differed until waiting symbols took their
partners from the database. ctest 96/96 eager and lazy (one earlier
run had modal_quit_regression and tst_resaveunchanged fail once each,
both passing on rerun in both modes); 342 corpus projects save the same
in all four arms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ispyisail
2026-10-12 12:20:46 +13:00
parent b972dbec4b
commit 65b10b01d9
8 changed files with 153 additions and 11 deletions
+28
View File
@@ -1289,6 +1289,34 @@ QList<projectDataBase::FolioWire> projectDataBase::wiresOnFolios(const QList<QUu
return wires;
}
/**
@brief projectDataBase::elementLabel
@return the label the symbol @p element shows, read from the element
info table as it is (see elementTypesOnFolios())
*/
QString projectDataBase::elementLabel(const QUuid &element) const
{
QSqlQuery query(m_data_base);
query.prepare(QStringLiteral("SELECT label FROM element_info WHERE element_uuid = :uuid"));
query.bindValue(QStringLiteral(":uuid"), element.toString());
return query.exec() && query.next() ? query.value(0).toString() : QString();
}
/**
@brief projectDataBase::terminalName
@return the name of the terminal @p terminal of the symbol @p element,
read from the terminal table as it is (see elementTypesOnFolios()): a
terminal a wire ends on has a row
*/
QString projectDataBase::terminalName(const QUuid &terminal, const QUuid &element) const
{
QSqlQuery query(m_data_base);
query.prepare(QStringLiteral("SELECT name FROM terminal WHERE uuid = :uuid AND element_uuid = :element"));
query.bindValue(QStringLiteral(":uuid"), terminal.toString());
query.bindValue(QStringLiteral(":element"), element.toString());
return query.exec() && query.next() ? query.value(0).toString() : QString();
}
/**
@brief projectDataBase::linkedSymbols
@return the symbols @p element is linked to, read from the link table