|
KiCad PCB EDA Suite
|
A net chain is a collection of nets that are connected together through passive components. More...
#include <sch_netchain.h>
Public Member Functions | |
| SCH_NETCHAIN () | |
| void | SetName (const wxString &aName) |
| const wxString & | GetName () const |
| void | AddNet (const wxString &aNet) |
| void | RemoveNet (const wxString &aNet) |
| void | ReplaceNets (const std::set< wxString > &aNew) |
| void | AddSymbol (class SCH_SYMBOL *aSymbol) |
| const std::set< class SCH_SYMBOL * > & | GetSymbols () const |
| void | AbsorbSymbolsFrom (const SCH_NETCHAIN &aOther) |
| void | ClearSymbols () |
| const std::set< wxString > & | GetNets () const |
| const std::vector< wxString > & | GetOrderedNets (CONNECTION_GRAPH *aGraph) const |
| Return the chain's member nets ordered from terminal pin A's net to terminal pin B's net along the shortest bridge-graph path; any off-path member nets (branches) are appended alphabetically. | |
| wxString | GetTerminalNetName (int aIdx, CONNECTION_GRAPH *aGraph) const |
Resolve terminal pin aIdx (0 or 1) to the net-chain key of its owning subgraph via aGraph. | |
| void | SetTerminalPins (const KIID &aPinA, const KIID &aPinB) |
| const KIID & | GetTerminalPinA () const |
| const KIID & | GetTerminalPinB () const |
| void | ReplaceTerminalPin (const KIID &aPrev, const KIID &aNew) |
| void | SetNetClass (const wxString &aNetClass) |
| Net chains may override the netclass applied to every member net. | |
| const wxString & | GetNetClass () const |
| void | SetColor (const KIGFX::COLOR4D &aColor) |
| Optional display color for the chain. | |
| const KIGFX::COLOR4D & | GetColor () const |
| void | SetTerminalRefs (const wxString &aRefA, const wxString &aPinA, const wxString &aRefB, const wxString &aPinB) |
| const wxString & | GetTerminalRef (int aIdx) const |
| const wxString & | GetTerminalPinNum (int aIdx) const |
Static Public Member Functions | |
| static bool | IsValidName (const wxString &aName) |
Static Public Attributes | |
| static constexpr char | SYNTHETIC_NET_PREFIX [] = "__SG_" |
| Prefix used when synthesising net names for unnamed subgraphs. | |
Private Attributes | |
| wxString | m_name |
| std::set< wxString > | m_nets |
| std::set< class SCH_SYMBOL * > | m_symbols |
| KIID | m_terminalPins [2] |
| wxString | m_terminalRef [2] |
| wxString | m_terminalPinNum [2] |
| wxString | m_netClass |
| KIGFX::COLOR4D | m_color = KIGFX::COLOR4D::UNSPECIFIED |
| std::vector< wxString > | m_orderedNets |
| bool | m_orderedNetsDirty = true |
A net chain is a collection of nets that are connected together through passive components.
Definition at line 36 of file sch_netchain.h.
|
inline |
Definition at line 43 of file sch_netchain.h.
Referenced by AbsorbSymbolsFrom().
|
inline |
Definition at line 87 of file sch_netchain.h.
References m_orderedNetsDirty, m_symbols, and SCH_NETCHAIN().
|
inline |
Definition at line 60 of file sch_netchain.h.
References m_nets, and m_orderedNetsDirty.
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 79 of file sch_netchain.h.
References m_orderedNetsDirty, and m_symbols.
Referenced by CONNECTION_GRAPH::refreshCommittedChainPayload().
|
inline |
Definition at line 95 of file sch_netchain.h.
References m_orderedNetsDirty, and m_symbols.
Referenced by CONNECTION_GRAPH::refreshCommittedChainPayload().
|
inline |
Definition at line 160 of file sch_netchain.h.
References m_color.
Referenced by BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and SCH_IO_KICAD_SEXPR::Format().
|
inline |
Definition at line 46 of file sch_netchain.h.
References m_name.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), SCH_EDITOR_CONTROL::CreateNetChainBetweenPins(), SCH_IO_KICAD_SEXPR::Format(), SCH_EDITOR_CONTROL::HighlightNetChain(), CONNECTION_GRAPH::RebuildNetChains(), and CONNECTION_GRAPH::refreshCommittedChainPayload().
|
inline |
Definition at line 151 of file sch_netchain.h.
References m_netClass.
Referenced by BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and SCH_IO_KICAD_SEXPR::Format().
|
inline |
Definition at line 101 of file sch_netchain.h.
References m_nets.
Referenced by BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), CONNECTION_GRAPH::CreateNetChainFromPotential(), ORDERED_NETS_FIXTURE::FindLargestPotentialChain(), SCH_IO_KICAD_SEXPR::Format(), CONNECTION_GRAPH::RebuildNetChains(), and CONNECTION_GRAPH::refreshCommittedChainFromPotential().
| const std::vector< wxString > & SCH_NETCHAIN::GetOrderedNets | ( | CONNECTION_GRAPH * | aGraph | ) | const |
Return the chain's member nets ordered from terminal pin A's net to terminal pin B's net along the shortest bridge-graph path; any off-path member nets (branches) are appended alphabetically.
Empty if fewer than two nets, or if the terminal pins are unset / cannot be resolved on aGraph. The returned vector is cached and invalidated by any mutator on this class.
| aGraph | live connection graph the chain belongs to; required to resolve pin KIIDs to nets. Passing nullptr returns an empty vector without caching. |
Definition at line 82 of file sch_netchain.cpp.
References m_nets, m_orderedNets, m_orderedNetsDirty, m_symbols, m_terminalPins, path, and pinA.
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 85 of file sch_netchain.h.
References m_symbols.
Referenced by BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), CONNECTION_GRAPH::CreateNetChainFromPotential(), CONNECTION_GRAPH::RebuildNetChains(), CONNECTION_GRAPH::refreshCommittedChainFromPotential(), CONNECTION_GRAPH::refreshCommittedChainPayload(), and CONNECTION_GRAPH::RenameCommittedNetChain().
| wxString SCH_NETCHAIN::GetTerminalNetName | ( | int | aIdx, |
| CONNECTION_GRAPH * | aGraph ) const |
Resolve terminal pin aIdx (0 or 1) to the net-chain key of its owning subgraph via aGraph.
Returns an empty string if the pin can't be located (e.g. the KIID refers to a removed item) or if aGraph is null.
Definition at line 69 of file sch_netchain.cpp.
References m_terminalPins, and pin.
|
inline |
Definition at line 130 of file sch_netchain.h.
References m_terminalPins.
Referenced by BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), CONNECTION_GRAPH::CreateNetChainFromPotential(), and CONNECTION_GRAPH::refreshCommittedChainFromPotential().
|
inline |
Definition at line 131 of file sch_netchain.h.
References m_terminalPins.
Referenced by BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), CONNECTION_GRAPH::CreateNetChainFromPotential(), and CONNECTION_GRAPH::refreshCommittedChainFromPotential().
|
inline |
Definition at line 176 of file sch_netchain.h.
References m_terminalPinNum.
Referenced by BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), CONNECTION_GRAPH::CreateNetChainFromPotential(), SCH_IO_KICAD_SEXPR::Format(), and CONNECTION_GRAPH::refreshCommittedChainFromPotential().
|
inline |
Definition at line 170 of file sch_netchain.h.
References m_terminalRef.
Referenced by BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), CONNECTION_GRAPH::CreateNetChainFromPotential(), DIALOG_CREATE_NET_CHAIN::findSheetForRow(), SCH_IO_KICAD_SEXPR::Format(), and CONNECTION_GRAPH::refreshCommittedChainFromPotential().
|
inlinestatic |
Definition at line 48 of file sch_netchain.h.
Referenced by CONNECTION_GRAPH::CreateManualNetChain(), PANEL_SETUP_NET_CHAINS::PANEL_SETUP_NET_CHAINS(), PANEL_SETUP_NET_CHAINS::Validate(), and DIALOG_CREATE_NET_CHAIN::validateAndCreate().
|
inline |
Definition at line 66 of file sch_netchain.h.
References m_nets, and m_orderedNetsDirty.
|
inline |
Definition at line 72 of file sch_netchain.h.
References m_nets, and m_orderedNetsDirty.
Referenced by CONNECTION_GRAPH::refreshCommittedChainPayload().
Definition at line 133 of file sch_netchain.h.
References m_orderedNetsDirty, and m_terminalPins.
|
inline |
Optional display color for the chain.
When set to an opaque colour, the PCB and schematic painters prefer it over the default chain highlight emphasis. UNSPECIFIED / fully-transparent means "use the default scheme".
Definition at line 159 of file sch_netchain.h.
References m_color.
Referenced by BOOST_FIXTURE_TEST_CASE().
|
inline |
Definition at line 45 of file sch_netchain.h.
References m_name.
Referenced by CONNECTION_GRAPH::RenameCommittedNetChain().
|
inline |
Net chains may override the netclass applied to every member net.
Empty string means "do not override". The active netclass is propagated to every member when the PCB is updated from the netlist.
Definition at line 150 of file sch_netchain.h.
References m_netClass.
Referenced by BOOST_FIXTURE_TEST_CASE(), and BOOST_FIXTURE_TEST_CASE().
Definition at line 123 of file sch_netchain.h.
References m_orderedNetsDirty, and m_terminalPins.
Referenced by CONNECTION_GRAPH::refreshCommittedChainPayload().
|
inline |
Definition at line 162 of file sch_netchain.h.
References m_terminalPinNum, and m_terminalRef.
Referenced by CONNECTION_GRAPH::refreshCommittedChainPayload().
|
private |
Definition at line 190 of file sch_netchain.h.
Referenced by GetColor(), and SetColor().
|
private |
Definition at line 183 of file sch_netchain.h.
|
private |
Definition at line 189 of file sch_netchain.h.
Referenced by GetNetClass(), and SetNetClass().
|
private |
Definition at line 184 of file sch_netchain.h.
Referenced by AddNet(), GetNets(), GetOrderedNets(), RemoveNet(), and ReplaceNets().
|
mutableprivate |
Definition at line 194 of file sch_netchain.h.
Referenced by GetOrderedNets().
|
mutableprivate |
Definition at line 195 of file sch_netchain.h.
Referenced by AbsorbSymbolsFrom(), AddNet(), AddSymbol(), ClearSymbols(), GetOrderedNets(), RemoveNet(), ReplaceNets(), ReplaceTerminalPin(), and SetTerminalPins().
|
private |
Definition at line 185 of file sch_netchain.h.
Referenced by AbsorbSymbolsFrom(), AddSymbol(), ClearSymbols(), GetOrderedNets(), and GetSymbols().
|
private |
Definition at line 188 of file sch_netchain.h.
Referenced by GetTerminalPinNum(), and SetTerminalRefs().
|
private |
Definition at line 186 of file sch_netchain.h.
Referenced by GetOrderedNets(), GetTerminalNetName(), GetTerminalPinA(), GetTerminalPinB(), ReplaceTerminalPin(), and SetTerminalPins().
|
private |
Definition at line 187 of file sch_netchain.h.
Referenced by GetTerminalRef(), and SetTerminalRefs().
|
staticconstexpr |
Prefix used when synthesising net names for unnamed subgraphs.
Such names embed the per-run subgraph code and so are not stable across reloads.
Definition at line 41 of file sch_netchain.h.
Referenced by CONNECTION_GRAPH::ApplyNetChainNetclasses(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), CONNECTION_GRAPH::CreateNetChainFromPotential(), SCH_IO_KICAD_SEXPR::Format(), CONNECTION_GRAPH::MakeNetChainKey(), and NETLIST_EXPORTER_XML::makeNetChains().