54 NETNAMES_MAP::iterator it, itEnd;
67 NETCODES_MAP::const_iterator result =
m_netCodes.find( aNetCode );
70 return (*result).second;
78 NETNAMES_MAP::const_iterator result =
m_netNames.find( aNetName );
81 return (*result).second;
93 if ( i->second == aNet )
103 if ( i->second == aNet )
105 wxASSERT_MSG( removed, wxT(
"NETINFO_LIST::RemoveNet: target net found in m_netNames "
106 "but not m_netCodes!" ) );
120 std::vector<NETINFO_ITEM*> unusedNets;
125 for(
const auto& [ netCode, netInfo ] : existingNets )
127 if( netInfo->IsCurrent() )
129 m_netNames.insert( std::make_pair( netInfo->GetNetname(), netInfo ) );
130 m_netCodes.insert( std::make_pair( netCode, netInfo ) );
145 if( sameName !=
nullptr )
180void NETINFO_LIST::Show()
const
183 NETNAMES_MAP::const_iterator it, itEnd;
187 wxLogDebug( wxT(
"[%d]: netcode:%d netname:<%s>\n" ),
189 it->second->GetNetCode(),
190 TO_UTF8( it->second->GetNetname() ) );
210 std::map<int, int>::const_iterator value =
m_netMapping.find( aNetCode );
213 return value->second;
230 nets.insert( zone->GetNetCode() );
234 nets.insert( track->GetNetCode() );
250 for(
PAD*
pad : footprint->Pads() )
251 nets.insert(
pad->GetNetCode() );
261 for(
auto net : nets )
274 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.
const ZONES & Zones() const
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.
const FOOTPRINTS & Footprints() const
const TRACKS & Tracks() const
const DRAWINGS & Drawings() const
COMMIT & Removed(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Modify a given item in the model.
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.
void RemoveUnusedNets(BOARD_COMMIT *aCommit)
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