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" ) );
72 std::string value = param.value;
75 result.append(
" " + value );
86 case SIM_MODEL::TYPE::SW_V:
89 case SIM_MODEL::TYPE::SW_I:
93 wxFAIL_MSG(
"Unhandled SIM_MODEL type in SIM_MODEL_SWITCH" );
119 wxFAIL_MSG( wxS(
"Unhandled SIM_MODEL type in SIM_MODEL_SWITCH" ) );
127 std::vector<PARAM::INFO> paramInfos;
130 paramInfo.
name =
"thr";
132 paramInfo.
unit =
"V";
139 paramInfos.push_back( paramInfo );
141 paramInfo.
name =
"his";
143 paramInfo.
unit =
"V";
150 paramInfos.push_back( paramInfo );
152 paramInfo.
name =
"ron";
154 paramInfo.
unit =
"Ω";
161 paramInfos.push_back( paramInfo );
163 paramInfo.
name =
"roff";
165 paramInfo.
unit =
"Ω";
172 paramInfos.push_back( paramInfo );
174 paramInfo.
name =
"ic";
182 paramInfo.
enumValues = {
"none",
"off",
"on" };
183 paramInfos.push_back( paramInfo );
191 std::vector<PARAM::INFO> paramInfos;
194 paramInfo.
name =
"thr";
196 paramInfo.
unit =
"A";
203 paramInfos.push_back( paramInfo );
205 paramInfo.
name =
"his";
207 paramInfo.
unit =
"A";
214 paramInfos.push_back( paramInfo );
216 paramInfo.
name =
"ron";
218 paramInfo.
unit =
"Ω";
225 paramInfos.push_back( paramInfo );
227 paramInfo.
name =
"roff";
229 paramInfo.
unit =
"Ω";
236 paramInfos.push_back( paramInfo );
238 paramInfo.
name =
"ic";
246 paramInfo.
enumValues = {
"none",
"off",
"on" };
247 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)
const 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::vector< std::reference_wrapper< const SIM_MODEL::PARAM > > GetInstanceParams() const
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