Use only first letter of prefix for RLC primary value name.

Fixes https://gitlab.com/kicad/code/kicad/issues/13162
This commit is contained in:
Jeff Young 2022-12-14 16:24:41 +00:00
parent 279edcefdc
commit a2ba9137b8
2 changed files with 5 additions and 3 deletions

View File

@ -243,7 +243,7 @@ bool NETLIST_EXPORTER_SPICE::ReadSchematicAndLibraries( unsigned aNetlistOptions
if( !inferredModel.second.IsEmpty() )
{
spiceItem.fields.emplace_back( symbol, -1, SIM_MODEL::DEVICE_TYPE_FIELD );
spiceItem.fields.back().SetText( symbol->GetPrefix() );
spiceItem.fields.back().SetText( symbol->GetPrefix().Left( 1 ) );
if( !inferredModel.first.IsEmpty() )
{

View File

@ -1072,14 +1072,16 @@ std::pair<wxString, wxString> SIM_MODEL::InferSimModel( const wxString& aPrefix,
}
spiceModelParams = wxString::Format( wxT( "%s=\"%s%s\"" ),
aPrefix.Lower(),
aPrefix.Left(1).Lower(),
valuePrefix,
valueUnits );
}
else
{
spiceModelType = wxT( "=" );
spiceModelParams = wxString::Format( wxT( "%s=\"%s\"" ), aPrefix.Lower(), aValue );
spiceModelParams = wxString::Format( wxT( "%s=\"%s\"" ),
aPrefix.Left(1).Lower(),
aValue );
}
}
}