Don't write sim.params for library model unless we actually have overrides.

This commit is contained in:
Jeff Young 2022-12-23 12:33:39 +00:00
parent cd7be966c0
commit 3f49fa5361
1 changed files with 7 additions and 4 deletions

View File

@ -1484,7 +1484,6 @@ void SIM_MODEL::MigrateSimModel( T_symbol& aSymbol, const PROJECT* aProject )
SIM_LIBRARY::MODEL model = libMgr.CreateModel( spiceLib, spiceModel.ToStdString(),
emptyFields, sourcePins );
spiceParams = wxString( model.model.GetBaseModel()->Serializer().GenerateParams() );
libraryModel = true;
if( pinMap.IsEmpty() )
@ -1577,9 +1576,13 @@ void SIM_MODEL::MigrateSimModel( T_symbol& aSymbol, const PROJECT* aProject )
nameField.SetText( spiceModel );
aSymbol.AddField( nameField );
T_field paramsField( &aSymbol, -1, SIM_MODEL::PARAMS_FIELD );
paramsField.SetText( spiceParams );
aSymbol.AddField( paramsField );
// Don't write a paramsField unless we actually have overrides
if( !spiceParams.IsEmpty() )
{
T_field paramsField( &aSymbol, -1, SIM_MODEL::PARAMS_FIELD );
paramsField.SetText( spiceParams );
aSymbol.AddField( paramsField );
}
if( modelFromValueField )
valueField->SetText( wxT( "${SIM.NAME}" ) );