Fix sheetPath handling in SPICE model generation.
(cherry picked from commit d5cb100f72
)
This commit is contained in:
parent
f8270b9cec
commit
0fb2f35b10
|
@ -214,26 +214,19 @@ bool NETLIST_EXPORTER_SPICE::ReadSchematicAndLibraries( unsigned aNetlistOptions
|
|||
if( !symbol || symbol->GetFieldText( SIM_ENABLE_FIELD ) == wxT( "0" ) )
|
||||
continue;
|
||||
|
||||
SPICE_ITEM spiceItem;
|
||||
std::vector<PIN_INFO> pins = CreatePinList( symbol, &sheet, true );
|
||||
|
||||
SPICE_ITEM spiceItem;
|
||||
|
||||
for( int i = 0; i < symbol->GetFieldCount(); ++i )
|
||||
for( const SCH_FIELD& field : symbol->GetFields() )
|
||||
{
|
||||
spiceItem.fields.emplace_back( VECTOR2I(), i, symbol,
|
||||
symbol->GetFields()[ i ].GetName() );
|
||||
spiceItem.fields.emplace_back( VECTOR2I(), -1, symbol, field.GetName() );
|
||||
|
||||
if( i == REFERENCE_FIELD )
|
||||
if( field.GetId() == REFERENCE_FIELD )
|
||||
spiceItem.fields.back().SetText( symbol->GetRef( &sheet ) );
|
||||
else
|
||||
spiceItem.fields.back().SetText( symbol->GetFields()[i].GetShownText( 0, false ) );
|
||||
spiceItem.fields.back().SetText( field.GetShownText( &sheet, 0, false ) );
|
||||
}
|
||||
|
||||
wxString deviceType;
|
||||
wxString modelType;
|
||||
wxString modelParams;
|
||||
wxString pinMap;
|
||||
|
||||
readRefName( sheet, *symbol, spiceItem, refNames );
|
||||
readModel( sheet, *symbol, spiceItem );
|
||||
readPinNumbers( *symbol, spiceItem, pins );
|
||||
|
|
|
@ -183,14 +183,14 @@ SIM_LIBRARY::MODEL SIM_LIB_MGR::CreateModel( const SCH_SHEET_PATH* aSheetPath, S
|
|||
|
||||
std::vector<SCH_FIELD> fields;
|
||||
|
||||
for( int i = 0; i < aSymbol.GetFieldCount(); ++i )
|
||||
for( const SCH_FIELD& field : aSymbol.GetFields() )
|
||||
{
|
||||
fields.emplace_back( VECTOR2I(), i, &aSymbol, aSymbol.GetFields()[ i ].GetName() );
|
||||
fields.emplace_back( VECTOR2I(), -1, &aSymbol, field.GetName() );
|
||||
|
||||
if( i == REFERENCE_FIELD )
|
||||
if( field.GetId() == REFERENCE_FIELD )
|
||||
fields.back().SetText( aSymbol.GetRef( aSheetPath ) );
|
||||
else
|
||||
fields.back().SetText( aSymbol.GetFields()[ i ].GetShownText( 0, false ) );
|
||||
fields.back().SetText( field.GetShownText( aSheetPath, 0, false ) );
|
||||
}
|
||||
|
||||
wxString deviceType;
|
||||
|
|
Loading…
Reference in New Issue