sim - don't write dc parameter twice

This commit is contained in:
Fabien Corona 2023-02-18 10:07:29 +00:00
parent fa0cc09917
commit f5902dad28
1 changed files with 6 additions and 2 deletions

View File

@ -72,7 +72,8 @@ std::string SPICE_GENERATOR_SOURCE::ItemLine( const SPICE_ITEM& aItem ) const
item.modelName += fmt::format( "DC {} ", dc );
}
if( m_model.GetSpiceInfo().inlineTypeString != "" )
if( m_model.GetSpiceInfo().inlineTypeString != ""
&& m_model.GetType() != SIM_MODEL::TYPE::V ) // DC-only sources are already processed
{
std::string args = "";
@ -231,7 +232,10 @@ std::string SPICE_GENERATOR_SOURCE::ItemLine( const SPICE_ITEM& aItem ) const
std::string SPICE_GENERATOR_SOURCE::getParamValueString( const std::string& aParamName,
const std::string& aDefaultValue ) const
{
std::string result = m_model.FindParam( aParamName )->value->ToSpiceString();
std::string result = "";
if ( m_model.FindParam( aParamName ) )
m_model.FindParam( aParamName )->value->ToSpiceString();
if( result == "" )
result = aDefaultValue;