52 NETNAMES_MAP::iterator it, itEnd;
65 NETCODES_MAP::const_iterator result =
m_netCodes.find( aNetCode );
68 return (*result).second;
76 NETNAMES_MAP::const_iterator result =
m_netNames.find( aNetName );
79 return (*result).second;
91 if ( i->second == aNet )
101 if ( i->second == aNet )
103 wxASSERT_MSG( removed, wxT(
"NETINFO_LIST::RemoveNet: target net found in m_netNames "
104 "but not m_netCodes!" ) );
122 for( std::pair<const int, NETINFO_ITEM*> item : existingNets )
124 if( item.second->IsCurrent() )
126 m_netNames.insert( std::make_pair( item.second->GetNetname(), item.second ) );
127 m_netCodes.insert( std::make_pair( item.first, item.second ) );
138 if( sameName !=
nullptr )
173void NETINFO_LIST::Show()
const
176 NETNAMES_MAP::const_iterator it, itEnd;
180 wxLogDebug( wxT(
"[%d]: netcode:%d netname:<%s>\n" ),
182 it->second->GetNetCode(),
183 TO_UTF8( it->second->GetNetname() ) );
203 std::map<int, int>::const_iterator value =
m_netMapping.find( aNetCode );
206 return value->second;
223 nets.insert( zone->GetNetCode() );
227 nets.insert( track->GetNetCode() );
232 for(
PAD*
pad : footprint->Pads() )
233 nets.insert(
pad->GetNetCode() );
243 for(
auto net : nets )
256 return m_mapping->m_board->FindNet( m_iterator->first );
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 forces initialization of a netinfo item to the NETINFO_ITEM ORPHANED (typically -1) whe...
NETCODES_MAP m_netCodes
map of <int, NETINFO_ITEM*> is NOT owner
static const int ORPHANED
NETINFO_ITEM meaning that there was no net assigned for an item, as there was no board storing net li...
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.