Remove safety around reading default parameter from Value field.
This should be OK now because we should be writing out all parameters now (even if they're default value). But perhaps more to the point, if we have the safety in there then we miss cases where we really can't parse the model (value of "{VCC}") and we need to fall back to a raw spice model. Fixes https://gitlab.com/kicad/code/kicad/issues/13444
This commit is contained in:
parent
be5810a1ce
commit
c43050b91b
|
@ -237,6 +237,8 @@ bool NETLIST_EXPORTER_SPICE::ReadSchematicAndLibraries( unsigned aNetlistOptions
|
|||
wxString modelParams;
|
||||
wxString pinMap;
|
||||
|
||||
// JEY TODO: readModel() below will also do the inference, so I don't think this
|
||||
// accomplishes anything....
|
||||
// Infer RLC and VI models if they aren't specified
|
||||
if( SIM_MODEL::InferSimModel( *symbol, &spiceItem.fields, true,
|
||||
SIM_VALUE_GRAMMAR::NOTATION::SPICE, &deviceType,
|
||||
|
|
|
@ -1040,19 +1040,7 @@ void SIM_MODEL::doReadDataFields( const std::vector<T>* aFields,
|
|||
std::string paramsField = GetFieldValue( aFields, SIM_PARAMS_FIELD );
|
||||
|
||||
if( !m_serializer->ParseParams( paramsField ) )
|
||||
{
|
||||
// We're relying on the absence of the primary parameter in PARAMS_FIELD to signal that
|
||||
// it's stored in VALUE_FIELD. But that's a poor determinant as it may just be that the
|
||||
// primary parameter is its default value. So see if we have anything in VALUE_FIELD,
|
||||
// but don't be belligerent about it.
|
||||
try
|
||||
{
|
||||
m_serializer->ParseValue( GetFieldValue( aFields, SIM_VALUE_FIELD ) );
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
}
|
||||
}
|
||||
m_serializer->ParseValue( GetFieldValue( aFields, SIM_VALUE_FIELD ) );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue