From c43050b91b92c67abe84fa4359c9189f8904ff7b Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 9 Jan 2023 15:22:18 +0000 Subject: [PATCH] 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 --- .../netlist_exporters/netlist_exporter_spice.cpp | 2 ++ eeschema/sim/sim_model.cpp | 14 +------------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/eeschema/netlist_exporters/netlist_exporter_spice.cpp b/eeschema/netlist_exporters/netlist_exporter_spice.cpp index 37102acdea..7e706b5c8d 100644 --- a/eeschema/netlist_exporters/netlist_exporter_spice.cpp +++ b/eeschema/netlist_exporters/netlist_exporter_spice.cpp @@ -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, diff --git a/eeschema/sim/sim_model.cpp b/eeschema/sim/sim_model.cpp index 342b0f77da..d67141f971 100644 --- a/eeschema/sim/sim_model.cpp +++ b/eeschema/sim/sim_model.cpp @@ -1040,19 +1040,7 @@ void SIM_MODEL::doReadDataFields( const std::vector* 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 ) ); }