Repository navigation
Replies: 1 comment
|
Correction: §5's "real blocker" names dead code. This document says the feature hinges on The whole- Three further corrections, all from @arummler's review on #936, and he is right on each:
Keeping the allocation out of §1–§3 and §6 stand, and phases 0–1 are unaffected: switching on a field that has been disabled since 2020 and reporting over it remains the highest-value work here. Superseded by #956, which rebuilds the plan around a fact I had not found when writing this: the cable data layer was committed complete on 2020-09-24 and its UI disabled the same day, and 34 language files have since translated a string whose visible value is |
Uh oh!
There was an error while loading. Please reload this page.
The specification for the layer discussion #934
deferred — a cable that owns its cores, and a way to allocate those cores to
individual conductors on the drawing.
Status: proposed, nothing built. Every code reference below was checked
against master
ef1fbd79b; every element-collection fact against the shippedcollection; forum and issue evidence gathered 2026-09-20.
Read #934 first. It covers levels 1 and 2 — the
cable string made searchable and reportable — and its phases 1 and 2 remain
the right first work. This document is its level 3, and it exists because
level 3 was left as "needs a decision" without ever being specified.
1. The ask, and an honest correction
The request that prompted this: select a marker symbol, drop it on a wire, get
a dialog offering cable types from a database with a known core count, then keep
placing that marker on other wires until the cores are used up — with the spare
cores visible.
Nobody on the forum has asked for that. Eleven years of requests split three
ways, and none of them is this:
Spare-core tracking appears in zero threads. Three separate people have
written external Python tools to get the report alone.
That is not an argument against the marker. The marker is
AutoCAD Electrical's cable marker,
shipping for twenty years: a parent marker carries the cable's identity and part
number, and each child marker inherits the tag and is offered the next unused
core. SEE Electrical ships the marker and the draw-across-wires gesture as
two entry points to the same data.
So the gesture is not the decision. Both gestures write the same rows. The
decision is whether a cable becomes an object. Build the object, ship the report
that has been asked for seven times, and the marker is one of two ways to fill
it in.
2. What already exists — more than anyone assumed
The symbol is already shipped
10_allpole/120_cables_wiring/filerie.elmt— "Filerie", "Wiring","Verdrahtung", named in 11 languages:
That folder holds 57 cable elements:
cable…cable6,kabel3g/4g/7g/8g,ecran_3p,m_cable_designation,fil_de_cable, and a wholem_cable_02p…10p_mux/demuxfamily with numbered cores.Across all 57, the only machine-readable fields are
label(16),designation(1) and
description(1). No core count, no cable type, no core index. Thedrawing vocabulary is rich and complete; nothing behind it can be queried,
counted or reported. That is the entire gap in one sentence.
The UI slot was built and never filled
The terminal strip editor has
CABLE_CELL = 9andCABLE_WIRE_CELL = 10,headed "Câble" and "Couleur / numéro de fil câble"
(
TerminalStrip/ui/terminalstripmodel.cpp:44-45, 292-293), fed byRealTerminal::cable()andcableWire()— both stubs returningQString()(TerminalStrip/realterminal.cpp:162-172). Someone designed thedisplay and the data never arrived.
The field exists and cannot even be typed into
ConductorProperties::m_cableandm_busare plainQString(
conductorproperties.h:97-98), persisted as attributes on<conductor>(
conductorproperties.cpp:286, read:345). TheirQLineEdits are disabled:TODO_LISTis commented out incmake/developer_options.cmake:32, so thedisabling arm is live in every normal build. The one field a cable feature
would build on cannot be typed into today.
sources/dataBase/contains zero occurrences of "cable".The catalogue exists as an open PR
#936
(restoring @Gokulakannan750's #529) gives
WireSpec—numCores, per-corecolours, per-core sections, shield — backed by a working SQLite store with CRUD,
search, CSV and tests, plus a per-core selector UI with IEC 60757 swatches.
Two limits decide how it is used here:
wireId, sothree separate 4-core W63 runs in one project are one row.
assignSelectedWire()bakes the chosen core into a display string(
"W31:3 0.5mm² Brown") in the label field; onlywireIdreachesm_cable. The core index is not stored machine-readably anywhere.3. Why the last two attempts died
Both stopped at the same place, and it was not the drawing.
Cable.webm)cable_assist, 2026 (forum 3144)Every one built the drawing. None built the object. That is why the
current state reads as underwhelming: it is a catalogue nothing consumes, on top
of 57 symbols nothing can query.
Joshua's own condition for doing this properly — stated in forum 1382, that
cable management needs terminal blocks and element terminals first — is now
satisfied. Both exist.
4. The model
Three layers. Every professional tool has all three; QET has one and a half.
_W0_CBLWIRES, SOLIDWORKS Cable References Manager, EPLAN part templatesThe one rule that makes the model work
This resolves the contradiction #934 identified. A cable's core count cannot
be derived — a 7-core cable with 4 used has 3 cores no conductor hangs on. But
once the instance carries the count, "which cores are spare" is simply
count − (conductors referencing this cable), computed by one SQL query. Noback-reference list, no orphan bookkeeping.
Persisted shape — additive only
Two optional attributes beside the existing
cableon<conductor>:One new project-level block, the same shape as the existing
<terminal_strips>and
<newdiagrams>blocks that the maintainer already accepts:The instance snapshots its cores from the catalogue at creation. It does not
chase the catalogue afterwards. This is what EPLAN does (fixed function
templates) and what ACE does (copying the conductor list onto the marker), and
it is non-negotiable here for a specific reason: #936's catalogue lives at
<AppDataLocation>/wirecatalogue.sqlite— per-user and global, not in the.qet. Without snapshotting, a project opened on another machine loses everycore count, colour and spare report.
ConductorProperties::fromXmlreads bye.attribute(...), and unknown childelements are ignored on load, so an older QET opening the file keeps working and
still shows the human-readable
cablestring. Nothing existing changes meaning.Database
Per the repository's own data-direction rules — never add persisted state the
database does not know about, populate it from the document rather than from
constructed scenes, and do not add another scene-walker — two new tables,
cableandcable_core,populated from the document, not from constructed scenes;
cableandcable_corecolumns added to the existingconductortable. The database isderived and rebuilt every load, so this costs no migration and no versioning.
Every report is then a query, and no thirty-eighth scene-walker is added.
5. The three hazards, and what to do about them
These decide whether the feature is buildable. A design that ducks them is
worthless.
H1 — core identity fights the potential model (the real blocker)
Conductor::setPropertyToPotential()(conductor.cpp:1630) has two branches,and they differ in exactly the way that matters:
Conductor labels are potential-scoped by design and per-segment labelling has
been rejected before. A core allocation is inherently per-segment: core 3 runs
from A to B, and the conductor on the far side of a terminal is a different core
or no core at all. The
elsebranch therefore smears one core's identity acrossa whole potential.
Resolution, and it is smaller than it looks. The
ifbranch is already aselective copy of a named subset — the precedent exists six lines above the
problem. Cable identity (
m_cable,cable_uuid,cable_core) is excluded fromthe
elsebranch the same way. #936 already depends on this rule: itsassignment path unticks "apply to all" precisely because different conductors of
one potential carry different cores.
This is the decision to settle before any code. It is a genuine, if narrow,
departure from "properties belong to the potential", and the maintainer has
declined that direction before in a different context. If the answer is no, the
feature cannot be built as specified and the honest response is to stop at
#934's phases 1 and 2.
H2 — an element marker cuts the wire
autoBreakConductors()runs on every element placement when the project settingis on.
filerie.elmthas two terminals, so dropping it does split theconductor in two — and then neither half is obviously "the" conductor carrying
core 3.
Resolution. The marker is not an element. It is a graphics item anchored
to the conductor, following the one existing precedent for exactly that:
ConductorTextItemis aQGraphicsItemchild of theConductor(
conductor.cpp:128), positioned byposForText()/middleSegment()/calculateTextItemPosition()(:1348, :1324, :1411), withmoved_by_user_/rotate_by_user_flags so it survives path changes.filerie.elmtkeeps its existing job as a hand-drawn annotation. The allocationmarker is a new, lighter thing that never splits a wire.
H3 — lifecycle
Delete a conductor, split one, merge a potential, copy a folio.
Resolution follows from the one rule. Because the conductor points at the
cable and never the reverse, deleting a conductor frees its core with no
bookkeeping — the next
SELECTsimply returns one fewer allocation. Copying afolio duplicates the attributes, which is the one case needing explicit
handling: a pasted conductor must either keep the allocation (same cable
continues onto the new folio) or drop it. Recommend: drop it, matching
paste's existing treatment of PLC slave data, and surface it in the report.
6. Over- and under-allocation: report, never block
EPLAN validates both directions as check-run messages — P003011 "too many
cable connections" and P003028 "cable does not use all the cable connections
of the part". It does not refuse the edit.
Do the same. Offer only unused cores in the picker so over-allocation is hard to
reach by accident, but if a user exceeds the count, allow it and flag it. A
cautious maintainer will accept a new report far more readily than a new way for
the application to refuse an edit, and a design-rule-check report is the natural
home for them.
7. Phases
Each ships something visible. Phase 1 needs no new persisted state at all.
Phase 0 — unblock the field. The
cableandbusline edits sit in the#elsearm of a#if TODO_LISTblock (ui/conductorpropertieswidget.cpp:245-250),and
TODO_LISTis commented out incmake/developer_options.cmake:32— so thedisabling arm is live in every normal build and the fields have never been
usable. Removing the guard makes #934's phase 1 meaningful,
because there is otherwise no way to put a value in the field it proposes to
search, export and report on.
Phase 1 — the report everyone actually asked for. #934's phases 1 and 2,
unchanged: search & replace, database columns, a
cablecolumnon
--export-cables, select-all-by-cable, and the cable schedule as CSV and asan on-diagram table. Closes seven citable requests, and fills the terminal
strip's two blank columns. No format change.
Phase 2 — the cable instance. The
<cables>block, thecableandcable_coretables, and a cable manager dialog to create instances from acatalogue type. Spare cores become real and reportable. Additive format change.
Phase 3 — allocation.
cable_uuid/cable_coreon<conductor>, theH1 propagation exclusion, and the conductor-anchored marker with its
next-unused-core picker. This is the requested feature, and it is last because
everything above it has to exist first.
Phase 4 — the second gesture. The draw-a-line-across-wires entry point,
which the forum has asked for five times. It inserts N allocations; the data
model is untouched.
First PR
Phase 0 plus the Search & Replace half of phase 1: add
m_cable/m_bustoapplyChange()andreplaceAdvanced()inSearchAndReplace/searchandreplaceworker.cpp:420-440, two fields in theSearch & Replace UI, and delete the
setDisabledpair. Small, self-contained,no format change, and it turns a write-only field into a maintainable one.
8. Decisions needed
downstream of phase 2 depends on this.
0–1 the right answer for QET?
(Snapshot assumed, for the per-user-database reason in §4.)
busfollowcablethroughout?9. Non-goals
a 3D tool; different feature.
cablevalues. They stay, and a projectthat never creates an instance behaves exactly as today.
10. On abandoning the current work
#897 is not cable work. It is the IEC 81346 designation-letter PR — open,
mergeable, with live review. Abandoning it buys this nothing.
#936 should not be abandoned either. It is the type library, which every
tool surveyed has as a distinct layer, and it is sound. Its problem is that it
was presented as the feature when it is the foundation. Land it as the
catalogue, fix the per-user scoping by snapshotting at instance creation, and
build the instance and allocation on top.
Restarting would discard a working catalogue, colour picker and IEC 60757
implementation to rebuild the one layer that already exists.
All reactions