57    NETNAMES_MAP::iterator it, itEnd;
 
 
   73        return (*result).second;
 
 
   84        return (*result).second;
 
 
   96        if ( i->second == aNet )
 
  106        if ( i->second == aNet )
 
  108            wxASSERT_MSG( removed, wxT( 
"NETINFO_LIST::RemoveNet: target net found in m_netNames " 
  109                                        "but not m_netCodes!" ) );
 
 
  126    std::vector<NETINFO_ITEM*> unusedNets;
 
  131    for( 
const auto& [ netCode, netInfo ] : existingNets )
 
  133        if( netInfo->IsCurrent() )
 
  135            m_netNames.insert( std::make_pair( netInfo->GetNetname(), netInfo ) );
 
  136            m_netCodes.insert( std::make_pair( netCode, netInfo ) );
 
 
  154    if( sameName != 
nullptr )
 
 
  185    m_parent->SynchronizeNetsAndNetClasses( 
false );
 
  186    m_parent->SetAreasNetCodesFromNetNames();
 
 
  192    std::map<wxString, std::vector<wxString>> shortNameMap;
 
  205            wxArrayString              parts = wxSplit( net->
m_netname, 
'/' );
 
  206            std::vector<wxArrayString> aggregateParts;
 
  207            std::optional<size_t>      firstNonCommon;
 
  209            for( 
const wxString& longName : shortNameMap[net->
m_shortNetname] )
 
  210                aggregateParts.push_back( wxSplit( longName, 
'/' ) );
 
  212            for( 
size_t ii = 0; ii < parts.size() && !firstNonCommon; ++ii )
 
  214                for( 
const wxArrayString& otherParts : aggregateParts )
 
  216                    if( ii < otherParts.size() && otherParts[ii] == parts[ii] )
 
  224            if( firstNonCommon.value_or( 0 ) > 0 && firstNonCommon.value() < parts.size() )
 
  226                wxString disambiguatedName;
 
  228                for( 
size_t ii = firstNonCommon.value(); ii < parts.size(); ++ii )
 
  230                    if( !disambiguatedName.IsEmpty() )
 
  231                        disambiguatedName += wxS( 
"/" );
 
  233                    disambiguatedName += parts[ii];
 
 
  250void NETINFO_LIST::Show()
 const 
  253    NETNAMES_MAP::const_iterator it, itEnd;
 
  257        wxLogDebug( wxT( 
"[%d]: netcode:%d  netname:<%s>\n" ),
 
  259                    it->second->GetNetCode(),
 
  260                    TO_UTF8( it->second->GetNetname() ) );
 
COMMIT & Removed(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
 
Handle the data for a net.
 
wxString m_shortNetname
Short net name, like vout from /sheet/subsheet/vout.
 
wxString m_displayNetname
Unescaped netname for display.
 
const wxString & GetNetname() const
 
void Clear()
Set all fields to their default values.
 
int m_netCode
A number equivalent to the net name.
 
wxString m_netname
Full net name like /sheet/subsheet/vout used by Eeschema.
 
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.
 
bool m_DisplayNetnamesDirty
 
void RebuildDisplayNetnames() const
 
void buildListOfNets()
Rebuild the list of NETINFO_ITEMs.
 
This file contains miscellaneous commonly used macros and functions.
 
wxString UnescapeString(const wxString &aSource)
 
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
 
wxString result
Test unit parsing edge cases and error handling.