Replies: 1 comment
|
Gathered into discussion #934, which writes up what exists today against current master and puts the open questions in one place. Continuing there rather than in three threads. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Forum thread: https://qelectrotech.org/forum/viewtopic.php?pid=21352#p21352
Related third-party project mentioned in the thread: QetWireManager — a community-built FreeCAD script that imports conductors from a
.qetproject to compute wire lengths in 3D space.Problem
A user (Baruse) built an external FreeCAD script that hand-parses
.qetproject XML to extract conductor endpoints, then lets FreeCAD compute real-world wire lengths once elements are placed in 3D space. It works for the simple case, but the thread's own follow-up (plc-user) names the two things it can't handle: cross-references across multiple folios, and non-physical elements like jumps and splices. Baruse's own reply — "still in my mind, but now it doesn't work" — confirms these aren't solved, just deferred.What exists today
Conductor::toXml()(conductor.cpp:1040-1105) already writes each endpoint fully resolved —element1/element2(parent element UUID),element1_label/element2_label(resolved actual label, formula already applied),terminal1/terminal2(terminal UUID) andterminalname1/terminalname2— so a conductor's electrical identity (which two named terminals it joins) is already unambiguous in the file. The external script re-derives this by parsing raw XML itself instead of being handed it directly.projectDataBase,sources/dataBase/projectdatabase.cpp) — but its schema only hasdiagram,element,diagram_info, andelement_infotables (projectdatabase.cpp:267-318). There is noconductortable at all.projectDataBase::addElement(Element*)(projectdatabase.cpp:112-141) populates the element side on every element add/edit; there's no equivalentaddConductor().XRefProperties(sources/properties/xrefproperties.h) plusAssignVariables::formulaToLabel()(used throughoutassignvariables.cpp) resolve "where does the other end of this master/slave link live" across diagrams today. Conductors have no equivalent: a conductor's two terminals must both live in the sameDiagram, so a wire that logically continues onto another folio (a "renvoi"/continuation, matched today only by convention — same label text on both ends) has no structured link the way element cross-refs do. This is exactly the gap plc-user flagged.Conductoris fundamentally a two-terminal edge (terminal1/terminal2,conductor.h). There's no third category for an N-way junction node.Proposed scope
Rather than trying to make QET aware of FreeCAD specifically, close the gap that's forcing every such external tool (this script, and any future one) to re-implement the same XML-parsing and folio-resolution work QET already does internally for elements:
conductortable to the project database, mirroringelement/element_info: one row per conductor with both resolved terminal/element UUIDs, both resolved labels, and diagram UUID — same shape and sameaddElement-style incremental population, just for conductors instead of elements. This alone would letQetWireManager-style tools query a stable schema instead of hand-parsing conductor XML.Conductor/Diagramobject model, not just better data exposure.Related, not proposed here
A native "export wire list" (CSV/table) UI feature, analogous to the existing nomenclature/summary table types, would be a natural consumer of the new conductor table once it exists — but the actual blocker for tools like QetWireManager is the missing structured data, not a missing export button, so that's proposed as the follow-up rather than the headline change.
Happy to build the conductor-table piece if the scope above sounds right.
All reactions