35 case SIM_MODEL::TYPE::SW_V:
41 case SIM_MODEL::TYPE::SW_I:
43 std::string vsourceName = fmt::format(
"V__{}", aItem.
refName );
45 wxCHECK_MSG( aItem.
pinNetNames.size() >= 2,
"", wxS(
"Missing two pin net names for SW_I" ) );
57 wxFAIL_MSG( wxS(
"Unhandled SIM_MODEL type in SIM_MODEL_SWITCH" ) );
77 std::string value = param.
value;
80 result.append(
" " + value );
91 case SIM_MODEL::TYPE::SW_V:
94 case SIM_MODEL::TYPE::SW_I:
98 wxFAIL_MSG(
"Unhandled SIM_MODEL type in SIM_MODEL_SWITCH" );
124 wxFAIL_MSG( wxS(
"Unhandled SIM_MODEL type in SIM_MODEL_SWITCH" ) );
132 std::vector<PARAM::INFO> paramInfos;
135 paramInfo.
name =
"thr";
137 paramInfo.
unit =
"V";
144 paramInfos.push_back( paramInfo );
146 paramInfo.
name =
"his";
148 paramInfo.
unit =
"V";
155 paramInfos.push_back( paramInfo );
157 paramInfo.
name =
"ron";
159 paramInfo.
unit =
"Ω";
166 paramInfos.push_back( paramInfo );
168 paramInfo.
name =
"roff";
170 paramInfo.
unit =
"Ω";
177 paramInfos.push_back( paramInfo );
179 paramInfo.
name =
"ic";
187 paramInfo.
enumValues = {
"none",
"off",
"on" };
188 paramInfos.push_back( paramInfo );
196 std::vector<PARAM::INFO> paramInfos;
199 paramInfo.
name =
"thr";
201 paramInfo.
unit =
"A";
208 paramInfos.push_back( paramInfo );
210 paramInfo.
name =
"his";
212 paramInfo.
unit =
"A";
219 paramInfos.push_back( paramInfo );
221 paramInfo.
name =
"ron";
223 paramInfo.
unit =
"Ω";
230 paramInfos.push_back( paramInfo );
232 paramInfo.
name =
"roff";
234 paramInfo.
unit =
"Ω";
241 paramInfos.push_back( paramInfo );
243 paramInfo.
name =
"ic";
251 paramInfo.
enumValues = {
"none",
"off",
"on" };
252 paramInfos.push_back( paramInfo );
SIM_MODEL_SWITCH(TYPE aType)
static const std::vector< PARAM::INFO > makeSwVParamInfos()
static const std::vector< PARAM::INFO > makeSwIParamInfos()
void AddParam(const PARAM::INFO &aInfo)
virtual const PARAM & GetParam(unsigned aParamIndex) const
int GetParamCount() const
const SIM_MODEL_PIN & GetPin(unsigned aIndex) const
std::string ItemLine(const SPICE_ITEM &aItem) const override
std::string ItemParams() const override
std::vector< std::reference_wrapper< const SIM_MODEL_PIN > > GetPins() const override
virtual std::string ItemLine(const SPICE_ITEM &aItem) const
const SIM_MODEL & m_model
std::string spiceModelName
std::vector< std::string > enumValues
bool isSpiceInstanceParam
std::vector< std::string > pinNetNames