From 190ee58ccfa2203e253c2df971b563817df275d6 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 1 Mar 2023 16:04:10 +0000 Subject: [PATCH] Don't deliver pedantic error messages to user. --- eeschema/sim/sim_model.cpp | 14 ++------------ eeschema/sim/sim_model_ngspice.cpp | 6 +----- eeschema/sim/sim_model_spice.cpp | 9 --------- eeschema/sim/sim_model_spice.h | 5 +---- 4 files changed, 4 insertions(+), 30 deletions(-) diff --git a/eeschema/sim/sim_model.cpp b/eeschema/sim/sim_model.cpp index fede1ecb4b..f0758e8ea6 100644 --- a/eeschema/sim/sim_model.cpp +++ b/eeschema/sim/sim_model.cpp @@ -780,12 +780,7 @@ void SIM_MODEL::SetPinSymbolPinNumber( const std::string& aPinName, int aPinIndex = (int) strtol( aPinName.c_str(), nullptr, 10 ); if( aPinIndex < 1 || aPinIndex > (int) m_pins.size() ) - { - THROW_IO_ERROR( wxString::Format( _( "Could not find a pin named '%s' in simulation " - "model of type '%s'" ), - aPinName, - GetTypeInfo().fieldValue ) ); - } + THROW_IO_ERROR( wxString::Format( _( "Unknown simulation model pin '%s'" ), aPinName ) ); m_pins[ --aPinIndex /* convert to 0-based */ ].symbolPinNumber = aSymbolPinNumber; } @@ -874,12 +869,7 @@ void SIM_MODEL::SetParamValue( const std::string& aParamName, const std::string& int idx = doFindParam( aParamName ); if( idx < 0 ) - { - THROW_IO_ERROR( wxString::Format( _( "Could not find a parameter named '%s' in " - "simulation model of type '%s'" ), - aParamName, - GetTypeInfo().fieldValue ) ); - } + THROW_IO_ERROR( wxString::Format( "Unknown simulation model parameter '%s'", aParamName ) ); SetParamValue( idx, aValue, aNotation ); } diff --git a/eeschema/sim/sim_model_ngspice.cpp b/eeschema/sim/sim_model_ngspice.cpp index 663bac8a7f..66b35297e5 100644 --- a/eeschema/sim/sim_model_ngspice.cpp +++ b/eeschema/sim/sim_model_ngspice.cpp @@ -160,11 +160,7 @@ void SIM_MODEL_NGSPICE::SetParamFromSpiceCode( const std::string& aParamName, } if( !canSilentlyIgnoreParam( paramName ) ) - { - THROW_IO_ERROR( wxString::Format( "Failed to set parameter '%s' to value '%s'", - aParamName, - aValue ) ); - } + THROW_IO_ERROR( wxString::Format( "Unknown simulation model parameter '%s'", aParamName ) ); } diff --git a/eeschema/sim/sim_model_spice.cpp b/eeschema/sim/sim_model_spice.cpp index 8879374d33..731ac76ccd 100644 --- a/eeschema/sim/sim_model_spice.cpp +++ b/eeschema/sim/sim_model_spice.cpp @@ -93,15 +93,6 @@ SIM_MODEL_SPICE::SIM_MODEL_SPICE( TYPE aType, std::unique_ptr a } -void SIM_MODEL_SPICE::doSetParamValue( int aParamIndex, const std::string& aValue ) -{ - if( m_spiceCode != "" ) - THROW_IO_ERROR( "Could not change model parameters: library models are immutable" ); - - SIM_MODEL::doSetParamValue( aParamIndex, aValue ); -} - - void SIM_MODEL_SPICE::SetParamFromSpiceCode( const std::string& aParamName, const std::string& aParamValue, SIM_VALUE_GRAMMAR::NOTATION aNotation ) diff --git a/eeschema/sim/sim_model_spice.h b/eeschema/sim/sim_model_spice.h index e2a42f189d..7016d9a73f 100644 --- a/eeschema/sim/sim_model_spice.h +++ b/eeschema/sim/sim_model_spice.h @@ -58,12 +58,9 @@ public: std::unique_ptr aSpiceModelParser ); protected: - void doSetParamValue( int aParamIndex, const std::string& aValue ) override; - virtual void SetParamFromSpiceCode( const std::string& aParamName, const std::string& aParamValue, - SIM_VALUE_GRAMMAR::NOTATION aNotation - = SIM_VALUE_GRAMMAR::NOTATION::SPICE ); + SIM_VALUE_GRAMMAR::NOTATION aNotation = SIM_VALUE_GRAMMAR::NOTATION::SPICE ); std::string m_spiceCode;