Don't deliver pedantic error messages to user.

This commit is contained in:
Jeff Young 2023-03-01 16:04:10 +00:00
parent db2780090c
commit 190ee58ccf
4 changed files with 4 additions and 30 deletions

View File

@ -780,12 +780,7 @@ void SIM_MODEL::SetPinSymbolPinNumber( const std::string& aPinName,
int aPinIndex = (int) strtol( aPinName.c_str(), nullptr, 10 ); int aPinIndex = (int) strtol( aPinName.c_str(), nullptr, 10 );
if( aPinIndex < 1 || aPinIndex > (int) m_pins.size() ) if( aPinIndex < 1 || aPinIndex > (int) m_pins.size() )
{ THROW_IO_ERROR( wxString::Format( _( "Unknown simulation model pin '%s'" ), aPinName ) );
THROW_IO_ERROR( wxString::Format( _( "Could not find a pin named '%s' in simulation "
"model of type '%s'" ),
aPinName,
GetTypeInfo().fieldValue ) );
}
m_pins[ --aPinIndex /* convert to 0-based */ ].symbolPinNumber = aSymbolPinNumber; 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 ); int idx = doFindParam( aParamName );
if( idx < 0 ) if( idx < 0 )
{ THROW_IO_ERROR( wxString::Format( "Unknown simulation model parameter '%s'", aParamName ) );
THROW_IO_ERROR( wxString::Format( _( "Could not find a parameter named '%s' in "
"simulation model of type '%s'" ),
aParamName,
GetTypeInfo().fieldValue ) );
}
SetParamValue( idx, aValue, aNotation ); SetParamValue( idx, aValue, aNotation );
} }

View File

@ -160,11 +160,7 @@ void SIM_MODEL_NGSPICE::SetParamFromSpiceCode( const std::string& aParamName,
} }
if( !canSilentlyIgnoreParam( paramName ) ) if( !canSilentlyIgnoreParam( paramName ) )
{ THROW_IO_ERROR( wxString::Format( "Unknown simulation model parameter '%s'", aParamName ) );
THROW_IO_ERROR( wxString::Format( "Failed to set parameter '%s' to value '%s'",
aParamName,
aValue ) );
}
} }

View File

@ -93,15 +93,6 @@ SIM_MODEL_SPICE::SIM_MODEL_SPICE( TYPE aType, std::unique_ptr<SPICE_GENERATOR> 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, void SIM_MODEL_SPICE::SetParamFromSpiceCode( const std::string& aParamName,
const std::string& aParamValue, const std::string& aParamValue,
SIM_VALUE_GRAMMAR::NOTATION aNotation ) SIM_VALUE_GRAMMAR::NOTATION aNotation )

View File

@ -58,12 +58,9 @@ public:
std::unique_ptr<SPICE_MODEL_PARSER> aSpiceModelParser ); std::unique_ptr<SPICE_MODEL_PARSER> aSpiceModelParser );
protected: protected:
void doSetParamValue( int aParamIndex, const std::string& aValue ) override;
virtual void SetParamFromSpiceCode( const std::string& aParamName, virtual void SetParamFromSpiceCode( const std::string& aParamName,
const std::string& aParamValue, const std::string& aParamValue,
SIM_VALUE_GRAMMAR::NOTATION aNotation SIM_VALUE_GRAMMAR::NOTATION aNotation = SIM_VALUE_GRAMMAR::NOTATION::SPICE );
= SIM_VALUE_GRAMMAR::NOTATION::SPICE );
std::string m_spiceCode; std::string m_spiceCode;