Don't use referential values as defaults.

This commit is contained in:
Jeff Young 2024-01-06 22:01:23 +00:00
parent 7c5eaed69e
commit 84d161a4b7
1 changed files with 6 additions and 2 deletions

View File

@ -292,10 +292,14 @@ void SIM_MODEL_SOURCE::doSetParamValue( int aParamIndex, const std::string& aVal
{
if( GetParam( paramIndex ).value == "" )
{
std::string defaultValue = m_params.at( aParamIndex ).info.defaultValue;
double dummy;
wxString defaultValue = m_params.at( aParamIndex ).info.defaultValue;
if( !defaultValue.ToDouble( &dummy ) )
defaultValue = wxT( "0" );
m_params.at( aParamIndex ).value = defaultValue;
SIM_MODEL::SetParamValue( paramIndex, defaultValue );
SIM_MODEL::SetParamValue( paramIndex, defaultValue.ToStdString() );
}
}
}