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:
parent
61c3bc4af4
commit
2798035f85
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue