From 3f49fa536153e57200806b225bebee22b1b84860 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 23 Dec 2022 12:33:39 +0000 Subject: [PATCH] Don't write sim.params for library model unless we actually have overrides. --- eeschema/sim/sim_model.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/eeschema/sim/sim_model.cpp b/eeschema/sim/sim_model.cpp index 48f7303661..f66d0f4fc9 100644 --- a/eeschema/sim/sim_model.cpp +++ b/eeschema/sim/sim_model.cpp @@ -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}" ) );