Sim: Fix Sim.Params field generation logic

Don't generate the first parameter (e.g. for KIBIS it was 'vcc=""') when
it is empty in models without primary value.
This commit is contained in:
Mikolaj Wielgus 2022-11-30 10:38:50 +01:00
parent ec4fd42bee
commit 39cd9f8980
1 changed files with 4 additions and 1 deletions

View File

@ -88,8 +88,11 @@ std::string SIM_SERDE::GenerateParams() const
const SIM_MODEL::PARAM& param = m_model.GetUnderlyingParam( i ); const SIM_MODEL::PARAM& param = m_model.GetUnderlyingParam( i );
if( param.value->ToString() == "" && !( i == 0 && !m_model.IsStoredInValue() ) ) if( param.value->ToString() == ""
&& !( i == 0 && m_model.HasPrimaryValue() && !m_model.IsStoredInValue() ) )
{
continue; continue;
}
std::string paramValuePair = GenerateParamValuePair( param ); std::string paramValuePair = GenerateParamValuePair( param );