KiCad PCB EDA Suite
Loading...
Searching...
No Matches
SCH_NETCHAIN Class Reference

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
 
void SetTerminalPins (const KIID &aPinA, const KIID &aPinB)
 
const KIIDGetTerminalPinA () const
 
const KIIDGetTerminalPinB () const
 
const KIID_PATHGetTerminalPath (int aIdx) const
 
void SetTerminalPaths (const KIID_PATH &aPathA, const KIID_PATH &aPathB)
 
bool IsTerminal (const KIID &aPin, const KIID_PATH &aSheet) const
 
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::COLOR4DGetColor () 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 wxString MakeKey (const wxString &aName, uint32_t aComponent)
 
static bool IsPersistableNet (const wxString &aNet)
 Synthetic keys do not survive a reload, so only named nets are written out.
 
static bool IsValidName (const wxString &aName)
 

Static Public Attributes

static constexpr wxStringCharType SYNTHETIC_NET_PREFIX [] = wxS( "__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]
 
KIID_PATH m_terminalPaths [2]
 
wxString m_terminalRef [2]
 
wxString m_terminalPinNum [2]
 
wxString m_netClass
 
KIGFX::COLOR4D m_color = KIGFX::COLOR4D::UNSPECIFIED
 

Friends

void swap (SCH_NETCHAIN &aLeft, SCH_NETCHAIN &aRight) noexcept
 

Detailed Description

A net chain is a collection of nets that are connected together through passive components.

Definition at line 35 of file sch_netchain.h.

Constructor & Destructor Documentation

◆ SCH_NETCHAIN()

SCH_NETCHAIN::SCH_NETCHAIN ( )
inline

Definition at line 50 of file sch_netchain.h.

Referenced by AbsorbSymbolsFrom(), and swap.

Member Function Documentation

◆ AbsorbSymbolsFrom()

void SCH_NETCHAIN::AbsorbSymbolsFrom ( const SCH_NETCHAIN & aOther)
inline

Definition at line 110 of file sch_netchain.h.

References m_symbols, and SCH_NETCHAIN().

◆ AddNet()

void SCH_NETCHAIN::AddNet ( const wxString & aNet)
inline

Definition at line 87 of file sch_netchain.h.

References m_nets.

◆ AddSymbol()

void SCH_NETCHAIN::AddSymbol ( class SCH_SYMBOL * aSymbol)
inline

◆ ClearSymbols()

void SCH_NETCHAIN::ClearSymbols ( )
inline

◆ GetColor()

const KIGFX::COLOR4D & SCH_NETCHAIN::GetColor ( ) const
inline

◆ GetName()

◆ GetNetClass()

◆ GetNets()

◆ GetSymbols()

◆ GetTerminalPath()

◆ GetTerminalPinA()

◆ GetTerminalPinB()

◆ GetTerminalPinNum()

◆ GetTerminalRef()

◆ IsPersistableNet()

static bool SCH_NETCHAIN::IsPersistableNet ( const wxString & aNet)
inlinestatic

Synthetic keys do not survive a reload, so only named nets are written out.

Definition at line 45 of file sch_netchain.h.

References SYNTHETIC_NET_PREFIX.

Referenced by SCH_IO_KICAD_SEXPR::Format(), NETLIST_EXPORTER_XML::makeNetChains(), and SCH_CONNECTIVITY::NETCHAIN_MANAGER::storeMemberNets().

◆ IsTerminal()

bool SCH_NETCHAIN::IsTerminal ( const KIID & aPin,
const KIID_PATH & aSheet ) const
inline

Definition at line 141 of file sch_netchain.h.

References m_terminalPaths, and m_terminalPins.

Referenced by KIGFX::SCH_PAINTER::draw().

◆ IsValidName()

◆ MakeKey()

wxString SCH_NETCHAIN::MakeKey ( const wxString & aName,
uint32_t aComponent )
static

◆ RemoveNet()

void SCH_NETCHAIN::RemoveNet ( const wxString & aNet)
inline

Definition at line 92 of file sch_netchain.h.

References m_nets.

◆ ReplaceNets()

void SCH_NETCHAIN::ReplaceNets ( const std::set< wxString > & aNew)
inline

Definition at line 97 of file sch_netchain.h.

References m_nets.

Referenced by SCH_CONNECTIVITY::NETCHAIN_MANAGER::refreshCommittedChainPayload().

◆ SetColor()

void SCH_NETCHAIN::SetColor ( const KIGFX::COLOR4D & aColor)
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 161 of file sch_netchain.h.

References m_color.

Referenced by BOOST_FIXTURE_TEST_CASE().

◆ SetName()

void SCH_NETCHAIN::SetName ( const wxString & aName)
inline

Definition at line 72 of file sch_netchain.h.

References m_name.

Referenced by SCH_CONNECTIVITY::NETCHAIN_MANAGER::RenameCommittedNetChain().

◆ SetNetClass()

void SCH_NETCHAIN::SetNetClass ( const wxString & aNetClass)
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 152 of file sch_netchain.h.

References m_netClass.

Referenced by BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and BOOST_FIXTURE_TEST_CASE().

◆ SetTerminalPaths()

void SCH_NETCHAIN::SetTerminalPaths ( const KIID_PATH & aPathA,
const KIID_PATH & aPathB )
inline

◆ SetTerminalPins()

void SCH_NETCHAIN::SetTerminalPins ( const KIID & aPinA,
const KIID & aPinB )
inline

◆ SetTerminalRefs()

void SCH_NETCHAIN::SetTerminalRefs ( const wxString & aRefA,
const wxString & aPinA,
const wxString & aRefB,
const wxString & aPinB )
inline

Friends And Related Symbol Documentation

◆ swap

void swap ( SCH_NETCHAIN & aLeft,
SCH_NETCHAIN & aRight )
friend

Definition at line 52 of file sch_netchain.h.

References SCH_NETCHAIN(), swap, and T.

Member Data Documentation

◆ m_color

KIGFX::COLOR4D SCH_NETCHAIN::m_color = KIGFX::COLOR4D::UNSPECIFIED
private

Definition at line 193 of file sch_netchain.h.

Referenced by GetColor(), and SetColor().

◆ m_name

wxString SCH_NETCHAIN::m_name
private

Definition at line 185 of file sch_netchain.h.

Referenced by GetName(), and SetName().

◆ m_netClass

wxString SCH_NETCHAIN::m_netClass
private

Definition at line 192 of file sch_netchain.h.

Referenced by GetNetClass(), and SetNetClass().

◆ m_nets

std::set<wxString> SCH_NETCHAIN::m_nets
private

Definition at line 186 of file sch_netchain.h.

Referenced by AddNet(), GetNets(), RemoveNet(), and ReplaceNets().

◆ m_symbols

std::set<class SCH_SYMBOL*> SCH_NETCHAIN::m_symbols
private

Definition at line 187 of file sch_netchain.h.

Referenced by AbsorbSymbolsFrom(), AddSymbol(), ClearSymbols(), and GetSymbols().

◆ m_terminalPaths

KIID_PATH SCH_NETCHAIN::m_terminalPaths[2]
private

Definition at line 189 of file sch_netchain.h.

Referenced by GetTerminalPath(), IsTerminal(), and SetTerminalPaths().

◆ m_terminalPinNum

wxString SCH_NETCHAIN::m_terminalPinNum[2]
private

Definition at line 191 of file sch_netchain.h.

Referenced by GetTerminalPinNum(), and SetTerminalRefs().

◆ m_terminalPins

KIID SCH_NETCHAIN::m_terminalPins[2]
private

Definition at line 188 of file sch_netchain.h.

Referenced by GetTerminalPinA(), GetTerminalPinB(), IsTerminal(), and SetTerminalPins().

◆ m_terminalRef

wxString SCH_NETCHAIN::m_terminalRef[2]
private

Definition at line 190 of file sch_netchain.h.

Referenced by GetTerminalRef(), and SetTerminalRefs().

◆ SYNTHETIC_NET_PREFIX

wxStringCharType SCH_NETCHAIN::SYNTHETIC_NET_PREFIX[] = wxS( "__SG_" )
staticconstexpr

Prefix used when synthesising net names for unnamed subgraphs.

Such names embed a per-run component identity and so are not stable across reloads.

Definition at line 40 of file sch_netchain.h.

Referenced by SCH_CONNECTIVITY::NETCHAIN_MANAGER::ApplyNetChainNetclasses(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), IsPersistableNet(), and MakeKey().


The documentation for this class was generated from the following files: