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

Store information read from a netlist along with the flags used to update the NETLIST in the BOARD. More...

#include <netlist.h>

Public Member Functions

 NETLIST ()
 
virtual ~NETLIST ()=default
 
bool IsEmpty () const
 
void Clear ()
 Remove all components from the netlist.
 
unsigned GetCount () const
 
COMPONENTGetComponent (unsigned aIndex)
 Return the COMPONENT at aIndex.
 
void AddComponent (COMPONENT *aComponent)
 Add aComponent to the NETLIST.
 
void AddGroup (NETLIST_GROUP *aGroup)
 
NETLIST_GROUPGetGroupByUuid (const KIID &aUuid)
 Return a NETLIST_GROUP by aUuid.
 
void ApplyGroupMembership ()
 After groups and components are parsed, apply the group memberships to the internal components based on the group member UUIDs.
 
COMPONENTGetComponentByReference (const wxString &aReference)
 Return a COMPONENT by aReference.
 
COMPONENTGetComponentByPath (const KIID_PATH &aPath)
 Return a COMPONENT by aPath.
 
COMPONENTGetComponentByUuid (const KIID &aUuid)
 Return a COMPONENT by aUuid.
 
void SortByFPID ()
 
void SortByReference ()
 
void SetFindByTimeStamp (bool aFindByTimeStamp)
 
bool IsFindByTimeStamp () const
 
void SetReplaceFootprints (bool aReplace)
 
bool GetReplaceFootprints () const
 
bool AnyFootprintsLinked () const
 
void Format (const char *aDocName, OUTPUTFORMATTER *aOut, int aNestLevel, int aCtl=0)
 
void FormatCvpcbNetlist (OUTPUTFORMATTER *aOut)
 
 NETLIST ()
 
bool IsEmpty () const
 
void Clear ()
 Remove all components from the netlist.
 
unsigned GetCount () const
 
COMPONENTGetComponent (unsigned aIndex)
 Return the COMPONENT at aIndex.
 
void AddComponent (COMPONENT *aComponent)
 Add aComponent to the NETLIST.
 
void AddGroup (NETLIST_GROUP *aGroup)
 
void SetNetChainFor (const wxString &aNet, const wxString &aNetChain)
 
void AddSignalTerminalPin (const wxString &aNetChain, const wxString &aRef, const wxString &aPin)
 
const std::vector< std::pair< wxString, wxString > > & GetNetChainTerminals (const wxString &aNetChain) const
 
const std::map< wxString, std::vector< std::pair< wxString, wxString > > > & GetNetChainTerminalPins () const
 
wxString GetNetChainFor (const wxString &aNet) const
 
void SetSignalNetClass (const wxString &aNetChain, const wxString &aNetClass)
 
wxString GetSignalNetClass (const wxString &aNetChain) const
 
const std::map< wxString, wxString > & GetNetChainNetClasses () const
 
void SetSignalColor (const wxString &aNetChain, const wxString &aColor)
 Stored as a #RRGGBB or #RRGGBBAA string; empty means "no override".
 
wxString GetSignalColor (const wxString &aNetChain) const
 
const std::map< wxString, wxString > & GetNetChainColors () const
 
void SetSignalChainClass (const wxString &aNetChain, const wxString &aClass)
 Net chain class assignment carried through the netlist for downstream tools.
 
wxString GetSignalChainClass (const wxString &aNetChain) const
 
const std::map< wxString, wxString > & GetSignalChainClasses () const
 
NETLIST_GROUPGetGroupByUuid (const KIID &aUuid)
 Return a NETLIST_GROUP by aUuid.
 
void ApplyGroupMembership ()
 After groups and components are parsed, apply the group memberships to the internal components based on the group member UUIDs.
 
COMPONENTGetComponentByReference (const wxString &aReference)
 Return a COMPONENT by aReference.
 
COMPONENTGetComponentByPath (const KIID_PATH &aPath)
 Return a COMPONENT by aPath.
 
COMPONENTGetComponentByUuid (const KIID &aUuid)
 Return a COMPONENT by aUuid.
 
void SortByFPID ()
 
void SortByReference ()
 
void SetFindByTimeStamp (bool aFindByTimeStamp)
 
bool IsFindByTimeStamp () const
 
void SetReplaceFootprints (bool aReplace)
 
bool GetReplaceFootprints () const
 
bool AnyFootprintsLinked () const
 
void Format (const char *aDocName, OUTPUTFORMATTER *aOut, int aNestLevel, int aCtl=0)
 
void FormatCvpcbNetlist (OUTPUTFORMATTER *aOut)
 
const std::vector< wxString > & GetVariantNames () const
 
void AddVariant (const wxString &aName, const wxString &aDescription=wxEmptyString)
 Add a variant name to the netlist.
 
wxString GetVariantDescription (const wxString &aVariantName) const
 
const std::map< wxString, wxString > & GetVariantDescriptions () const
 

Protected Attributes

COMPONENTS m_components
 
NETLIST_GROUPS m_groups
 
bool m_findByTimeStamp
 
bool m_replaceFootprints
 

Private Attributes

std::map< wxString, wxString > m_netSignals
 
std::map< wxString, std::vector< std::pair< wxString, wxString > > > m_netChainTerminals
 
std::map< wxString, wxString > m_netChainNetClasses
 
std::map< wxString, wxString > m_netChainColors
 
std::map< wxString, wxString > m_signalChainClasses
 
std::vector< wxString > m_variantNames
 
std::map< wxString, wxString > m_variantDescriptions
 

Detailed Description

Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.

Definition at line 276 of file common/netlist_reader/netlist.h.

Constructor & Destructor Documentation

◆ NETLIST() [1/2]

NETLIST::NETLIST ( )
inline

Definition at line 279 of file common/netlist_reader/netlist.h.

References m_findByTimeStamp, and m_replaceFootprints.

◆ ~NETLIST()

virtual NETLIST::~NETLIST ( )
virtualdefault

◆ NETLIST() [2/2]

NETLIST::NETLIST ( )
inline

Definition at line 303 of file pcb_netlist.h.

References m_findByTimeStamp, and m_replaceFootprints.

Member Function Documentation

◆ AddComponent() [1/2]

void NETLIST::AddComponent ( COMPONENT * aComponent)

Add aComponent to the NETLIST.

Note
If aComponent already exists in the NETLIST, aComponent is deleted to prevent memory leaks. An assertion is raised in debug builds.
Parameters
aComponentis the COMPONENT to save to the NETLIST.

Definition at line 178 of file common/netlist_reader/netlist.cpp.

References m_components.

◆ AddComponent() [2/2]

void NETLIST::AddComponent ( COMPONENT * aComponent)

Add aComponent to the NETLIST.

Note
If aComponent already exists in the NETLIST, aComponent is deleted to prevent memory leaks. An assertion is raised in debug builds.
Parameters
aComponentis the COMPONENT to save to the NETLIST.

◆ AddGroup() [1/2]

void NETLIST::AddGroup ( NETLIST_GROUP * aGroup)
Note
If aGroup already exists in the NETLIST, aGroup is deleted to prevent memory leaks. An assertion is raised in debug builds.
Parameters
aGroupis the NETLIST_GROUP to save to the NETLIST.

Definition at line 184 of file common/netlist_reader/netlist.cpp.

References m_groups.

◆ AddGroup() [2/2]

void NETLIST::AddGroup ( NETLIST_GROUP * aGroup)
Note
If aGroup already exists in the NETLIST, aGroup is deleted to prevent memory leaks. An assertion is raised in debug builds.
Parameters
aGroupis the NETLIST_GROUP to save to the NETLIST.

◆ AddSignalTerminalPin()

void NETLIST::AddSignalTerminalPin ( const wxString & aNetChain,
const wxString & aRef,
const wxString & aPin )
inline

Definition at line 355 of file pcb_netlist.h.

References m_netChainTerminals.

◆ AddVariant()

void NETLIST::AddVariant ( const wxString & aName,
const wxString & aDescription = wxEmptyString )
inline

Add a variant name to the netlist.

Definition at line 498 of file pcb_netlist.h.

References m_variantDescriptions, and m_variantNames.

◆ AnyFootprintsLinked() [1/2]

bool NETLIST::AnyFootprintsLinked ( ) const
Returns
true if any component with a footprint link is found.

Definition at line 292 of file common/netlist_reader/netlist.cpp.

References empty(), and m_components.

◆ AnyFootprintsLinked() [2/2]

bool NETLIST::AnyFootprintsLinked ( ) const
Returns
true if any component with a footprint link is found.

◆ ApplyGroupMembership() [1/2]

void NETLIST::ApplyGroupMembership ( )

After groups and components are parsed, apply the group memberships to the internal components based on the group member UUIDs.

Definition at line 304 of file common/netlist_reader/netlist.cpp.

References GetComponentByUuid(), group, m_groups, and COMPONENT::SetGroup().

◆ ApplyGroupMembership() [2/2]

void NETLIST::ApplyGroupMembership ( )

After groups and components are parsed, apply the group memberships to the internal components based on the group member UUIDs.

◆ Clear() [1/2]

void NETLIST::Clear ( )
inline

Remove all components from the netlist.

Definition at line 295 of file common/netlist_reader/netlist.h.

References m_components.

◆ Clear() [2/2]

void NETLIST::Clear ( )
inline

Remove all components from the netlist.

Definition at line 317 of file pcb_netlist.h.

References m_components.

◆ Format() [1/2]

void NETLIST::Format ( const char * aDocName,
OUTPUTFORMATTER * aOut,
int aNestLevel,
int aCtl = 0 )

Definition at line 163 of file common/netlist_reader/netlist.cpp.

References m_components, and OUTPUTFORMATTER::Print().

Referenced by FormatCvpcbNetlist().

◆ Format() [2/2]

void NETLIST::Format ( const char * aDocName,
OUTPUTFORMATTER * aOut,
int aNestLevel,
int aCtl = 0 )

◆ FormatCvpcbNetlist() [1/2]

void NETLIST::FormatCvpcbNetlist ( OUTPUTFORMATTER * aOut)
inline

Definition at line 385 of file common/netlist_reader/netlist.h.

References CTL_FOR_CVPCB, and Format().

◆ FormatCvpcbNetlist() [2/2]

void NETLIST::FormatCvpcbNetlist ( OUTPUTFORMATTER * aOut)
inline

Definition at line 485 of file pcb_netlist.h.

References CTL_FOR_CVPCB, and Format().

◆ GetComponent() [1/2]

◆ GetComponent() [2/2]

COMPONENT * NETLIST::GetComponent ( unsigned aIndex)
inline

Return the COMPONENT at aIndex.

Parameters
aIndexthe index in m_components to fetch.
Returns
a pointer to the COMPONENT at Index.

Definition at line 330 of file pcb_netlist.h.

References m_components.

◆ GetComponentByPath() [1/2]

COMPONENT * NETLIST::GetComponentByPath ( const KIID_PATH & aPath)

Return a COMPONENT by aPath.

Parameters
aPathis the KIID_PATH [ sheetUUID, .., compUUID ] of the COMPONENT.
Returns
a pointer to the COMPONENT that matches aPath if found. Otherwise NULL.

Definition at line 218 of file common/netlist_reader/netlist.cpp.

References m_components.

Referenced by BOARD_NETLIST_UPDATER::UpdateNetlist().

◆ GetComponentByPath() [2/2]

COMPONENT * NETLIST::GetComponentByPath ( const KIID_PATH & aPath)

Return a COMPONENT by aPath.

Parameters
aPathis the KIID_PATH [ sheetUUID, .., compUUID ] of the COMPONENT.
Returns
a pointer to the COMPONENT that matches aPath if found. Otherwise NULL.

◆ GetComponentByReference() [1/2]

COMPONENT * NETLIST::GetComponentByReference ( const wxString & aReference)

Return a COMPONENT by aReference.

