A few fixes for DIALOG_SIM_SETTINGS

This commit is contained in:
Maciej Suminski 2016-08-11 14:42:10 +02:00
parent fb56420654
commit 02e4252fcd
1 changed files with 32 additions and 22 deletions

View File

@ -216,6 +216,7 @@ bool DIALOG_SIM_SETTINGS::TransferDataFromWindow()
return false; return false;
} }
m_simCommand.Trim();
updateNetlistOpts(); updateNetlistOpts();
return true; return true;
@ -319,20 +320,21 @@ bool DIALOG_SIM_SETTINGS::parseCommand( const wxString& aCommand )
else else
return false; return false;
// If the fields below are empty, it will be caught by the exception handler
m_acPointsNumber->SetValue( tokenizer.GetNextToken() ); m_acPointsNumber->SetValue( tokenizer.GetNextToken() );
m_acFreqStart->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() ); m_acFreqStart->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() );
m_acFreqStop->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() ); m_acFreqStop->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() );
// Check required fields
if( empty( m_acPointsNumber ) || empty( m_acFreqStart ) || empty( m_acFreqStop ) )
return false;
} }
else if( tkn == ".dc" ) else if( tkn == ".dc" )
{ {
m_simPages->SetSelection( m_simPages->FindPage( m_pgDC ) ); m_simPages->SetSelection( m_simPages->FindPage( m_pgDC ) );
m_dcSource1->SetValue( tokenizer.GetNextToken() ); tkn = tokenizer.GetNextToken();
if( !tkn.IsEmpty() )
{
m_dcSource1->SetValue( tkn );
m_dcStart1->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() ); m_dcStart1->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() );
m_dcStop1->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() ); m_dcStop1->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() );
m_dcIncr1->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() ); m_dcIncr1->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() );
@ -340,8 +342,13 @@ bool DIALOG_SIM_SETTINGS::parseCommand( const wxString& aCommand )
// Check the 'Enabled' field, if all values are filled // Check the 'Enabled' field, if all values are filled
m_dcEnable1->SetValue( !empty( m_dcSource1 ) && !empty( m_dcStart1 ) m_dcEnable1->SetValue( !empty( m_dcSource1 ) && !empty( m_dcStart1 )
&& !empty( m_dcStop1 ) && !empty( m_dcIncr1 ) ); && !empty( m_dcStop1 ) && !empty( m_dcIncr1 ) );
}
m_dcSource2->SetValue( tokenizer.GetNextToken() ); tkn = tokenizer.GetNextToken();
if( !tkn.IsEmpty() )
{
m_dcSource2->SetValue( tkn );
m_dcStart2->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() ); m_dcStart2->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() );
m_dcStop2->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() ); m_dcStop2->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() );
m_dcIncr2->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() ); m_dcIncr2->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() );
@ -349,6 +356,7 @@ bool DIALOG_SIM_SETTINGS::parseCommand( const wxString& aCommand )
// Check the 'Enabled' field, if all values are filled // Check the 'Enabled' field, if all values are filled
m_dcEnable2->SetValue( !empty( m_dcSource2 ) && !empty( m_dcStart2 ) m_dcEnable2->SetValue( !empty( m_dcSource2 ) && !empty( m_dcStart2 )
&& !empty( m_dcStop2 ) && !empty( m_dcIncr2 ) ); && !empty( m_dcStop2 ) && !empty( m_dcIncr2 ) );
}
// Check if the directive is complete // Check if the directive is complete
if( !m_dcEnable1->IsChecked() || !m_dcEnable2->IsChecked() ) if( !m_dcEnable1->IsChecked() || !m_dcEnable2->IsChecked() )
@ -359,13 +367,15 @@ bool DIALOG_SIM_SETTINGS::parseCommand( const wxString& aCommand )
{ {
m_simPages->SetSelection( m_simPages->FindPage( m_pgTransient ) ); m_simPages->SetSelection( m_simPages->FindPage( m_pgTransient ) );
// If the fields below are empty, it will be caught by the exception handler
m_transStep->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() ); m_transStep->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() );
m_transFinal->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() ); m_transFinal->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() );
m_transInitial->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() );
// Check required fields // Initial time is an optional field
if( empty( m_transStep ) || empty( m_transFinal ) ) tkn = tokenizer.GetNextToken();
return false;
if( !tkn.IsEmpty() )
m_transInitial->SetValue( SPICE_VALUE( tkn ).ToSpiceString() );
} }
// Custom directives // Custom directives