Пример #1
0
// Helper function: count the number of labels identical to aLabel
//  for global label: global labels in the full project
//  for local label: all labels in the current sheet
static int countIndenticalLabels( std::vector<NETLIST_OBJECT*>& aList, NETLIST_OBJECT* aLabel )
{
    int count = 0;

    if( aLabel->IsLabelGlobal() )
    {
        for( unsigned netItem = 0; netItem < aList.size(); ++netItem )
        {
            NETLIST_OBJECT* item = aList[netItem];

            if( item->IsLabelGlobal() && item->m_Label == aLabel->m_Label )
                count++;
        }
    }
    else
    {
        for( unsigned netItem = 0; netItem < aList.size(); ++netItem )
        {
            NETLIST_OBJECT* item = aList[netItem];

            if( item->m_Label == aLabel->m_Label &&
                item->m_SheetPath.Path() == aLabel->m_SheetPath.Path() )
                count++;
        }
    }

    return count;
}