Repository navigation
Circuits: devices on a distribution board behind a breaker - #362
Merged
Merged
Conversation
…panel data The first part of IPedrax#179, on current main. A distribution board (an equipment component) holds its distribution system, its mains in amperes, the single-pole breakers it takes (Max IPedrax#1 Pole Breakers) and the board that supplies it. The panel command sets them by those names ("" takes one away; with no id it lists the boards and what each feeds). Boards make a tree: a board is never supplied from itself or from one it feeds, and the refusal names the chain. Deleting a board leaves the boards it fed without a supply; a distribution system a board is on cannot be deleted, and follows a rename. Component schedules get Distribution System, Mains, Max IPedrax#1 Pole Breakers and Supply From; Properties has an Electrical group for a board. IFC writes each system a board is on as an electrical IfcDistributionSystem and the rest in BIMCraft_Panel, and reads them back. On main since IPedrax#179: the board check runs with each element, so check_changed answers as check does; the indexed delete clears a fed board's supply as the full one does; IFC GlobalId roles 59 to 63. Co-authored-by: Polyglot <[email protected]>
The second part of IPedrax#179, on the boards of IPedrax#357. A circuit is an element (file format 19): its board, a number of its own on it, a name, the breaker in amperes, its poles, the voltage it is at, a classification, a demand factor, its devices and its wires. The devices' voltage, poles and load are their family's power connector's, so nothing is typed on a circuit. The model refuses a device outside the circuit's voltage band or with other poles, a device in two circuits, a breaker above the board's mains, poles past the system's phases or the board's slots, a number the board has already, and a section its wire type has no row for. A circuit's load is worked out from its devices and never saved. circuit keeps its NBR 5410 sizing mode; given a key of a model circuit it makes, changes, lists or deletes one as an undo step. A deleted device leaves its circuit; a deleted board takes its circuits. IFC writes each circuit as an IfcDistributionCircuit with its breaker and reads it back, and the import reads a device's connector sets into its family. Plans draw a circuit's home run and number; Properties edits a circuit and Electrical > Create Circuit makes one. On main since IPedrax#179: check_circuits runs in check_changed too; the indexed delete takes a board's circuits and drops deleted devices; format 19; IFC GlobalId roles 64 to 70. Co-authored-by: Polyglot <[email protected]>
Main's Assistant brought the root to its 3,000 words, so the line names panels in the words it had; the detail is in docs/areas/structure-and-mep.md.
Main's Assistant, by the updated panel-boards. The interface catalogs conflicted (both sides' translations kept, then cargo i18n update) and so did the electrical.rs line of CLAUDE.md, which now names circuits too; the nbr5410.rs line drops three words it repeated, so the root stays within its 3,000.
Closed
A component's `panel` (its distribution system, mains, slots and the board that supplies it) joins 18's notes and the 17-to-18 comment of Model::migrate: a build that reads up to 17 would leave it out as a field it doesn't know, and a file of 17 has none.
…s name it The import kept a copy of a BIMCraft_Panel set's properties for every product a relation named, whether or not the file had it, so one set of many properties related to many ids made a small file ask for their product in memory. PropertySets reads each set once, its properties by name, and keeps for each product of the file the sets on it; the boards look their values up there. A hostile file of 50,000 properties on 100,000 products opens, and the boards keep what their own sets say.
…and 62 Main gave 61 and 62 to a wall's BIMCraft_Wall set while this branch gave them to the IfcDistributionSystem and its IfcRelAssignsToGroup, so a wall and a system keyed to the same number would have written one GlobalId for two objects. They take 71 and 72, which neither main nor the circuits that follow on this board's data use (64 to 70), and a test reads the roles from the source and fails on any number two of them share.
Every file change since 0.11 shares 18, so circuits take no format of their own: FORMAT is 18 again, 18's notes and the 17-to-18 comment of Model::migrate name them, and the area's note says a circuit is an element of format 18 (it said 13).
…er many products name them As the board's set was, a BIMCraft_Circuit set was copied for every product a relation named, and a device's Pset_ElectricalDeviceCommon and BIMCraft_Connector were appended to a list for every product and every relation, whether or not the file had the product: one set of many properties on many ids asked for their product in memory. Both now go through PropertySets, each set held once. A device's system is one of the three BIMCraft writes, kept as that word, not a copy of whatever the file says; a system it doesn't know was read as a switch, and now gives no connector. A circuit's devices were found by walking every product's group for each circuit, the circuits times the products: the groups' members are gathered once. A hostile file of two sets of 50,000 properties on 100,000 ids opens and the circuit comes back whole.
…ch (and main) into circuits
Taking main's catalogs in the merge and regenerating them kept every msgid but dropped the seven Portuguese translations this branch had written for the board's Properties (Distribution System, Mains, Max IPedrax#1 Pole Breakers, Supplies, Supply From and two refusals); they are filled back from the branch's own catalog.
As on the boards' branch, regenerating main's catalogs dropped the fifteen Portuguese translations this branch had written for circuits (Create Circuit, the Electrical group's labels and its prompts); they are filled back from the branch's own catalog.
ffishman
added a commit
to ffishman/BIMCraft
that referenced
this pull request
Nov 11, 2026
IPedrax
added a commit
that referenced
this pull request
Nov 12, 2026
63 to 66 are free on main, but the distribution boards' branch (maint/pr-357, and #362 and #363 after it) takes 59, 60 and 63 to 72, and the grid's take 73 and 74 (maint/pr-319); no open pull request names a role above 72. The site's property sets take the next free ones, so whichever lands first, no two roles share a number.
IPedrax
added a commit
to jonaswre/BIMCraft
that referenced
this pull request
Nov 12, 2026
63 to 66 are free on main, but the distribution boards' branch (maint/pr-357, and IPedrax#362 and IPedrax#363 after it) takes 59, 60 and 63 to 72, and the grid's take 73 and 74 (maint/pr-319); no open pull request names a role above 72. The site's property sets take the next free ones, so whichever lands first, no two roles share a number.
IPedrax
added a commit
to jonaswre/BIMCraft
that referenced
this pull request
Nov 12, 2026
59 and 60 are free on main, but the distribution boards' branch (maint/pr-357, and IPedrax#362 and IPedrax#363 after it) takes 59, 60 and 63 to 72, and no open pull request names a role above 72. The grid's roles take the next free ones, so whichever lands first, no two roles share a number.
IPedrax
added a commit
to ffishman/BIMCraft
that referenced
this pull request
Nov 12, 2026
emilianocapasso
pushed a commit
to acpvarchitects/BIMCraft
that referenced
this pull request
Nov 12, 2026
The last part of IPedrax#179, on the circuits of IPedrax#362. A panel schedule is a view of a board (the panel_schedule command, Electrical > Panel Schedule) that goes on a sheet and prints with it: a header, a row for each slot with spares and spaces drawn differently, the load by classification and by phase, and notes. A circuit's number is now its slot (a circuit of p poles takes n, n+2, ...), each slot on a phase, so the phases add up to the board's load. demand_factors holds a share for each classification, applied in the summary and in the board's totals. Circuits are edited in the view, and a slot is marked a spare or a space. The Project Browser lists panel schedules in their own group. On main since IPedrax#179: a panel schedule is a rare category, part of the drawing set and one of Model::views; check_demand_factors runs in check_changed too; the indexed delete takes a board's panel schedules; file format 20; two doc lines that said circuits were not elements yet. Co-authored-by: Polyglot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The second of the three PRs that bring #179 by @PolyglotOpenstreetmap onto current main: circuits, on top of the boards of #357 (stacked; only the last commit is new here). The design is his commits 02ddfcb and 3972b88.
A circuit is an element (file format 19): its board, a number of its own on that board, a name, the breaker in amperes, its poles, the voltage it is at, a classification, a demand factor, its devices and its wires. The devices' voltage, poles and load come from their family's power connector, so nothing is typed on a circuit. The model refuses:
A circuit's load (installed and demand VA, each pole's load, the current) is worked out from its devices and never saved; a board's element,
panelandinspectcarry the totals. A spare (no device) and a breaker its wire can't carry are warnings.circuitkeeps both modes in one command: with a key of a model circuit (devices,panel,id,add,remove,rating,poles,voltage,wires,delete,list…) it makes, changes, lists or deletes one as an undo step; with the NBR 5410 sizing keys, or none, it sizes as before and makes no step. Mixing both is refused. A deleted device leaves its circuit, a deleted board takes its circuits.IFC writes each circuit as an
IfcDistributionCircuitwith its breaker and reads it back; the import now also reads a device'sPset_ElectricalDeviceCommonandBIMCraft_Connectorinto a connector on its family, so devices keep their load through a round trip. Plans draw a circuit's home run and number at its board's level. Properties edits a selected circuit; Electrical > Create Circuit makes one from a board and devices.What changed from the original commits, for main as it is now:
check_circuitsalso runs incheck_changed(circuits are held to each other, their boards and devices), so the incremental check answers as the full one does.delete_indexedtakes a board's circuits and takes deleted devices out of circuits, asdelete_from_scratchdoes.Checks:
cargo fmt --check,cargo clippy --workspace --all-targets -D warnings,cargo test --workspace,cargo i18n check.The commit carries
Co-authored-by: Polyglot <[email protected]>.