Skip to main content

Crate brep_ecad_egui

Crate brep_ecad_egui 

Source
Expand description

Embeddable egui editors for BREP_ecad_core documents: schematic and wiring-diagram sheets, the board, symbols and pads (footprints).

The host owns file I/O and application chrome. Editor edits the Document it holds; call Editor::toolbar and Editor::show each frame and take Editor::take_change to learn that something changed. actions() lists every command, named and grouped, for a host’s toolbar, menus and automation. SymbolEditor and FootprintEditor edit one symbol or one footprint. See the README for an example.

Modules§

widgets
Shared egui form widgets.

Structs§

Action
One command of an editor T. Its predicates read the editor, so they answer for the current state.
Change
An edit the host has not taken yet; see Editor::take_change.
Editor
FootprintEditor
Draws one footprint: its pads, holes, and silkscreen. The host places Self::toolbar, Self::properties, and Self::show, runs commands from pad_actions by id, and takes each edit with Self::take_change.
Part
A part the host offers to place: its own key and version, the name to show, the symbol and pads a placed component copies, and the label it goes by.
PinPoints
What a HOST’s model says this symbol’s pins bind to.
SymbolEditor
Draws one symbol: its outlines, text, and pins. The host places Self::toolbar, Self::properties, and Self::show, runs commands from symbol_actions by id, and takes each edit with Self::take_change.

Enums§

ActionGroup
Where an action sits in the editor’s own toolbar.
BoardSelection
BoardTool
Selection
Tool
View

Constants§

POWER_NETS
The power symbols the Power tool offers by name; any other name may be typed.
ZONE_MARGIN
How far the board zone on a sheet reaches past the parts on the board: 5.08 mm.

Functions§

actions
Every action the sheet and board editor has, in toolbar order.
is_ground
Whether a power net’s symbol is drawn as a ground, bars below its pin, rather than as a supply, an arrow above it.
keys_reach_editor
Whether an eCAD editor that is up takes this frame’s keys: every key, wherever the pointer is, unless a TEXT FIELD has the keyboard (in the Inspector, a side pane, the tool card or a window). All four editors ask this before their shortcuts: Diagram and PCB in their own show, Symbol and Pads in their run_shortcuts. The host’s Delete and Escape on an eCAD workbench ask it too. Not egui_wants_keyboard_input: that is ANY focused widget, and a button reached by Tab would take R from the editor while doing nothing with it.
pad_actions
Every command of the pads editor, in toolbar order.
power_symbol
The power symbol for net name, as KiCad’s power library draws one: a single hidden power input pin at its origin, named for the net, under reference #PWR. Document::place names the pin’s net after Symbol::power_net, so every power symbol of one name is one net; the board and the parts list leave it out, as they leave out KiCad’s. Its pin is a power INPUT, as KiCad’s is, so it does not drive the net: a net fed from off the sheet still wants a power flag (Tool::PowerFlag).
symbol_actions
Every command of the symbol editor, in toolbar order.