Eeschema: Add footprint field to Cadstar netlist file.

Fixes: lp:1755996
https://bugs.launchpad.net/kicad/+bug/1755996
This commit is contained in:
jean-pierre charras 2018-03-16 13:20:00 +01:00
parent 3b0a758f97
commit 819056df9d
1 changed files with 6 additions and 9 deletions

View File

@ -52,6 +52,7 @@ bool NETLIST_EXPORTER_CADSTAR::WriteNetlist( const wxString& aOutFileName, unsig
wxString StartCmpDesc = StartLine + wxT( "ADD_COM" ); wxString StartCmpDesc = StartLine + wxT( "ADD_COM" );
wxString msg; wxString msg;
wxString footprint;
EDA_ITEM* DrawList; EDA_ITEM* DrawList;
SCH_COMPONENT* component; SCH_COMPONENT* component;
wxString title = wxT( "Eeschema " ) + GetBuildVersion(); wxString title = wxT( "Eeschema " ) + GetBuildVersion();
@ -60,7 +61,7 @@ bool NETLIST_EXPORTER_CADSTAR::WriteNetlist( const wxString& aOutFileName, unsig
ret |= fprintf( f, "%sTIM %s\n", TO_UTF8( StartLine ), TO_UTF8( DateAndTime() ) ); ret |= fprintf( f, "%sTIM %s\n", TO_UTF8( StartLine ), TO_UTF8( DateAndTime() ) );
ret |= fprintf( f, "%sAPP ", TO_UTF8( StartLine ) ); ret |= fprintf( f, "%sAPP ", TO_UTF8( StartLine ) );
ret |= fprintf( f, "\"%s\"\n", TO_UTF8( title ) ); ret |= fprintf( f, "\"%s\"\n", TO_UTF8( title ) );
ret |= fprintf( f, "\n" ); ret |= fprintf( f, ".TYP FULL\n\n" );
// Prepare list of nets generation // Prepare list of nets generation
for( unsigned ii = 0; ii < m_masterList->size(); ii++ ) for( unsigned ii = 0; ii < m_masterList->size(); ii++ )
@ -80,16 +81,11 @@ bool NETLIST_EXPORTER_CADSTAR::WriteNetlist( const wxString& aOutFileName, unsig
if( component == NULL ) if( component == NULL )
break; break;
/*
doing nothing with footprint
if( !component->GetField( FOOTPRINT )->IsVoid() ) if( !component->GetField( FOOTPRINT )->IsVoid() )
{ footprint = component->GetField( FOOTPRINT )->GetText();
footprint = component->GetField( FOOTPRINT )->m_Text;
footprint.Replace( wxT( " " ), wxT( "_" ) );
}
else else
footprint = wxT( "$noname" ); footprint = "$noname";
*/
msg = component->GetRef( &sheetList[i] ); msg = component->GetRef( &sheetList[i] );
ret |= fprintf( f, "%s ", TO_UTF8( StartCmpDesc ) ); ret |= fprintf( f, "%s ", TO_UTF8( StartCmpDesc ) );
@ -98,6 +94,7 @@ bool NETLIST_EXPORTER_CADSTAR::WriteNetlist( const wxString& aOutFileName, unsig
msg = component->GetField( VALUE )->GetText(); msg = component->GetField( VALUE )->GetText();
msg.Replace( wxT( " " ), wxT( "_" ) ); msg.Replace( wxT( " " ), wxT( "_" ) );
ret |= fprintf( f, " \"%s\"", TO_UTF8( msg ) ); ret |= fprintf( f, " \"%s\"", TO_UTF8( msg ) );
ret |= fprintf( f, " \"%s\"", TO_UTF8( footprint ) );
ret |= fprintf( f, "\n" ); ret |= fprintf( f, "\n" );
} }
} }