sim_model: Fix another not handled exception that fully freeze Eeschema.
Can happens with schematics with old sim parameter syntax. Fix also another crash in sim_model.
This commit is contained in:
parent
ce6378fed3
commit
cdcf875ec0
|
@ -492,7 +492,15 @@ std::unique_ptr<SIM_MODEL> SIM_MODEL::Create( const SIM_MODEL& aBaseModel, unsig
|
|||
{
|
||||
std::unique_ptr<SIM_MODEL> model = Create( aBaseModel.GetType() );
|
||||
|
||||
try
|
||||
{
|
||||
model->SetBaseModel( aBaseModel );
|
||||
}
|
||||
catch( IO_ERROR& err )
|
||||
{
|
||||
DisplayErrorMessage( nullptr, err.What() );
|
||||
}
|
||||
|
||||
model->ReadDataFields( aSymbolPinCount, static_cast<const std::vector<void>*>( nullptr ) );
|
||||
return model;
|
||||
}
|
||||
|
@ -510,7 +518,14 @@ std::unique_ptr<SIM_MODEL> SIM_MODEL::Create( const SIM_MODEL& aBaseModel, unsig
|
|||
|
||||
std::unique_ptr<SIM_MODEL> model = Create( type );
|
||||
|
||||
try
|
||||
{
|
||||
model->SetBaseModel( aBaseModel );
|
||||
}
|
||||
catch( IO_ERROR& err )
|
||||
{
|
||||
DisplayErrorMessage( nullptr, err.What() );
|
||||
}
|
||||
model->ReadDataFields( aSymbolPinCount, &aFields );
|
||||
return model;
|
||||
}
|
||||
|
@ -1306,8 +1321,14 @@ void SIM_MODEL::MigrateSimModel( T_symbol& aSymbol, const PROJECT* aProject )
|
|||
aSymbol.AddField( paramsField );
|
||||
|
||||
if( modelFromValueField )
|
||||
{
|
||||
// Get the current Value field, after previous changes.
|
||||
valueField = aSymbol.FindField( wxT( "Value" ) );
|
||||
|
||||
if( valueField )
|
||||
valueField->SetText( wxT( "${SIM.PARAMS}" ) );
|
||||
}
|
||||
}
|
||||
|
||||
if( !pinMap.IsEmpty() )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue