30 std::string r=
"0", l=
"0", g=
"0", c=
"0", len=
"1";
34 case SIM_MODEL::TYPE::TLINE_Z0:
39 if( std::isnan( z0 ) || std::isnan( td ) )
40 return fmt::format(
".model {} LTRA()\n", aItem.
modelName );
42 l = fmt::format(
"{:g}", td * z0 );
43 c = fmt::format(
"{:g}", td / z0 );
46 case SIM_MODEL::TYPE::TLINE_RLGC:
56 if(
m_model.FindParam(
"len" ) )
61 wxFAIL_MSG(
"Unhandled SIM_MODEL type in SIM_MODEL_TLINE" );
65 return fmt::format(
".model {} LTRA( r={} l={} g={} c={} len={} )\n",
83 case TYPE::TLINE_RLGC:
89 wxFAIL_MSG(
"Unhandled SIM_MODEL type in SIM_MODEL_TLINE" );
97 std::vector<SIMPARAM::INFO> paramInfos;
100 paramInfo.
name =
"z0";
102 paramInfo.
unit =
"Ω";
105 paramInfo.
description =
"Characteristic impedance";
108 paramInfos.push_back( paramInfo );
110 paramInfo.
name =
"td";
112 paramInfo.
unit =
"s";
118 paramInfos.push_back( paramInfo );
126 std::vector<SIMPARAM::INFO> paramInfos;
129 paramInfo.
name =
"len";
131 paramInfo.
unit =
"m";
137 paramInfos.push_back( paramInfo );
139 paramInfo.
name =
"r";
141 paramInfo.
unit =
"Ω/m";
147 paramInfos.push_back( paramInfo );
149 paramInfo.
name =
"l";
151 paramInfo.
unit =
"H/m";
157 paramInfos.push_back( paramInfo );
159 paramInfo.
name =
"g";
161 paramInfo.
unit =
"1/(Ω m)";
167 paramInfos.push_back( paramInfo );
169 paramInfo.
name =
"c";
171 paramInfo.
unit =
"F/m";
177 paramInfos.push_back( paramInfo );
static std::vector< PARAM::INFO > makeRlgcParamInfos()
static std::vector< PARAM::INFO > makeZ0ParamInfos()
SIM_MODEL_TLINE(TYPE aType)
void AddParam(const PARAM::INFO &aInfo)
static double ToDouble(const std::string &aString, double aDefault=NAN)
static std::string ToSpice(const std::string &aString)
std::string ModelLine(const SPICE_ITEM &aItem) const override
const SIM_MODEL & m_model
SIM_MODEL::PARAM SIMPARAM
bool isSpiceInstanceParam