Add SIM_ENABLE_FIELD column name when excluding symbol from simulation

Fixes #13691
This commit is contained in:
JamesJCode 2023-01-29 02:05:45 +00:00
parent 971abcfc1a
commit 413169782a
2 changed files with 20 additions and 1 deletions

View File

@ -246,7 +246,7 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::OnExcludeFromSimulation( wxCommandEvent& even
if( simEnableFieldRow == -1 )
{
simEnableFieldRow = (int) m_fields->size();
m_fields->emplace_back( m_libEntry, simEnableFieldRow );
m_fields->emplace_back( m_libEntry, simEnableFieldRow, SIM_ENABLE_FIELD );
// notify the grid
wxGridTableMessage msg( m_fields, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, 1 );
@ -254,6 +254,8 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::OnExcludeFromSimulation( wxCommandEvent& even
}
m_grid->SetCellValue( simEnableFieldRow, FDC_VALUE, wxT( "0" ) );
m_grid->SetCellValue( simEnableFieldRow, FDC_SHOWN, wxT( "0" ) );
m_grid->SetCellValue( simEnableFieldRow, FDC_SHOW_NAME, wxT( "0" ) );
}
else if( simEnableFieldRow >= 0 )
{
@ -889,6 +891,21 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event )
m_delayedFocusRow = -1;
m_delayedFocusColumn = -1;
}
#ifdef KICAD_SPICE
wxString simEnable;
for( int ii = MANDATORY_FIELDS; ii < m_fields->GetNumberRows(); ++ii )
{
if( m_fields->GetValue( ii, FDC_NAME ) == SIM_ENABLE_FIELD )
{
simEnable = m_fields->GetValue( ii, FDC_VALUE );
break;
}
}
m_excludeFromSim->SetValue( simEnable == wxS( "0" ) );
#endif
}

View File

@ -562,6 +562,8 @@ void DIALOG_SYMBOL_PROPERTIES::OnExcludeFromSimulation( wxCommandEvent& event )
}
m_fieldsGrid->SetCellValue( simEnableFieldRow, FDC_VALUE, wxT( "0" ) );
m_fieldsGrid->SetCellValue( simEnableFieldRow, FDC_SHOWN, wxT( "0" ) );
m_fieldsGrid->SetCellValue( simEnableFieldRow, FDC_SHOW_NAME, wxT( "0" ) );
}
else if( simEnableFieldRow >= 0 )
{