Parameters
aReferenceis the reference designator the COMPONENT.
Returns
a pointer to the COMPONENT that matches aReference if found. Otherwise NULL.

Definition at line 201 of file common/netlist_reader/netlist.cpp.

References m_components.

Referenced by CMP_READER::Load(), DRC_TEST_PROVIDER_SCHEMATIC_PARITY::testNetlist(), and BOARD_NETLIST_UPDATER::UpdateNetlist().

◆ GetComponentByReference() [2/2]

COMPONENT * NETLIST::GetComponentByReference ( const wxString & aReference)

Return a COMPONENT by aReference.

Parameters
aReferenceis the reference designator the COMPONENT.
Returns
a pointer to the COMPONENT that matches aReference if found. Otherwise NULL.

◆ GetComponentByUuid() [1/2]

COMPONENT * NETLIST::GetComponentByUuid ( const KIID & aUuid)

Return a COMPONENT by aUuid.

Parameters
aUuidis the KIID of the COMPONENT.
Returns
a pointer to the COMPONENT that matches aUuid if found. Otherwise NULL.

Definition at line 244 of file common/netlist_reader/netlist.cpp.

References m_components.

Referenced by ApplyGroupMembership().

◆ GetComponentByUuid() [2/2]

COMPONENT * NETLIST::GetComponentByUuid ( const KIID & aUuid)

Return a COMPONENT by aUuid.

Parameters
aUuidis the KIID of the COMPONENT.
Returns
a pointer to the COMPONENT that matches aUuid if found. Otherwise NULL.

◆ GetCount() [1/2]

◆ GetCount() [2/2]

unsigned NETLIST::GetCount ( ) const
inline
Returns
the number of components in the netlist.

Definition at line 322 of file pcb_netlist.h.

References m_components.

◆ GetGroupByUuid() [1/2]

NETLIST_GROUP * NETLIST::GetGroupByUuid ( const KIID & aUuid)

Return a NETLIST_GROUP by aUuid.

Parameters
aUuidis the KIID of the NETLIST_GROUP.
Returns
a pointer to the NETLIST_GROUP that matches aUuid if found. Otherwise NULL.

Definition at line 189 of file common/netlist_reader/netlist.cpp.

References group, and m_groups.

Referenced by BOARD_NETLIST_UPDATER::updateGroups().

◆ GetGroupByUuid() [2/2]

NETLIST_GROUP * NETLIST::GetGroupByUuid ( const KIID & aUuid)

Return a NETLIST_GROUP by aUuid.

Parameters
aUuidis the KIID of the NETLIST_GROUP.
Returns
a pointer to the NETLIST_GROUP that matches aUuid if found. Otherwise NULL.

◆ GetNetChainColors()

const std::map< wxString, wxString > & NETLIST::GetNetChainColors ( ) const
inline

Definition at line 406 of file pcb_netlist.h.

References m_netChainColors.

Referenced by BOARD_NETLIST_UPDATER::UpdateNetlist().

◆ GetNetChainFor()

wxString NETLIST::GetNetChainFor ( const wxString & aNet) const
inline

Definition at line 372 of file pcb_netlist.h.

References m_netSignals.

Referenced by BOARD_NETLIST_UPDATER::ApplyChainAssignments().

◆ GetNetChainNetClasses()

const std::map< wxString, wxString > & NETLIST::GetNetChainNetClasses ( ) const
inline

Definition at line 389 of file pcb_netlist.h.

References m_netChainNetClasses.

Referenced by BOARD_NETLIST_UPDATER::UpdateNetlist().

◆ GetNetChainTerminalPins()

const std::map< wxString, std::vector< std::pair< wxString, wxString > > > & NETLIST::GetNetChainTerminalPins ( ) const
inline

Definition at line 367 of file pcb_netlist.h.

References m_netChainTerminals.

Referenced by BOARD_NETLIST_UPDATER::UpdateNetlist().

◆ GetNetChainTerminals()

const std::vector< std::pair< wxString, wxString > > & NETLIST::GetNetChainTerminals ( const wxString & aNetChain) const
inline

