Commit 4264ddb0 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

netform.cpp added in intermediate netlist the pin list for each component in...

netform.cpp added in intermediate netlist the pin list for each component in schematic. Some netlist formats (spice, orcadpcb2) are very simple to create with this pins list.
parent 297293d4
Loading
Loading
Loading
Loading
+24 −1
Original line number Original line Diff line number Diff line
@@ -923,6 +923,9 @@ XNODE* EXPORT_HELP::makeGenericComponents()
    wxString    sLib        = wxT( "lib" );
    wxString    sLib        = wxT( "lib" );
    wxString    sPart       = wxT( "part" );
    wxString    sPart       = wxT( "part" );
    wxString    sNames      = wxT( "names" );
    wxString    sNames      = wxT( "names" );
    wxString    sPinNum     = wxT( "num" );
    wxString    sPinNetname = wxT( "netname" );
    wxString    sPinNetcode = wxT( "netcode" );




    m_ReferencesAlreadyFound.Clear();
    m_ReferencesAlreadyFound.Clear();
@@ -936,7 +939,7 @@ XNODE* EXPORT_HELP::makeGenericComponents()
    {
    {
        for( EDA_BaseStruct* schItem = path->LastDrawList();  schItem;  schItem = schItem->Next() )
        for( EDA_BaseStruct* schItem = path->LastDrawList();  schItem;  schItem = schItem->Next() )
        {
        {
            SCH_COMPONENT*  comp = findNextComponent( schItem, path );
            SCH_COMPONENT*  comp = findNextComponentAndCreatPinList( schItem, path );
            if( !comp )
            if( !comp )
                break;  // No component left
                break;  // No component left


@@ -1000,6 +1003,26 @@ XNODE* EXPORT_HELP::makeGenericComponents()


            timeStamp.Printf( sTSFmt, comp->m_TimeStamp );
            timeStamp.Printf( sTSFmt, comp->m_TimeStamp );
            xcomp->AddChild( node( sTStamp, timeStamp ) );
            xcomp->AddChild( node( sTStamp, timeStamp ) );

            // Add pins list for this cmponent.
            // Usedful to build netlist which have pads connection inside the footprint description
            // (Spice, OrcadPCB2 ...)
            XNODE* xpinslist;
            xcomp->AddChild( xpinslist = node( sPins ) );
            for( unsigned ii = 0; ii < m_SortedComponentPinList.size(); ii++ )
            {
                NETLIST_OBJECT* Pin = m_SortedComponentPinList[ii];
                if( !Pin )
                    continue;
                XNODE* xpin;
                xpinslist->AddChild( xpin = node( sPin ) );
                wxString text;
                xpin->AddAttribute( sPinNum, Pin->GetPinNumText() );
                sprintPinNetName( &text, wxT( "N-%.6d" ), Pin );
                xpin->AddAttribute( sPinNetname, text );
                text.Printf( wxT( "%d" ), Pin->GetNet() );
                xpin->AddAttribute( sPinNetcode, text );
            }
        }
        }
    }
    }