27#include <wx/tokenzr.h>
33 return aOut->
Print( aNestLevel,
"(pin_net %s %s)",
48 if( net.GetPinName() != aPinName )
50 if( !net.GetPinName().StartsWith( wxS(
"[" ) ) )
55 if( std::find( expanded.begin(), expanded.end(), aPinName ) == expanded.end() )
87 path +=
'/' + pathStep.AsString();
95 aOut->
Print( nl + 1,
"(fields" );
97 for( std::pair<wxString, wxString> field :
m_fields )
98 aOut->
Print( nl + 2,
"\n(field (name %s) %s)", aOut->
Quotew( field.first ).c_str(),
99 aOut->
Quotew( field.second ).c_str() );
101 aOut->
Print( 0,
")\n" );
105 aOut->
Print( nl + 1,
"(property (name \"dnp\"))\n" );
108 aOut->
Print( nl + 1,
"(property (name \"exclude_from_bom\"))\n" );
113 aOut->
Print( nl+1,
"(fp_filters" );
118 aOut->
Print( 0,
")\n" );
123 int llen = aOut->
Print( nl+1,
"(nets " );
125 for(
unsigned i = 0; i <
m_nets.size(); ++i )
129 aOut->
Print( 0,
"\n" );
130 llen = aOut->
Print( nl+1,
" " );
133 llen +=
m_nets[i].Format( aOut, 0, aCtl );
136 aOut->
Print( 0,
")\n" );
139 aOut->
Print( nl,
")\n" );
147 aOut->
Print( nl,
"(%s\n", aDocName );
154 aOut->
Print( nl,
")\n" );
173 if(
group.uuid == aUuid )
200 if( aUuidPath.empty() )
203 KIID comp_uuid = aUuidPath.back();
211 const std::vector<KIID>& kiids = component.GetKIIDs();
213 if( base != component.GetPath() )
216 if( std::find( kiids.begin(), kiids.end(), comp_uuid ) != kiids.end() )
231 for(
const KIID& compUuid : component.GetKIIDs() )
233 if( aUuid == compUuid )
Used to store the component pin name to net name (and pin function) associations stored in a netlist.
int Format(OUTPUTFORMATTER *aOut, int aNestLevel, int aCtl)
Store all of the related component information found in a netlist.
const COMPONENT_NET & GetNet(unsigned aIndex) const
std::vector< COMPONENT_NET > m_nets
list of nets shared by the component pins
std::map< wxString, wxString > m_properties
Component-specific properties found in the netlist.
wxArrayString m_footprintFilters
const wxString & GetReference() const
void Format(OUTPUTFORMATTER *aOut, int aNestLevel, int aCtl)
KIID_PATH m_path
A fully specified path to the component (but not the component: [ sheetUUID, sheetUUID,...
nlohmann::ordered_map< wxString, wxString > m_fields
Component-specific user fields found in the netlist.
wxString m_name
The name of the component in m_library used when it was placed on the schematic.
std::vector< KIID > m_kiids
A vector of possible KIIDs corresponding to all units in a symbol.
wxString m_library
The name of the component library where m_name was found.
LIB_ID m_fpid
The LIB_ID of the footprint assigned to the component.
static COMPONENT_NET m_emptyNet
const LIB_ID & GetFPID() const
void SetGroup(NETLIST_GROUP *aGroup)
void Format(const char *aDocName, OUTPUTFORMATTER *aOut, int aNestLevel, int aCtl=0)
void AddGroup(NETLIST_GROUP *aGroup)
void AddComponent(COMPONENT *aComponent)
Add aComponent to the NETLIST.
COMPONENT * GetComponentByPath(const KIID_PATH &aPath)
Return a COMPONENT by aPath.
COMPONENT * GetComponentByReference(const wxString &aReference)
Return a COMPONENT by aReference.
COMPONENT * GetComponentByUuid(const KIID &aUuid)
Return a COMPONENT by aUuid.
NETLIST_GROUP * GetGroupByUuid(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 ...
bool AnyFootprintsLinked() const
bool operator<(const COMPONENT &item1, const COMPONENT &item2)
Compare two COMPONENT objects by reference designator.
static bool ByFPID(const COMPONENT &ref, const COMPONENT &cmp)
A helper function used to sort the component list used by loadNewModules.
#define CTL_OMIT_FP_UUID
Don't prefix the footprint UUID to the sheet path.
#define CTL_OMIT_FILTERS
Omit the ki_fp_filters attribute in .kicad_xxx files.
static bool empty(const wxTextEntryBase *aCtrl)
int StrNumCmp(const wxString &aString1, const wxString &aString2, bool aIgnoreCase)
Compare two strings with alphanumerical content.
std::vector< wxString > ExpandStackedPinNotation(const wxString &aPinName, bool *aValid)
Expand stacked pin notation like [1,2,3], [1-4], [A1-A4], or [AA1-AA3,AB4,CD12-CD14] into individual ...
bool IsAutoGeneratedNetName(const wxString &aNetName)
Recognize the reserved prefixes used for generated pin-net names.