Definition at line 360 of file pcb_netlist.h.

References empty(), and m_netChainTerminals.

◆ GetReplaceFootprints() [1/2]

bool NETLIST::GetReplaceFootprints ( ) const
inline

Definition at line 374 of file common/netlist_reader/netlist.h.

References m_replaceFootprints.

Referenced by LoadNetlistFootprints().

◆ GetReplaceFootprints() [2/2]

bool NETLIST::GetReplaceFootprints ( ) const
inline

Definition at line 474 of file pcb_netlist.h.

References m_replaceFootprints.

◆ GetSignalChainClass()

wxString NETLIST::GetSignalChainClass ( const wxString & aNetChain) const
inline

Definition at line 417 of file pcb_netlist.h.

References m_signalChainClasses.

◆ GetSignalChainClasses()

const std::map< wxString, wxString > & NETLIST::GetSignalChainClasses ( ) const
inline

Definition at line 423 of file pcb_netlist.h.

References m_signalChainClasses.

Referenced by BOARD_NETLIST_UPDATER::UpdateNetlist().

◆ GetSignalColor()

wxString NETLIST::GetSignalColor ( const wxString & aNetChain) const
inline

Definition at line 400 of file pcb_netlist.h.

References m_netChainColors.

◆ GetSignalNetClass()

wxString NETLIST::GetSignalNetClass ( const wxString & aNetChain) const
inline

Definition at line 383 of file pcb_netlist.h.

References m_netChainNetClasses.

◆ GetVariantDescription()

wxString NETLIST::GetVariantDescription ( const wxString & aVariantName) const
inline
Returns
the description for a given variant, or empty string if not found.

Definition at line 527 of file pcb_netlist.h.

References m_variantDescriptions, and m_variantNames.

Referenced by BOARD_NETLIST_UPDATER::UpdateNetlist().

◆ GetVariantDescriptions()

const std::map< wxString, wxString > & NETLIST::GetVariantDescriptions ( ) const
inline
Returns
a map of all variant descriptions.

Definition at line 554 of file pcb_netlist.h.

References m_variantDescriptions.

◆ GetVariantNames()

const std::vector< wxString > & NETLIST::GetVariantNames ( ) const
inline
Returns
a list of variant names found in the netlist.

Definition at line 493 of file pcb_netlist.h.

References m_variantNames.

Referenced by BOARD_NETLIST_UPDATER::UpdateNetlist().

◆ IsEmpty() [1/2]

bool NETLIST::IsEmpty ( ) const
inline
Returns
true if there are no components in the netlist.

Definition at line 290 of file common/netlist_reader/netlist.h.

References m_components.

Referenced by LoadNetlistFootprints().

◆ IsEmpty() [2/2]

bool NETLIST::IsEmpty ( ) const
inline
Returns
true if there are no components in the netlist.

Definition at line 312 of file pcb_netlist.h.

References m_components.

◆ IsFindByTimeStamp() [1/2]

bool NETLIST::IsFindByTimeStamp ( ) const
inline

Definition at line 371 of file common/netlist_reader/netlist.h.

References m_findByTimeStamp.

Referenced by LoadNetlistFootprints().

◆ IsFindByTimeStamp() [2/2]

bool NETLIST::IsFindByTimeStamp ( ) const
inline

Definition at line 471 of file pcb_netlist.h.

References m_findByTimeStamp.

◆ SetFindByTimeStamp() [1/2]

void NETLIST::SetFindByTimeStamp ( bool aFindByTimeStamp)
inline

Definition at line 370 of file common/netlist_reader/netlist.h.

References m_findByTimeStamp.

◆ SetFindByTimeStamp() [2/2]

void NETLIST::SetFindByTimeStamp ( bool aFindByTimeStamp)
inline

Definition at line 470 of file pcb_netlist.h.

References m_findByTimeStamp.

◆ SetNetChainFor()

void NETLIST::SetNetChainFor ( const wxString & aNet,
const wxString & aNetChain )
inline

Definition at line 350 of file pcb_netlist.h.

