Commit 84a009f7 authored by jean-pierre charras's avatar jean-pierre charras

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

netform.cpp: added in intermediate netlist the pin list of each component in schematic. Some netlist formats (spice, orcadpcb2) are very simple to create with this pins list.
parents 297293d4 4264ddb0
......@@ -923,6 +923,9 @@ XNODE* EXPORT_HELP::makeGenericComponents()
wxString sLib = wxT( "lib" );
wxString sPart = wxT( "part" );
wxString sNames = wxT( "names" );
wxString sPinNum = wxT( "num" );
wxString sPinNetname = wxT( "netname" );
wxString sPinNetcode = wxT( "netcode" );
m_ReferencesAlreadyFound.Clear();
......@@ -936,7 +939,7 @@ XNODE* EXPORT_HELP::makeGenericComponents()
{
for( EDA_BaseStruct* schItem = path->LastDrawList(); schItem; schItem = schItem->Next() )
{
SCH_COMPONENT* comp = findNextComponent( schItem, path );
SCH_COMPONENT* comp = findNextComponentAndCreatPinList( schItem, path );
if( !comp )
break; // No component left
......@@ -1000,6 +1003,26 @@ XNODE* EXPORT_HELP::makeGenericComponents()
timeStamp.Printf( sTSFmt, comp->m_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 );
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment