53 NETNAMES_MAP::iterator it, itEnd;
66 NETCODES_MAP::const_iterator result =
m_netCodes.find( aNetCode );
69 return (*result).second;
77 NETNAMES_MAP::const_iterator result =
m_netNames.find( aNetName );
80 return (*result).second;
92 if ( i->second == aNet )
102 if ( i->second == aNet )
104 wxASSERT_MSG( removed, wxT(
"NETINFO_LIST::RemoveNet: target net found in m_netNames "
105 "but not m_netCodes!" ) );
123 for( std::pair<const int, NETINFO_ITEM*> item : existingNets )
125 if( item.second->IsCurrent() )
127 m_netNames.insert( std::make_pair( item.second->GetNetname(), item.second ) );
128 m_netCodes.insert( std::make_pair( item.first, item.second ) );
139 if( sameName !=
nullptr )
174void NETINFO_LIST::Show()
const
177 NETNAMES_MAP::const_iterator it, itEnd;
181 wxLogDebug( wxT(
"[%d]: netcode:%d netname:<%s>\n" ),
183 it->second->GetNetCode(),
184 TO_UTF8( it->second->GetNetname() ) );
204 std::map<int, int>::const_iterator value =
m_netMapping.find( aNetCode );
207 return value->second;
224 nets.insert( zone->GetNetCode() );
228 nets.insert( track->GetNetCode() );
244 for(
PAD*
pad : footprint->Pads() )
245 nets.insert(
pad->GetNetCode() );
255 for(
auto net : nets )
268 return m_mapping->m_board->FindNet( m_iterator->first );
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Information pertinent to a Pcbnew printed circuit board.
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
int SetAreasNetCodesFromNetNames()
Set the .m_NetCode member of all copper areas, according to the area Net Name The SetNetCodesFromNetN...
void SynchronizeNetsAndNetClasses(bool aResetTrackAndViaSizes)
Copy NETCLASS info to each NET, based on NET membership in a NETCLASS.
FOOTPRINTS & Footprints()
Handle the data for a net.
const wxString & GetNetname() const
void Clear()
Set all fields to their default values.
int m_netCode
A number equivalent to the net name.
int getFreeNetCode()
Return the first available net code that is not used by any other net.
static const int UNCONNECTED
Constant that holds the "unconnected net" number (typically 0) all items "connected" to this net are ...
NETCODES_MAP m_netCodes
map of <int, NETINFO_ITEM*> is NOT owner
static const int ORPHANED
Constant that forces initialization of a netinfo item to the NETINFO_ITEM ORPHANED (typically -1) whe...
int m_newNetCode
possible value for new net code assignment
void RemoveNet(NETINFO_ITEM *aNet)
Remove a net from the net list.
NETINFO_ITEM * GetNetItem(int aNetCode) const
NETINFO_LIST(BOARD *aParent)
void clear()
Delete the list of nets (and free memory).
NETNAMES_MAP m_netNames
map of <wxString, NETINFO_ITEM*>, is NETINFO_ITEM owner
void AppendNet(NETINFO_ITEM *aNewElement)
Add aNewElement to the end of the net list.
void buildListOfNets()
Rebuild the list of NETINFO_ITEMs.
NETINFO_ITEM * operator->() const
const NETINFO_MAPPING * m_mapping
std::map< int, int >::const_iterator m_iterator
NETINFO_ITEM * operator*() const
int Translate(int aNetCode) const
Translate net number according to the map prepared by Update() function.
void Update()
Prepare a mapping for net codes so they can be saved as consecutive numbers.
const BOARD * m_board
Board for which mapping is prepared.
std::map< int, int > m_netMapping
Map that allows saving net codes with consecutive numbers (for compatibility reasons)
Handle a list of polygons defining a copper zone.
This file contains miscellaneous commonly used macros and functions.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers