mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-29 14:14:15 +02:00
b1abab1241
The first fill from the document stored the label and wire text saved in the file. QElectroTech saves what it last worked out, not what the formula gives now: K%total-%id saved as K1-1 on a 3-folio project is K3-1 on the folios, and the same for a wire's formula. So the document fill disagreed with the folio fill on any file whose folios had been added or moved. AssignVariables now works from a FormulaContext: the folio's number, index, total, plant, location, title-block and project variables, and the element's grid cell and prefix or the wire's four properties. The Diagram overload fills one from a built folio, the database fills one from the file, and both call the same evaluation. Also brought in line with Diagram::fromXml(): an element Element::valideXml() rejects is skipped with its wires; a folio where two elements number their terminals alike (Element::fromXml() refuses one, by geometry), a frozen formula wire text, and the older sequential-number attributes are left to the folios. Each folio's border now starts from the defaults a new Diagram has, not the previous folio's values. tst_databasefromdocument: formulasAreWorkedOut (every variable kind, stale saved values), unbuiltElementIsLeftOut, clashingTerminalIdsFallBack. Each fails with its fix removed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>