2022-02-21 03:58:31 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2022 Mikolaj Wielgus
|
|
|
|
* Copyright (C) 2022 KiCad Developers, see AUTHORS.txt for contributors.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 3
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* https://www.gnu.org/licenses/gpl-3.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 3 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sim/sim_model_source.h>
|
2022-09-22 05:38:45 +00:00
|
|
|
|
|
|
|
#include <fmt/core.h>
|
2022-06-21 02:22:52 +00:00
|
|
|
#include <pegtl.hpp>
|
|
|
|
#include <pegtl/contrib/parse_tree.hpp>
|
2022-02-21 03:58:31 +00:00
|
|
|
|
|
|
|
|
2022-06-21 02:22:52 +00:00
|
|
|
namespace SIM_MODEL_SOURCE_PARSER
|
|
|
|
{
|
|
|
|
using namespace SIM_MODEL_SOURCE_GRAMMAR;
|
|
|
|
|
|
|
|
template <typename Rule> struct pwlValuesSelector : std::false_type {};
|
|
|
|
template <> struct pwlValuesSelector<number<SIM_VALUE::TYPE_FLOAT, NOTATION::SI>>
|
|
|
|
: std::true_type {};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-10-10 23:23:00 +00:00
|
|
|
std::string SPICE_GENERATOR_SOURCE::ModelLine( const SPICE_ITEM& aItem ) const
|
2022-04-01 04:30:50 +00:00
|
|
|
{
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-10-10 23:23:00 +00:00
|
|
|
std::string SPICE_GENERATOR_SOURCE::ItemLine( const SPICE_ITEM& aItem ) const
|
2022-04-01 04:30:50 +00:00
|
|
|
{
|
2022-10-10 23:23:00 +00:00
|
|
|
SPICE_ITEM item = aItem;
|
|
|
|
item.modelName = "";
|
2022-06-12 03:39:13 +00:00
|
|
|
|
2022-09-22 05:38:45 +00:00
|
|
|
std::string ac = m_model.FindParam( "ac" )->value->ToSpiceString();
|
|
|
|
std::string ph = m_model.FindParam( "ph" )->value->ToSpiceString();
|
2022-06-12 03:39:13 +00:00
|
|
|
|
|
|
|
if( ac != "" )
|
2022-10-10 23:23:00 +00:00
|
|
|
item.modelName.append( fmt::format( "AC {} {} ", ac, ph ) );
|
2022-06-12 03:39:13 +00:00
|
|
|
|
2022-09-14 07:19:25 +00:00
|
|
|
if( m_model.GetSpiceInfo().inlineTypeString != "" )
|
2022-05-31 02:55:48 +00:00
|
|
|
{
|
2022-09-22 05:38:45 +00:00
|
|
|
std::string args = "";
|
2022-06-12 03:39:13 +00:00
|
|
|
|
2022-09-14 07:19:25 +00:00
|
|
|
switch( m_model.GetType() )
|
2022-06-21 02:22:52 +00:00
|
|
|
{
|
2022-09-15 03:25:57 +00:00
|
|
|
case SIM_MODEL::TYPE::V_PWL:
|
|
|
|
case SIM_MODEL::TYPE::I_PWL:
|
2022-06-12 03:39:13 +00:00
|
|
|
{
|
2022-09-16 04:11:14 +00:00
|
|
|
tao::pegtl::string_input<> in( m_model.GetParam( 0 ).value->ToString(),
|
2022-06-21 02:22:52 +00:00
|
|
|
"from_content" );
|
|
|
|
std::unique_ptr<tao::pegtl::parse_tree::node> root;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
root = tao::pegtl::parse_tree::parse<SIM_MODEL_SOURCE_PARSER::pwlValuesGrammar,
|
|
|
|
SIM_MODEL_SOURCE_PARSER::pwlValuesSelector>
|
|
|
|
( in );
|
|
|
|
}
|
2022-08-15 19:45:54 +00:00
|
|
|
catch( const tao::pegtl::parse_error& )
|
2022-06-21 02:22:52 +00:00
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( root )
|
|
|
|
{
|
|
|
|
for( const auto& node : root->children )
|
|
|
|
{
|
|
|
|
if( node->is_type<SIM_MODEL_SOURCE_PARSER::number<SIM_VALUE::TYPE_FLOAT,
|
|
|
|
SIM_VALUE::NOTATION::SI>>() )
|
|
|
|
{
|
|
|
|
std::unique_ptr<SIM_VALUE> value = SIM_VALUE::Create( SIM_VALUE::TYPE_FLOAT,
|
|
|
|
node->string() );
|
2022-09-22 05:38:45 +00:00
|
|
|
args.append( value->ToString( SIM_VALUE::NOTATION::SPICE ) + " " );
|
2022-06-21 02:22:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// TODO: dt should be tstep by default.
|
|
|
|
|
2022-09-15 03:25:57 +00:00
|
|
|
case SIM_MODEL::TYPE::V_WHITENOISE:
|
|
|
|
case SIM_MODEL::TYPE::I_WHITENOISE:
|
2022-09-22 05:38:45 +00:00
|
|
|
args.append( getParamValueString( "rms", "0" ) + " " );
|
|
|
|
args.append( getParamValueString( "dt", "0" ) + " " );
|
|
|
|
args.append( "0 0 0 0 0 " );
|
2022-06-21 02:22:52 +00:00
|
|
|
break;
|
|
|
|
|
2022-09-15 03:25:57 +00:00
|
|
|
case SIM_MODEL::TYPE::V_PINKNOISE:
|
|
|
|
case SIM_MODEL::TYPE::I_PINKNOISE:
|
2022-09-22 05:38:45 +00:00
|
|
|
args.append( "0 " );
|
|
|
|
args.append( getParamValueString( "dt", "0" ) + " " );
|
|
|
|
args.append( getParamValueString( "slope", "0" ) + " " );
|
|
|
|
args.append( getParamValueString( "rms", "0" ) + " " );
|
|
|
|
args.append( "0 0 0 " );
|
2022-06-21 02:22:52 +00:00
|
|
|
break;
|
|
|
|
|
2022-09-15 03:25:57 +00:00
|
|
|
case SIM_MODEL::TYPE::V_BURSTNOISE:
|
|
|
|
case SIM_MODEL::TYPE::I_BURSTNOISE:
|
2022-09-22 05:38:45 +00:00
|
|
|
args.append( "0 0 0 0 " );
|
|
|
|
args.append( getParamValueString( "ampl", "0" ) + " " );
|
|
|
|
args.append( getParamValueString( "tcapt", "0" ) + " " );
|
|
|
|
args.append( getParamValueString( "temit", "0" ) + " " );
|
2022-06-21 02:22:52 +00:00
|
|
|
break;
|
|
|
|
|
2022-09-15 03:25:57 +00:00
|
|
|
case SIM_MODEL::TYPE::V_RANDUNIFORM:
|
|
|
|
case SIM_MODEL::TYPE::I_RANDUNIFORM:
|
2022-06-21 02:22:52 +00:00
|
|
|
{
|
2022-09-22 05:38:45 +00:00
|
|
|
args.append( "1 " );
|
|
|
|
args.append( getParamValueString( "dt", "0" ) + " " );
|
|
|
|
args.append( getParamValueString( "td", "0" ) + " " );
|
2022-06-21 02:22:52 +00:00
|
|
|
|
2022-09-14 07:19:25 +00:00
|
|
|
auto min = dynamic_cast<SIM_VALUE_FLOAT&>( *m_model.FindParam( "max" )->value );
|
|
|
|
auto max = dynamic_cast<SIM_VALUE_FLOAT&>( *m_model.FindParam( "min" )->value );
|
2022-06-21 02:22:52 +00:00
|
|
|
SIM_VALUE_FLOAT range = max - min;
|
|
|
|
SIM_VALUE_FLOAT offset = ( max + min ) / SIM_VALUE_FLOAT( 2 );
|
2022-05-31 02:55:48 +00:00
|
|
|
|
2022-09-22 05:38:45 +00:00
|
|
|
args.append( range.ToSpiceString() + " " );
|
|
|
|
args.append( offset.ToSpiceString() + " " );
|
2022-06-21 02:22:52 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2022-09-15 03:25:57 +00:00
|
|
|
case SIM_MODEL::TYPE::V_RANDNORMAL:
|
|
|
|
case SIM_MODEL::TYPE::I_RANDNORMAL:
|
2022-09-22 05:38:45 +00:00
|
|
|
args.append( "2 " );
|
|
|
|
args.append( getParamValueString( "dt", "0" ) + " " );
|
|
|
|
args.append( getParamValueString( "td", "0" ) + " " );
|
|
|
|
args.append( getParamValueString( "stddev", "0" ) + " " );
|
|
|
|
args.append( getParamValueString( "mean", "0" ) + " " );
|
2022-06-21 02:22:52 +00:00
|
|
|
break;
|
|
|
|
|
2022-09-15 03:25:57 +00:00
|
|
|
case SIM_MODEL::TYPE::V_RANDEXP:
|
|
|
|
case SIM_MODEL::TYPE::I_RANDEXP:
|
2022-09-22 05:38:45 +00:00
|
|
|
args.append( "3 " );
|
|
|
|
args.append( getParamValueString( "dt", "0" ) + " " );
|
|
|
|
args.append( getParamValueString( "td", "0" ) + " " );
|
|
|
|
args.append( getParamValueString( "mean", "0" ) + " " );
|
|
|
|
args.append( getParamValueString( "offset", "0" ) + " " );
|
2022-06-21 02:22:52 +00:00
|
|
|
break;
|
|
|
|
|
2022-09-15 03:25:57 +00:00
|
|
|
/*case SIM_MODEL::TYPE::V_RANDPOISSON:
|
|
|
|
case SIM_MODEL::TYPE::I_RANDPOISSON:
|
2022-09-22 05:38:45 +00:00
|
|
|
args.append( "4 " );
|
|
|
|
args.append( FindParam( "dt" )->value->ToSpiceString() + " " );
|
|
|
|
args.append( FindParam( "td" )->value->ToSpiceString() + " " );
|
|
|
|
args.append( FindParam( "lambda" )->value->ToSpiceString() + " " );
|
|
|
|
args.append( FindParam( "offset" )->value->ToSpiceString() + " " );
|
2022-06-21 02:22:52 +00:00
|
|
|
break;*/
|
|
|
|
|
|
|
|
default:
|
2022-09-15 03:25:57 +00:00
|
|
|
for( const SIM_MODEL::PARAM& param : m_model.GetParams() )
|
2022-06-21 02:22:52 +00:00
|
|
|
{
|
2022-09-22 05:38:45 +00:00
|
|
|
std::string argStr = param.value->ToString( SIM_VALUE_GRAMMAR::NOTATION::SPICE );
|
2022-06-21 02:22:52 +00:00
|
|
|
|
|
|
|
if( argStr != "" )
|
2022-09-22 05:38:45 +00:00
|
|
|
args.append( argStr + " " );
|
2022-06-21 02:22:52 +00:00
|
|
|
}
|
|
|
|
break;
|
2022-06-12 03:39:13 +00:00
|
|
|
}
|
2022-04-01 04:30:50 +00:00
|
|
|
|
2022-10-10 23:23:00 +00:00
|
|
|
item.modelName.append( fmt::format( "{}( {})", m_model.GetSpiceInfo().inlineTypeString, args ) );
|
2022-06-12 03:39:13 +00:00
|
|
|
}
|
|
|
|
else
|
2022-10-10 23:23:00 +00:00
|
|
|
item.modelName.append( m_model.GetParam( 0 ).value->ToSpiceString() );
|
2022-04-01 04:30:50 +00:00
|
|
|
|
2022-10-10 23:23:00 +00:00
|
|
|
return SPICE_GENERATOR::ItemLine( item );
|
2022-09-14 07:19:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-22 05:38:45 +00:00
|
|
|
std::string SPICE_GENERATOR_SOURCE::getParamValueString( const std::string& aParamName,
|
|
|
|
const std::string& aDefaultValue ) const
|
2022-09-14 07:19:25 +00:00
|
|
|
{
|
2022-09-22 05:38:45 +00:00
|
|
|
std::string result = m_model.FindParam( aParamName )->value->ToSpiceString();
|
2022-09-14 07:19:25 +00:00
|
|
|
|
|
|
|
if( result == "" )
|
|
|
|
result = aDefaultValue;
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SIM_MODEL_SOURCE::SIM_MODEL_SOURCE( TYPE aType )
|
2022-10-16 03:10:57 +00:00
|
|
|
: SIM_MODEL( aType, std::make_unique<SPICE_GENERATOR_SOURCE>( *this ) )
|
2022-09-14 07:19:25 +00:00
|
|
|
{
|
|
|
|
for( const SIM_MODEL::PARAM::INFO& paramInfo : makeParamInfos( aType ) )
|
|
|
|
AddParam( paramInfo );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SIM_MODEL_SOURCE::WriteDataSchFields( std::vector<SCH_FIELD>& aFields ) const
|
|
|
|
{
|
|
|
|
SIM_MODEL::WriteDataSchFields( aFields );
|
|
|
|
|
2022-10-16 03:10:57 +00:00
|
|
|
if( IsInferred() )
|
2022-09-14 07:19:25 +00:00
|
|
|
inferredWriteDataFields( aFields );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SIM_MODEL_SOURCE::WriteDataLibFields( std::vector<LIB_FIELD>& aFields ) const
|
|
|
|
{
|
|
|
|
SIM_MODEL::WriteDataLibFields( aFields );
|
|
|
|
|
2022-10-16 03:10:57 +00:00
|
|
|
if( IsInferred() )
|
2022-09-14 07:19:25 +00:00
|
|
|
inferredWriteDataFields( aFields );
|
2022-02-21 03:58:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-10-12 02:26:16 +00:00
|
|
|
void SIM_MODEL_SOURCE::SetParamValue( int aParamIndex, const SIM_VALUE& aValue )
|
2022-04-01 04:30:50 +00:00
|
|
|
{
|
|
|
|
// Sources are special. All preceding parameter values must be filled. If they are not, fill
|
|
|
|
// them out automatically. If a value is nulled, delete everything after it.
|
2022-10-04 15:17:41 +00:00
|
|
|
if( !aValue.HasValue() )
|
2022-04-01 04:30:50 +00:00
|
|
|
{
|
2022-08-24 04:13:55 +00:00
|
|
|
for( int paramIndex = static_cast<int>( aParamIndex );
|
|
|
|
paramIndex < GetParamCount();
|
|
|
|
++paramIndex )
|
|
|
|
{
|
2022-10-12 01:38:12 +00:00
|
|
|
m_params.at( aParamIndex ).value->FromString( "" );
|
2022-08-24 04:13:55 +00:00
|
|
|
}
|
2022-04-01 04:30:50 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-10-04 15:17:41 +00:00
|
|
|
for( int paramIndex = 0; paramIndex < aParamIndex; ++paramIndex )
|
2022-04-01 04:30:50 +00:00
|
|
|
{
|
2022-08-22 05:40:23 +00:00
|
|
|
if( GetParam( paramIndex ).value->ToString() == "" )
|
2022-10-12 01:38:12 +00:00
|
|
|
{
|
|
|
|
m_params.at( aParamIndex ).value->FromString( "0" );
|
2022-10-04 15:17:41 +00:00
|
|
|
SIM_MODEL::SetParamValue( paramIndex, "0" );
|
2022-10-12 01:38:12 +00:00
|
|
|
}
|
2022-04-01 04:30:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-04 15:17:41 +00:00
|
|
|
return SIM_MODEL::SetParamValue( aParamIndex, aValue );
|
2022-04-01 04:30:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-22 05:38:45 +00:00
|
|
|
std::string SIM_MODEL_SOURCE::GenerateParamValuePair( const PARAM& aParam, bool& aIsFirst ) const
|
2022-05-08 09:54:35 +00:00
|
|
|
{
|
|
|
|
if( aParam.value->ToString() == "0" )
|
|
|
|
return "";
|
|
|
|
|
|
|
|
return SIM_MODEL::GenerateParamValuePair( aParam, aIsFirst );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
void SIM_MODEL_SOURCE::inferredWriteDataFields( std::vector<T>& aFields ) const
|
|
|
|
{
|
2022-10-16 03:10:57 +00:00
|
|
|
std::string value;
|
|
|
|
|
|
|
|
if( GetTypeInfo().fieldValue != "" )
|
|
|
|
value = fmt::format( "{} {}",
|
|
|
|
GetTypeInfo().fieldValue,
|
|
|
|
GetFieldValue( &aFields, PARAMS_FIELD ) );
|
|
|
|
else
|
|
|
|
value = fmt::format( "{}", GetFieldValue( &aFields, PARAMS_FIELD ) );
|
2022-05-08 09:54:35 +00:00
|
|
|
|
2022-06-12 03:39:13 +00:00
|
|
|
if( value == "" )
|
|
|
|
value = GetDeviceTypeInfo().fieldValue;
|
2022-05-08 09:54:35 +00:00
|
|
|
|
|
|
|
WriteInferredDataFields( aFields, value );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-08-28 12:51:03 +00:00
|
|
|
const std::vector<SIM_MODEL::PARAM::INFO>& SIM_MODEL_SOURCE::makeParamInfos( TYPE aType )
|
2022-06-21 02:22:52 +00:00
|
|
|
{
|
2022-09-30 12:29:44 +00:00
|
|
|
static std::vector<PARAM::INFO> vdc = makeDcParamInfos( "y", "V" );
|
|
|
|
static std::vector<PARAM::INFO> idc = makeDcParamInfos( "y", "A" );
|
2022-06-21 02:22:52 +00:00
|
|
|
|
2022-09-30 12:29:44 +00:00
|
|
|
static std::vector<PARAM::INFO> vsin = makeSinParamInfos( "y", "V" );
|
|
|
|
static std::vector<PARAM::INFO> isin = makeSinParamInfos( "y", "A" );
|
2022-06-21 02:22:52 +00:00
|
|
|
|
2022-09-30 12:29:44 +00:00
|
|
|
static std::vector<PARAM::INFO> vpulse = makePulseParamInfos( "y", "V" );
|
|
|
|
static std::vector<PARAM::INFO> ipulse = makePulseParamInfos( "y", "A" );
|
2022-06-21 02:22:52 +00:00
|
|
|
|
2022-09-30 12:29:44 +00:00
|
|
|
static std::vector<PARAM::INFO> vexp = makeExpParamInfos( "y", "V" );
|
|
|
|
static std::vector<PARAM::INFO> iexp = makeExpParamInfos( "y", "A" );
|
2022-06-21 02:22:52 +00:00
|
|
|
|
2022-09-30 12:29:44 +00:00
|
|
|
/*static std::vector<PARAM::INFO> vsfam = makeSfamParamInfos( "y", "V" );
|
|
|
|
static std::vector<PARAM::INFO> isfam = makeSfamParamInfos( "y", "A" );
|
2022-06-21 02:22:52 +00:00
|
|
|
|
2022-09-30 12:29:44 +00:00
|
|
|
static std::vector<PARAM::INFO> vsffm = makeSffmParamInfos( "y", "V" );
|
|
|
|
static std::vector<PARAM::INFO> isffm = makeSffmParamInfos( "y", "A" );*/
|
2022-06-21 02:22:52 +00:00
|
|
|
|
2022-09-30 12:29:44 +00:00
|
|
|
static std::vector<PARAM::INFO> vpwl = makePwlParamInfos( "y", "Voltage", "V" );
|
|
|
|
static std::vector<PARAM::INFO> ipwl = makePwlParamInfos( "y", "Current", "A" );
|
2022-06-21 02:22:52 +00:00
|
|
|
|
2022-09-30 12:29:44 +00:00
|
|
|
static std::vector<PARAM::INFO> vwhitenoise = makeWhiteNoiseParamInfos( "y", "V" );
|
|
|
|
static std::vector<PARAM::INFO> iwhitenoise = makeWhiteNoiseParamInfos( "y", "A" );
|
2022-06-21 02:22:52 +00:00
|
|
|
|
2022-09-30 12:29:44 +00:00
|
|
|
static std::vector<PARAM::INFO> vpinknoise = makePinkNoiseParamInfos( "y", "V" );
|
|
|
|
static std::vector<PARAM::INFO> ipinknoise = makePinkNoiseParamInfos( "y", "A" );
|
2022-06-21 02:22:52 +00:00
|
|
|
|
2022-09-30 12:29:44 +00:00
|
|
|
static std::vector<PARAM::INFO> vburstnoise = makeBurstNoiseParamInfos( "y", "V" );
|
|
|
|
static std::vector<PARAM::INFO> iburstnoise = makeBurstNoiseParamInfos( "y", "A" );
|
2022-06-21 02:22:52 +00:00
|
|
|
|
2022-09-30 12:29:44 +00:00
|
|
|
static std::vector<PARAM::INFO> vrandomuniform = makeRandomUniformParamInfos( "y", "V" );
|
|
|
|
static std::vector<PARAM::INFO> irandomuniform = makeRandomUniformParamInfos( "y", "A" );
|
2022-06-21 02:22:52 +00:00
|
|
|
|
2022-09-30 12:29:44 +00:00
|
|
|
static std::vector<PARAM::INFO> vrandomnormal = makeRandomNormalParamInfos( "y", "V" );
|
|
|
|
static std::vector<PARAM::INFO> irandomnormal = makeRandomNormalParamInfos( "y", "A" );
|
2022-06-21 02:22:52 +00:00
|
|
|
|
2022-09-30 12:29:44 +00:00
|
|
|
static std::vector<PARAM::INFO> vrandomexp = makeRandomExpParamInfos( "y", "V" );
|
|
|
|
static std::vector<PARAM::INFO> irandomexp = makeRandomExpParamInfos( "y", "A" );
|
2022-06-21 02:22:52 +00:00
|
|
|
|
2022-09-30 12:29:44 +00:00
|
|
|
static std::vector<PARAM::INFO> vrandompoisson = makeRandomPoissonParamInfos( "y", "V" );
|
|
|
|
static std::vector<PARAM::INFO> irandompoisson = makeRandomPoissonParamInfos( "y", "A" );
|
2022-06-21 02:22:52 +00:00
|
|
|
|
|
|
|
switch( aType )
|
|
|
|
{
|
|
|
|
case TYPE::V: return vdc;
|
|
|
|
case TYPE::I: return idc;
|
|
|
|
case TYPE::V_SIN: return vsin;
|
|
|
|
case TYPE::I_SIN: return isin;
|
|
|
|
case TYPE::V_PULSE: return vpulse;
|
|
|
|
case TYPE::I_PULSE: return ipulse;
|
|
|
|
case TYPE::V_EXP: return vexp;
|
|
|
|
case TYPE::I_EXP: return iexp;
|
|
|
|
/*case TYPE::V_SFAM: return vsfam;
|
|
|
|
case TYPE::I_SFAM: return isfam;
|
|
|
|
case TYPE::V_SFFM: return vsffm;
|
|
|
|
case TYPE::I_SFFM: return isffm;*/
|
|
|
|
case TYPE::V_PWL: return vpwl;
|
|
|
|
case TYPE::I_PWL: return ipwl;
|
|
|
|
case TYPE::V_WHITENOISE: return vwhitenoise;
|
|
|
|
case TYPE::I_WHITENOISE: return iwhitenoise;
|
|
|
|
case TYPE::V_PINKNOISE: return vpinknoise;
|
|
|
|
case TYPE::I_PINKNOISE: return ipinknoise;
|
|
|
|
case TYPE::V_BURSTNOISE: return vburstnoise;
|
|
|
|
case TYPE::I_BURSTNOISE: return iburstnoise;
|
|
|
|
case TYPE::V_RANDUNIFORM: return vrandomuniform;
|
|
|
|
case TYPE::I_RANDUNIFORM: return irandomuniform;
|
|
|
|
case TYPE::V_RANDNORMAL: return vrandomnormal;
|
|
|
|
case TYPE::I_RANDNORMAL: return irandomnormal;
|
|
|
|
case TYPE::V_RANDEXP: return vrandomexp;
|
|
|
|
case TYPE::I_RANDEXP: return irandomexp;
|
|
|
|
//case TYPE::V_RANDPOISSON: return vrandompoisson;
|
|
|
|
//case TYPE::I_RANDPOISSON: return irandompoisson;
|
|
|
|
default:
|
|
|
|
wxFAIL_MSG( "Unhandled SIM_MODEL type in SIM_MODEL_SOURCE" );
|
2022-08-28 12:51:03 +00:00
|
|
|
static std::vector<SIM_MODEL::PARAM::INFO> empty;
|
2022-06-21 02:22:52 +00:00
|
|
|
return empty;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-22 05:38:45 +00:00
|
|
|
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeDcParamInfos( std::string aPrefix,
|
|
|
|
std::string aUnit )
|
2022-04-12 14:37:06 +00:00
|
|
|
{
|
|
|
|
std::vector<PARAM::INFO> paramInfos;
|
|
|
|
PARAM::INFO paramInfo;
|
|
|
|
|
|
|
|
paramInfo.name = "dc";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-04-12 14:37:06 +00:00
|
|
|
paramInfo.unit = aUnit;
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "DC value";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-06-12 03:39:13 +00:00
|
|
|
appendAcParamInfos( paramInfos, aUnit );
|
2022-04-12 14:37:06 +00:00
|
|
|
return paramInfos;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-22 05:38:45 +00:00
|
|
|
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeSinParamInfos( std::string aPrefix,
|
|
|
|
std::string aUnit )
|
2022-04-12 14:37:06 +00:00
|
|
|
{
|
|
|
|
std::vector<PARAM::INFO> paramInfos;
|
|
|
|
PARAM::INFO paramInfo;
|
|
|
|
|
|
|
|
paramInfo.name = "dc";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-04-12 14:37:06 +00:00
|
|
|
paramInfo.unit = aUnit;
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "";
|
|
|
|
paramInfo.description = "DC offset";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "ampl";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-04-12 14:37:06 +00:00
|
|
|
paramInfo.unit = aUnit;
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "";
|
|
|
|
paramInfo.description = "Amplitude";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "f";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-04-12 14:37:06 +00:00
|
|
|
paramInfo.unit = "Hz";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "1/tstop";
|
|
|
|
paramInfo.description = "Frequency";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "td";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-04-12 14:37:06 +00:00
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Delay";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "theta";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-04-12 14:37:06 +00:00
|
|
|
paramInfo.unit = "1/s";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Damping factor";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-06-12 03:39:13 +00:00
|
|
|
// "phase" is not needed. "td" is enough.
|
|
|
|
|
|
|
|
/*paramInfo.name = "phase";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-06-12 03:39:13 +00:00
|
|
|
paramInfo.unit = "°";
|
2022-04-12 14:37:06 +00:00
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Phase";
|
2022-06-12 03:39:13 +00:00
|
|
|
paramInfos.push_back( paramInfo );*/
|
2022-04-12 14:37:06 +00:00
|
|
|
|
2022-06-12 03:39:13 +00:00
|
|
|
appendAcParamInfos( paramInfos, aUnit );
|
2022-04-12 14:37:06 +00:00
|
|
|
return paramInfos;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-22 05:38:45 +00:00
|
|
|
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makePulseParamInfos( std::string aPrefix,
|
|
|
|
std::string aUnit )
|
2022-02-21 03:58:31 +00:00
|
|
|
{
|
|
|
|
std::vector<PARAM::INFO> paramInfos;
|
|
|
|
PARAM::INFO paramInfo;
|
|
|
|
|
|
|
|
paramInfo.name = aPrefix + "1";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = aUnit;
|
|
|
|
paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "";
|
|
|
|
paramInfo.description = "Initial value";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = aPrefix + "2";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = aUnit;
|
|
|
|
paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "";
|
|
|
|
paramInfo.description = "Initial value";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "td";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Delay";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "tr";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "tstep";
|
|
|
|
paramInfo.description = "Rise time";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "tf";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "tstep";
|
|
|
|
paramInfo.description = "Fall time";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-06-12 03:39:13 +00:00
|
|
|
paramInfo.name = "tw"; // Ngspice calls it "pw".
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "tstop";
|
|
|
|
paramInfo.description = "Pulse width";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "per";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "tstop";
|
|
|
|
paramInfo.description = "Period";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-06-12 03:39:13 +00:00
|
|
|
// "phase" is not needed. "td" is enough.
|
|
|
|
|
|
|
|
/*paramInfo.name = "phase";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-06-12 03:39:13 +00:00
|
|
|
paramInfo.unit = "°";
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Phase";
|
2022-06-12 03:39:13 +00:00
|
|
|
paramInfos.push_back( paramInfo );*/
|
2022-02-21 03:58:31 +00:00
|
|
|
|
2022-06-12 03:39:13 +00:00
|
|
|
appendAcParamInfos( paramInfos, aUnit );
|
2022-02-21 03:58:31 +00:00
|
|
|
return paramInfos;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-22 05:38:45 +00:00
|
|
|
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeExpParamInfos( std::string aPrefix,
|
|
|
|
std::string aUnit )
|
2022-02-21 03:58:31 +00:00
|
|
|
{
|
|
|
|
std::vector<PARAM::INFO> paramInfos;
|
|
|
|
PARAM::INFO paramInfo;
|
|
|
|
|
|
|
|
paramInfo.name = aPrefix + "1";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = aUnit;
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "";
|
|
|
|
paramInfo.description = "Initial value";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = aPrefix + "2";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = aUnit;
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "";
|
|
|
|
paramInfo.description = "Pulsed value";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "td1";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Rise delay time";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "tau1";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "tstep";
|
|
|
|
paramInfo.description = "Rise time constant";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "td2";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "td1+tstep";
|
|
|
|
paramInfo.description = "Fall delay time";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "tau2";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "tstep";
|
|
|
|
paramInfo.description = "Fall time constant";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-06-12 03:39:13 +00:00
|
|
|
appendAcParamInfos( paramInfos, aUnit );
|
2022-02-21 03:58:31 +00:00
|
|
|
return paramInfos;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-22 05:38:45 +00:00
|
|
|
/*std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeSfamParamInfos( std::string aPrefix, std::string aUnit )
|
2022-02-21 03:58:31 +00:00
|
|
|
{
|
|
|
|
std::vector<PARAM::INFO> paramInfos;
|
|
|
|
PARAM::INFO paramInfo;
|
|
|
|
|
2022-04-12 14:37:06 +00:00
|
|
|
paramInfo.name = "dc";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = aUnit;
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "";
|
|
|
|
paramInfo.description = "DC offset";
|
|
|
|
|
2022-04-12 14:37:06 +00:00
|
|
|
paramInfo.name = "ampl";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = aUnit;
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "";
|
|
|
|
paramInfo.description = "Amplitude";
|
|
|
|
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
paramInfo.name = "mo";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "";
|
|
|
|
paramInfo.description = "Modulating signal offset";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "fc";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "Hz";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "";
|
|
|
|
paramInfo.description = "Carrier frequency";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "mf";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "Hz";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "";
|
|
|
|
paramInfo.description = "Modulating frequency";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-06-12 03:39:13 +00:00
|
|
|
appendAcParamInfos( paramInfos, aUnit );
|
2022-02-21 03:58:31 +00:00
|
|
|
return paramInfos;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-22 05:38:45 +00:00
|
|
|
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeSffmParamInfos( std::string aPrefix, std::string aUnit )
|
2022-02-21 03:58:31 +00:00
|
|
|
{
|
|
|
|
std::vector<PARAM::INFO> paramInfos;
|
|
|
|
PARAM::INFO paramInfo;
|
|
|
|
|
2022-04-12 14:37:06 +00:00
|
|
|
paramInfo.name = "dc";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = aUnit;
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "";
|
|
|
|
paramInfo.description = "DC offset";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-04-12 14:37:06 +00:00
|
|
|
paramInfo.name = "ampl";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = aUnit;
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "";
|
|
|
|
paramInfo.description = "Amplitude";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "fc";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "Hz";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "1/tstop";
|
|
|
|
paramInfo.description = "Carrier frequency";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "mdi";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "";
|
|
|
|
paramInfo.description = "Modulation index";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "fs";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "Hz";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "1/tstop";
|
|
|
|
paramInfo.description = "Signal frequency";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "phasec";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-06-12 03:39:13 +00:00
|
|
|
paramInfo.unit = "°";
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Carrier phase";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "phases";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-06-12 03:39:13 +00:00
|
|
|
paramInfo.unit = "°";
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Signal phase";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-06-12 03:39:13 +00:00
|
|
|
appendAcParamInfos( paramInfos, aUnit );
|
2022-02-21 03:58:31 +00:00
|
|
|
return paramInfos;
|
2022-06-12 03:39:13 +00:00
|
|
|
}*/
|
2022-02-21 03:58:31 +00:00
|
|
|
|
|
|
|
|
2022-09-22 05:38:45 +00:00
|
|
|
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makePwlParamInfos( std::string aPrefix,
|
|
|
|
std::string aQuantity,
|
|
|
|
std::string aUnit )
|
2022-02-21 03:58:31 +00:00
|
|
|
{
|
|
|
|
std::vector<PARAM::INFO> paramInfos;
|
|
|
|
PARAM::INFO paramInfo;
|
|
|
|
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.name = "pwl";
|
|
|
|
paramInfo.type = SIM_VALUE::TYPE_STRING;
|
|
|
|
paramInfo.unit = "s," + aUnit;
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "";
|
|
|
|
paramInfo.description = aUnit == "V" ? "Time-voltage points" : "Time-current points";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
// TODO: Ngspice doesn't support "td" and "r" for current sources, so let's disable that for
|
|
|
|
// now.
|
|
|
|
|
|
|
|
/*paramInfo.name = "td";
|
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = aUnit == "V" ? "Time-voltage points" : "Time-current points";
|
|
|
|
paramInfo.isSpiceInstanceParam = true;
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "repeat";
|
|
|
|
paramInfo.type = SIM_VALUE::TYPE_BOOL;
|
|
|
|
paramInfo.unit = "";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Repeat forever";
|
|
|
|
paramInfo.isSpiceInstanceParam = true;
|
|
|
|
paramInfo.spiceInstanceName = "r";
|
|
|
|
paramInfos.push_back( paramInfo );*/
|
|
|
|
|
|
|
|
/*paramInfo.name = "t";
|
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT_VECTOR;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "";
|
|
|
|
paramInfo.description = "Time vector";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = aPrefix;
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT_VECTOR;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = aUnit;
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "";
|
|
|
|
paramInfo.description = aQuantity + " vector";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "repeat";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_BOOL;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "";
|
|
|
|
paramInfo.description = "Repeat forever";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "td";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Delay";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfos.push_back( paramInfo );*/
|
2022-02-21 03:58:31 +00:00
|
|
|
|
2022-06-12 03:39:13 +00:00
|
|
|
appendAcParamInfos( paramInfos, aUnit );
|
2022-02-21 03:58:31 +00:00
|
|
|
return paramInfos;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-22 05:38:45 +00:00
|
|
|
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeWhiteNoiseParamInfos( std::string aPrefix,
|
|
|
|
std::string aUnit )
|
2022-02-21 03:58:31 +00:00
|
|
|
{
|
|
|
|
std::vector<PARAM::INFO> paramInfos;
|
|
|
|
PARAM::INFO paramInfo;
|
|
|
|
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.name = "rms";
|
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = aUnit;
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "White noise RMS amplitude";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.name = "dt";
|
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-03-09 01:40:59 +00:00
|
|
|
paramInfo.unit = "s";
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
2022-03-09 01:40:59 +00:00
|
|
|
paramInfo.description = "Time step";
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-06-12 03:39:13 +00:00
|
|
|
appendAcParamInfos( paramInfos, aUnit );
|
2022-02-21 03:58:31 +00:00
|
|
|
return paramInfos;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-22 05:38:45 +00:00
|
|
|
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makePinkNoiseParamInfos( std::string aPrefix,
|
|
|
|
std::string aUnit )
|
2022-02-21 03:58:31 +00:00
|
|
|
{
|
|
|
|
std::vector<PARAM::INFO> paramInfos;
|
|
|
|
PARAM::INFO paramInfo;
|
|
|
|
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.name = "rms";
|
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.description = "1/f noise RMS amplitude";
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.name = "slope";
|
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.defaultValue = "1";
|
|
|
|
paramInfo.description = "1/f noise exponent";
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.name = "dt";
|
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Time step";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-06-12 03:39:13 +00:00
|
|
|
appendAcParamInfos( paramInfos, aUnit );
|
2022-02-21 03:58:31 +00:00
|
|
|
return paramInfos;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-22 05:38:45 +00:00
|
|
|
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeBurstNoiseParamInfos( std::string aPrefix,
|
|
|
|
std::string aUnit )
|
2022-02-21 03:58:31 +00:00
|
|
|
{
|
|
|
|
std::vector<PARAM::INFO> paramInfos;
|
|
|
|
PARAM::INFO paramInfo;
|
|
|
|
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.name = "ampl";
|
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-03-09 01:40:59 +00:00
|
|
|
paramInfo.unit = aUnit;
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Burst noise amplitude";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.name = "tcapt";
|
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Burst noise trap capture time";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.name = "temit";
|
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Burst noise trap emission time";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-06-12 03:39:13 +00:00
|
|
|
appendAcParamInfos( paramInfos, aUnit );
|
2022-02-21 03:58:31 +00:00
|
|
|
return paramInfos;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-22 05:38:45 +00:00
|
|
|
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeRandomUniformParamInfos( std::string aPrefix,
|
|
|
|
std::string aUnit )
|
2022-02-21 03:58:31 +00:00
|
|
|
{
|
|
|
|
std::vector<PARAM::INFO> paramInfos;
|
|
|
|
PARAM::INFO paramInfo;
|
|
|
|
|
|
|
|
paramInfo.name = "min";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = aUnit;
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "-0.5";
|
|
|
|
paramInfo.description = "Min. value";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "max";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = aUnit;
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0.5";
|
|
|
|
paramInfo.description = "Max. value";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.name = "dt";
|
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Time step";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.name = "td";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Delay";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-06-12 03:39:13 +00:00
|
|
|
appendAcParamInfos( paramInfos, aUnit );
|
2022-02-21 03:58:31 +00:00
|
|
|
return paramInfos;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-22 05:38:45 +00:00
|
|
|
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeRandomNormalParamInfos( std::string aPrefix,
|
|
|
|
std::string aUnit )
|
2022-02-21 03:58:31 +00:00
|
|
|
{
|
|
|
|
std::vector<PARAM::INFO> paramInfos;
|
|
|
|
PARAM::INFO paramInfo;
|
|
|
|
|
|
|
|
paramInfo.name = "mean";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = aUnit;
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Mean";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "stddev";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = aUnit;
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "1";
|
|
|
|
paramInfo.description = "Standard deviation";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.name = "dt";
|
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Time step";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.name = "td";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Delay";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-06-12 03:39:13 +00:00
|
|
|
appendAcParamInfos( paramInfos, aUnit );
|
2022-02-21 03:58:31 +00:00
|
|
|
return paramInfos;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-22 05:38:45 +00:00
|
|
|
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeRandomExpParamInfos( std::string aPrefix,
|
|
|
|
std::string aUnit )
|
2022-02-21 03:58:31 +00:00
|
|
|
{
|
|
|
|
std::vector<PARAM::INFO> paramInfos;
|
|
|
|
PARAM::INFO paramInfo;
|
|
|
|
|
|
|
|
paramInfo.name = "offset";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = aUnit;
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Offset";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "mean";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = aUnit;
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "1";
|
|
|
|
paramInfo.description = "Mean";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.name = "dt";
|
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Time step";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.name = "td";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Delay";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-06-12 03:39:13 +00:00
|
|
|
appendAcParamInfos( paramInfos, aUnit );
|
2022-02-21 03:58:31 +00:00
|
|
|
return paramInfos;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-22 05:38:45 +00:00
|
|
|
std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_SOURCE::makeRandomPoissonParamInfos( std::string aPrefix,
|
|
|
|
std::string aUnit )
|
2022-02-21 03:58:31 +00:00
|
|
|
{
|
|
|
|
std::vector<PARAM::INFO> paramInfos;
|
|
|
|
PARAM::INFO paramInfo;
|
|
|
|
|
|
|
|
paramInfo.name = "offset";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = aUnit;
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Offset";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "lambda";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = aUnit;
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "1";
|
|
|
|
paramInfo.description = "Mean";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.name = "dt";
|
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Time step";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.name = "td";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-02-21 03:58:31 +00:00
|
|
|
paramInfo.unit = "s";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "Delay";
|
|
|
|
paramInfos.push_back( paramInfo );
|
|
|
|
|
2022-06-12 03:39:13 +00:00
|
|
|
appendAcParamInfos( paramInfos, aUnit );
|
2022-02-21 03:58:31 +00:00
|
|
|
return paramInfos;
|
|
|
|
}
|
2022-06-12 03:39:13 +00:00
|
|
|
|
2022-09-22 05:38:45 +00:00
|
|
|
void SIM_MODEL_SOURCE::appendAcParamInfos( std::vector<PARAM::INFO>& aParamInfos, std::string aUnit )
|
2022-06-12 03:39:13 +00:00
|
|
|
{
|
|
|
|
PARAM::INFO paramInfo;
|
|
|
|
|
|
|
|
paramInfo.name = "ac";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-06-12 03:39:13 +00:00
|
|
|
paramInfo.unit = aUnit;
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::AC;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "AC magnitude";
|
|
|
|
aParamInfos.push_back( paramInfo );
|
|
|
|
|
|
|
|
paramInfo.name = "ph";
|
2022-06-21 02:22:52 +00:00
|
|
|
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
|
2022-06-12 03:39:13 +00:00
|
|
|
paramInfo.unit = "°";
|
|
|
|
paramInfo.category = SIM_MODEL::PARAM::CATEGORY::AC;
|
|
|
|
paramInfo.defaultValue = "0";
|
|
|
|
paramInfo.description = "AC phase";
|
|
|
|
aParamInfos.push_back( paramInfo );
|
|
|
|
}
|