References m_netSignals.

◆ SetReplaceFootprints() [1/2]

void NETLIST::SetReplaceFootprints ( bool aReplace)
inline

Definition at line 373 of file common/netlist_reader/netlist.h.

References m_replaceFootprints.

◆ SetReplaceFootprints() [2/2]

void NETLIST::SetReplaceFootprints ( bool aReplace)
inline

Definition at line 473 of file pcb_netlist.h.

References m_replaceFootprints.

◆ SetSignalChainClass()

void NETLIST::SetSignalChainClass ( const wxString & aNetChain,
const wxString & aClass )
inline

Net chain class assignment carried through the netlist for downstream tools.

Definition at line 412 of file pcb_netlist.h.

References m_signalChainClasses.

◆ SetSignalColor()

void NETLIST::SetSignalColor ( const wxString & aNetChain,
const wxString & aColor )
inline

Stored as a #RRGGBB or #RRGGBBAA string; empty means "no override".

Definition at line 395 of file pcb_netlist.h.

References m_netChainColors.

◆ SetSignalNetClass()

void NETLIST::SetSignalNetClass ( const wxString & aNetChain,
const wxString & aNetClass )
inline

Definition at line 378 of file pcb_netlist.h.

References m_netChainNetClasses.

◆ SortByFPID() [1/2]

void NETLIST::SortByFPID ( )

Definition at line 271 of file common/netlist_reader/netlist.cpp.

References ByFPID(), and m_components.

Referenced by LoadNetlistFootprints().

◆ SortByFPID() [2/2]

void NETLIST::SortByFPID ( )

◆ SortByReference() [1/2]

void NETLIST::SortByReference ( )

Definition at line 286 of file common/netlist_reader/netlist.cpp.

References m_components.

◆ SortByReference() [2/2]

void NETLIST::SortByReference ( )

Member Data Documentation

◆ m_components

◆ m_findByTimeStamp

bool NETLIST::m_findByTimeStamp
protected

Definition at line 394 of file common/netlist_reader/netlist.h.

Referenced by IsFindByTimeStamp(), NETLIST(), and SetFindByTimeStamp().

◆ m_groups

NETLIST_GROUPS NETLIST::m_groups
protected

Definition at line 392 of file common/netlist_reader/netlist.h.

Referenced by AddGroup(), ApplyGroupMembership(), and GetGroupByUuid().

◆ m_netChainColors

std::map<wxString, wxString> NETLIST::m_netChainColors
private

Definition at line 565 of file pcb_netlist.h.

Referenced by GetNetChainColors(), GetSignalColor(), and SetSignalColor().

◆ m_netChainNetClasses

std::map<wxString, wxString> NETLIST::m_netChainNetClasses
private

Definition at line 564 of file pcb_netlist.h.

Referenced by GetNetChainNetClasses(), GetSignalNetClass(), and SetSignalNetClass().

◆ m_netChainTerminals

std::map<wxString, std::vector<std::pair<wxString, wxString> > > NETLIST::m_netChainTerminals
private

◆ m_netSignals

std::map<wxString, wxString> NETLIST::m_netSignals
private

Definition at line 562 of file pcb_netlist.h.

Referenced by GetNetChainFor(), and SetNetChainFor().

◆ m_replaceFootprints

bool NETLIST::m_replaceFootprints
protected

◆ m_signalChainClasses

std::map<wxString, wxString> NETLIST::m_signalChainClasses
private

Definition at line 566 of file pcb_netlist.h.

Referenced by GetSignalChainClass(), GetSignalChainClasses(), and SetSignalChainClass().

◆ m_variantDescriptions

std::map<wxString, wxString> NETLIST::m_variantDescriptions
private

Definition at line 569 of file pcb_netlist.h.

Referenced by AddVariant(), GetVariantDescription(), and GetVariantDescriptions().

◆ m_variantNames

std::vector<wxString> NETLIST::m_variantNames
private

Definition at line 568 of file pcb_netlist.h.

Referenced by AddVariant(), GetVariantDescription(), and GetVariantNames().


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