mirror of https://github.com/KLayout/klayout.git
[bugfix] making 'R', 'L' and 'C' parameters too for the respective Spice elements (beside 'value')
This commit is contained in:
parent
da52eeb7c3
commit
f25d20be20
|
|
@ -381,6 +381,9 @@ void NetlistSpiceReaderDelegate::parse_element (const std::string &s, const std:
|
||||||
error (tl::to_string (tr ("Can't find a value for a R, C or L device")));
|
error (tl::to_string (tr ("Can't find a value for a R, C or L device")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// store the value under the element name always
|
||||||
|
pv[element] = tl::Variant (value);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// others: n-terminal devices with a model (last node)
|
// others: n-terminal devices with a model (last node)
|
||||||
|
|
@ -416,8 +419,6 @@ bool NetlistSpiceReaderDelegate::element (db::Circuit *circuit, const std::strin
|
||||||
std::map<std::string, tl::Variant> params = pv;
|
std::map<std::string, tl::Variant> params = pv;
|
||||||
std::vector<size_t> terminal_order;
|
std::vector<size_t> terminal_order;
|
||||||
|
|
||||||
size_t defp = std::numeric_limits<size_t>::max ();
|
|
||||||
|
|
||||||
double mult = 1.0;
|
double mult = 1.0;
|
||||||
auto mp = params.find ("M");
|
auto mp = params.find ("M");
|
||||||
if (mp != params.end ()) {
|
if (mp != params.end ()) {
|
||||||
|
|
@ -461,8 +462,7 @@ bool NetlistSpiceReaderDelegate::element (db::Circuit *circuit, const std::strin
|
||||||
|
|
||||||
// Apply multiplier (divider, according to ngspice manual)
|
// Apply multiplier (divider, according to ngspice manual)
|
||||||
value /= mult;
|
value /= mult;
|
||||||
|
params["R"] = tl::Variant (value);
|
||||||
defp = db::DeviceClassResistor::param_id_R;
|
|
||||||
|
|
||||||
// Apply multiplier to other parameters
|
// Apply multiplier to other parameters
|
||||||
static const char *scale_params[] = { "A", "P", "W" };
|
static const char *scale_params[] = { "A", "P", "W" };
|
||||||
|
|
@ -492,8 +492,7 @@ bool NetlistSpiceReaderDelegate::element (db::Circuit *circuit, const std::strin
|
||||||
|
|
||||||
// Apply multiplier (divider, according to ngspice manual)
|
// Apply multiplier (divider, according to ngspice manual)
|
||||||
value /= mult;
|
value /= mult;
|
||||||
|
params["L"] = tl::Variant (value);
|
||||||
defp = db::DeviceClassInductor::param_id_L;
|
|
||||||
|
|
||||||
} else if (element == "C") {
|
} else if (element == "C") {
|
||||||
|
|
||||||
|
|
@ -525,8 +524,7 @@ bool NetlistSpiceReaderDelegate::element (db::Circuit *circuit, const std::strin
|
||||||
|
|
||||||
// Apply multiplier
|
// Apply multiplier
|
||||||
value *= mult;
|
value *= mult;
|
||||||
|
params["C"] = tl::Variant (value);
|
||||||
defp = db::DeviceClassCapacitor::param_id_C;
|
|
||||||
|
|
||||||
// Apply multiplier to other parameters
|
// Apply multiplier to other parameters
|
||||||
static const char *scale_params[] = { "A", "P" };
|
static const char *scale_params[] = { "A", "P" };
|
||||||
|
|
@ -657,8 +655,6 @@ bool NetlistSpiceReaderDelegate::element (db::Circuit *circuit, const std::strin
|
||||||
double pv = 0.0;
|
double pv = 0.0;
|
||||||
if (v != params.end ()) {
|
if (v != params.end ()) {
|
||||||
pv = v->second.to_double ();
|
pv = v->second.to_double ();
|
||||||
} else if (i->id () == defp) {
|
|
||||||
pv = value;
|
|
||||||
} else {
|
} else {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue