Correctly netlist a voltage source with both AC and DC values.

Fixes https://gitlab.com/kicad/code/kicad/issues/13912

(cherry picked from commit c618bb7046)
This commit is contained in:
Jeff Young 2023-02-15 14:43:16 +00:00
parent 2f8615c6c4
commit 7b992a1dc4
1 changed files with 7 additions and 4 deletions

View File

@ -110,8 +110,9 @@ std::string SPICE_GENERATOR_SOURCE::ItemLine( const SPICE_ITEM& aItem ) const
}
}
}
}
break;
}
// TODO: dt should be tstep by default.
@ -161,8 +162,9 @@ std::string SPICE_GENERATOR_SOURCE::ItemLine( const SPICE_ITEM& aItem ) const
args.append( range.ToSpiceString() + " " );
args.append( offset.ToSpiceString() + " " );
}
break;
}
case SIM_MODEL::TYPE::V_RANDNORMAL:
case SIM_MODEL::TYPE::I_RANDNORMAL:
@ -199,6 +201,7 @@ std::string SPICE_GENERATOR_SOURCE::ItemLine( const SPICE_ITEM& aItem ) const
if( argStr != "" )
args.append( argStr + " " );
}
break;
}
@ -219,7 +222,7 @@ std::string SPICE_GENERATOR_SOURCE::ItemLine( const SPICE_ITEM& aItem ) const
if( emptyLine )
{
item.modelName.append( m_model.GetParam( 0 ).value->ToSpiceString() );
item.modelName = m_model.GetParam( 0 ).value->ToSpiceString();
}
return SPICE_GENERATOR::ItemLine( item );
@ -230,7 +233,7 @@ std::string SPICE_GENERATOR_SOURCE::getParamValueString( const std::string& aPar
const std::string& aDefaultValue ) const
{
std::string result = "";
if ( m_model.FindParam( aParamName ) )
result = m_model.FindParam( aParamName )->value->ToSpiceString();