From 2c8178829982c6e15e443b5a7868b8c953d5126f Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 28 Aug 2023 17:41:15 +0100 Subject: [PATCH] HasAutofill should not preclude a primary parameter in the value field --- eeschema/dialogs/dialog_sim_model.cpp | 10 ++++++---- eeschema/sim/sim_model_serializer.cpp | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/eeschema/dialogs/dialog_sim_model.cpp b/eeschema/dialogs/dialog_sim_model.cpp index 4403d78757..8c128b4ada 100644 --- a/eeschema/dialogs/dialog_sim_model.cpp +++ b/eeschema/dialogs/dialog_sim_model.cpp @@ -177,10 +177,6 @@ bool DIALOG_SIM_MODEL::TransferDataToWindow() m_fields.back().SetText( pinMap ); storeInValue = true; - - // In case the storeInValue checkbox is turned off (if it's left on then we'll overwrite - // this field with the actual value): - m_fields[ VALUE_FIELD ].SetText( wxT( "${SIM.PARAMS}" ) ); } std::string libraryFilename = SIM_MODEL::GetFieldValue( &m_fields, SIM_LIBRARY::LIBRARY_FIELD ); @@ -306,8 +302,14 @@ bool DIALOG_SIM_MODEL::TransferDataToWindow() } if( storeInValue ) + { curModel().SetIsStoredInValue( true ); + // In case the storeInValue checkbox is turned off (if it's left on then we'll overwrite + // this field with the actual value): + m_fields[ VALUE_FIELD ].SetText( wxT( "${SIM.PARAMS}" ) ); + } + m_saveInValueCheckbox->SetValue( curModel().IsStoredInValue() ); onRadioButton( dummyEvent ); diff --git a/eeschema/sim/sim_model_serializer.cpp b/eeschema/sim/sim_model_serializer.cpp index 0a93d3e195..c51b2b53bc 100644 --- a/eeschema/sim/sim_model_serializer.cpp +++ b/eeschema/sim/sim_model_serializer.cpp @@ -252,7 +252,7 @@ bool SIM_MODEL_SERIALIZER::ParseParams( const std::string& aParams ) } } - return !m_model.HasPrimaryValue() || m_model.HasAutofill() || isPrimaryValueSet; + return !m_model.HasPrimaryValue() || isPrimaryValueSet; }