eeschema: Catch parameter errors in SPICE sim

Any errors in the dialog should be handled and, at worst, allowed to
redo.  SPICE_VALUE throws KI_PARAM_ERROR, so we catch that explicitly.

Fixes: lp:1776051
* https://bugs.launchpad.net/kicad/+bug/1776051
This commit is contained in:
Seth Hillbrand 2018-06-11 18:00:57 -07:00
parent 61c3bc4af4
commit 2798035f85
1 changed files with 22 additions and 0 deletions

View File

@ -130,6 +130,15 @@ bool DIALOG_SIM_SETTINGS::TransferDataFromWindow()
DisplayError( this, e.what() ); DisplayError( this, e.what() );
return false; return false;
} }
catch( const KI_PARAM_ERROR& e )
{
DisplayError( this, e.What() );
return false;
}
catch( ... )
{
return false;
}
} }
if( m_dcEnable2->IsChecked() ) if( m_dcEnable2->IsChecked() )
@ -145,6 +154,9 @@ bool DIALOG_SIM_SETTINGS::TransferDataFromWindow()
if( !m_dcStart2->Validate() || !m_dcStop2->Validate() || !m_dcIncr2->Validate() ) if( !m_dcStart2->Validate() || !m_dcStop2->Validate() || !m_dcIncr2->Validate() )
return false; return false;
if( m_dcStart2->IsEmpty() || m_dcStop2->IsEmpty() || m_dcIncr2->IsEmpty() )
return false;
try try
{ {
wxString dcSource = m_exporter->GetSpiceDevice( m_dcSource2->GetValue() ); wxString dcSource = m_exporter->GetSpiceDevice( m_dcSource2->GetValue() );
@ -160,6 +172,16 @@ bool DIALOG_SIM_SETTINGS::TransferDataFromWindow()
DisplayError( this, e.what() ); DisplayError( this, e.what() );
return false; return false;
} }
catch( const KI_PARAM_ERROR& e )
{
DisplayError( this, e.What() );
return false;
}
catch( ... )
{
return false;
}
} }
m_simCommand = simCmd; m_simCommand = simCmd;