kicad2ems.gui.schematicview¶
Editable simulation schematic, and importing KiCad parts into it.
- class kicad2ems.gui.schematicview.CircuitScene(parent=None)[source]¶
The parts in columns by where they sit in the power path (their group), the rails as flags at their pins, the other nets as wires from pin to pin, each with its name; selecting a part lights its nets.
- static around(p, dp, q, dq, lane, cards)[source]¶
A wire from pin p to pin q round the cards, when the lanes' route would go through one: the shortest path with the fewest corners along the lines that pass just outside every card (and through the two pins' stubs); None when there is none.
- static crosses(pts, cards)[source]¶
Whether a wire's corners take it through a card (2 px inside one).
- static default_positions(records)[source]¶
Columns by the parts' groups (where each sits along the power's path), a part under another by its reference; one stood up takes two rows.
- orient()[source]¶
The parts nobody turned, each the way round (as it stands, or flipped) that brings its pins nearest the parts they connect to, so a wire does not wrap round its own part; rails count for nothing (a flag).
- static route(p, i, q, j, lane=0, dp=None, dq=None)[source]¶
A wire's corners from pin p (side i: 0 left, 1 right) to pin q, through free space only: out of each pin to its channel (CHANNEL beyond the pin, between the columns); two pins facing across one gap meet in it; else the wire runs along the gap under the upper pin's row, which no card or flag reaches.
- class kicad2ems.gui.schematicview.DeviceItem(record, scene, rotation=None)[source]¶
A part: its reference and value over its symbol, a pin each side; a pin on a rail carries the rail's flag (ground's symbol, else its name), so the busiest nets need no wires.
- facing(index)[source]¶
The way pin `index` points out of the part, a unit step (dx, dy) in the scene.
- static natural(record)[source]¶
How a part stands before anyone turns it: a part to ground and a winding stood up, the rest along the flow.
- class kicad2ems.gui.schematicview.SchematicEditor(parent=None)[source]¶
-
- static check(config, before=None)[source]¶
Raise what is wrong with a model, by pcbqs.circuit's own checks, down to the deck it would run. A blank model (no parts yet: a new circuit) is one to start from: nothing to check; one drawn from it (before: the model the edit started from, which made no deck either) need not make a deck yet (a source and no drive: no period), only be a model.
- review(document, current)[source]¶
The parts to import and whether to move the existing ones: the review dialog's answer, or None.
- rotate_part(key, degrees)[source]¶
Turn a part by `degrees` (clockwise, a multiple of 90) from how it stands; 0: leave it to the generator again. Kept with the model (schematic.rotations, only the parts turned by hand), undoable.
- kicad2ems.gui.schematicview.kind_colors(kind)[source]¶
A part kind's ink and fill (colour-blind-safe hues; amber is kept for the selection).
- kicad2ems.gui.schematicview.rails_of(records, threshold=4)[source]¶
The nets drawn as flags at their pins instead of wires: ground, and any net on `threshold` pins or more.
- kicad2ems.gui.schematicview.records(config)[source]¶
The general model's parts as the scene's records. A column each by how far along the power's path a part sits: the nets are numbered outward from the source (one further across every part that is not to ground, and across a coupling), a part to ground stands in its net's column and a part between two nets in the column between them; the load ends the row. Nothing here goes by a reference or a net's name.