34 std::string r=
"0", l=
"0", g=
"0", c=
"0", len=
"1";
38 case SIM_MODEL::TYPE::TLINE_Z0:
43 if( std::isnan( z0 ) || std::isnan( td ) )
44 return fmt::format(
".model {} LTRA()\n", aItem.
modelName );
46 l = fmt::format(
"{:g}", td * z0 );
47 c = fmt::format(
"{:g}", td / z0 );
50 case SIM_MODEL::TYPE::TLINE_RLGC:
65 wxFAIL_MSG(
"Unhandled SIM_MODEL type in SIM_MODEL_TLINE" );
69 return fmt::format(
".model {} LTRA( r={} l={} g={} c={} len={} )\n",
87 case TYPE::TLINE_RLGC:
93 wxFAIL_MSG(
"Unhandled SIM_MODEL type in SIM_MODEL_TLINE" );
101 std::vector<PARAM::INFO> paramInfos;
104 paramInfo.
name =
"z0";
106 paramInfo.
unit =
"Ω";
109 paramInfo.
description =
"Characteristic impedance";
112 paramInfos.push_back( paramInfo );
114 paramInfo.
name =
"td";
116 paramInfo.
unit =
"s";
122 paramInfos.push_back( paramInfo );
130 std::vector<PARAM::INFO> paramInfos;
133 paramInfo.
name =
"len";
135 paramInfo.
unit =
"m";
141 paramInfos.push_back( paramInfo );
143 paramInfo.
name =
"r";
145 paramInfo.
unit =
"Ω/m";
151 paramInfos.push_back( paramInfo );
153 paramInfo.
name =
"l";
155 paramInfo.
unit =
"H/m";
161 paramInfos.push_back( paramInfo );
163 paramInfo.
name =
"g";
165 paramInfo.
unit =
"1/(Ω m)";
171 paramInfos.push_back( paramInfo );
173 paramInfo.
name =
"c";
175 paramInfo.
unit =
"F/m";
181 paramInfos.push_back( paramInfo );
static std::vector< PARAM::INFO > makeRlgcParamInfos()
SIM_MODEL_TLINE(TYPE aType)
static std::vector< PARAM::INFO > makeZ0ParamInfos()
void AddParam(const PARAM::INFO &aInfo)
const PARAM * FindParam(const std::string &aParamName) const
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
bool isSpiceInstanceParam