More uniform handling of power symbols and exclude-from-simulation.

This commit is contained in:
Jeff Young 2023-04-14 19:40:41 +01:00
parent 9f56b75f01
commit d64cb7f81b
6 changed files with 18 additions and 6 deletions

View File

@ -180,6 +180,9 @@ bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow()
m_OptionPower->SetValue( m_libEntry->IsPower() ); m_OptionPower->SetValue( m_libEntry->IsPower() );
if( m_libEntry->IsPower() )
m_spiceFieldsButton->Hide();
LIB_FIELD* simEnableField = m_libEntry->FindField( SIM_ENABLE_FIELD ); LIB_FIELD* simEnableField = m_libEntry->FindField( SIM_ENABLE_FIELD );
m_excludeFromSim->SetValue( simEnableField && simEnableField->GetText() == wxT( "0" ) ); m_excludeFromSim->SetValue( simEnableField && simEnableField->GetText() == wxT( "0" ) );
@ -942,11 +945,13 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::onPowerCheckBox( wxCommandEvent& aEvent )
m_excludeFromBoardCheckBox->SetValue( true ); m_excludeFromBoardCheckBox->SetValue( true );
m_excludeFromBomCheckBox->Enable( false ); m_excludeFromBomCheckBox->Enable( false );
m_excludeFromBoardCheckBox->Enable( false ); m_excludeFromBoardCheckBox->Enable( false );
m_spiceFieldsButton->Show( false );
} }
else else
{ {
m_excludeFromBomCheckBox->Enable( true ); m_excludeFromBomCheckBox->Enable( true );
m_excludeFromBoardCheckBox->Enable( true ); m_excludeFromBoardCheckBox->Enable( true );
m_spiceFieldsButton->Show( true );
} }
OnModify(); OnModify();

View File

@ -353,7 +353,7 @@ DIALOG_LIB_SYMBOL_PROPERTIES_BASE::DIALOG_LIB_SYMBOL_PROPERTIES_BASE( wxWindow*
bUpperSizer->Add( m_NoteBook, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 ); bUpperSizer->Add( m_NoteBook, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 );
bMainSizer->Add( bUpperSizer, 1, wxEXPAND, 5 ); bMainSizer->Add( bUpperSizer, 1, wxEXPAND|wxBOTTOM, 5 );
wxBoxSizer* bSizer101; wxBoxSizer* bSizer101;
bSizer101 = new wxBoxSizer( wxHORIZONTAL ); bSizer101 = new wxBoxSizer( wxHORIZONTAL );

View File

@ -64,7 +64,7 @@
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxEXPAND|wxBOTTOM</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>

View File

@ -355,6 +355,9 @@ DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES( SCH_EDIT_FRAME* aParent,
m_pinGrid->SetTable( m_dataModel ); m_pinGrid->SetTable( m_dataModel );
} }
if( m_part && m_part->IsPower() )
m_spiceFieldsButton->Hide();
m_pinGrid->PushEventHandler( new GRID_TRICKS( m_pinGrid ) ); m_pinGrid->PushEventHandler( new GRID_TRICKS( m_pinGrid ) );
m_pinGrid->SetSelectionMode( wxGrid::wxGridSelectRows ); m_pinGrid->SetSelectionMode( wxGrid::wxGridSelectRows );

View File

@ -1031,10 +1031,9 @@ int ERC_TESTER::TestSimModelIssues()
{ {
SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item ); SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
// Power symbols are skipped: obviously they do not have a simulator model // Power symbols and other symbols which have the reference starting with "#" are
const std::unique_ptr< LIB_SYMBOL >& libpart = symbol->GetLibSymbolRef(); // not included in simulation
if( symbol->GetRef( &sheet ).StartsWith( '#' ) || symbol->GetExcludeFromSim() )
if( libpart && libpart->IsPower() )
continue; continue;
// Reset for each symbol // Reset for each symbol

View File

@ -1366,6 +1366,11 @@ void SCH_EDIT_FRAME::RefreshOperatingPointDisplay()
wxString ref = symbol->GetRef( &GetCurrentSheet() ); wxString ref = symbol->GetRef( &GetCurrentSheet() );
std::vector<SCH_PIN*> pins = symbol->GetPins( &GetCurrentSheet() ); std::vector<SCH_PIN*> pins = symbol->GetPins( &GetCurrentSheet() );
// Power symbols and other symbols which have the reference starting with "#" are
// not included in simulation
if( ref.StartsWith( '#' ) || symbol->GetExcludeFromSim() )
continue;
for( SCH_PIN* pin : pins ) for( SCH_PIN* pin : pins )
{ {
if( !pin->GetOperatingPoint().IsEmpty() ) if( !pin->GetOperatingPoint().IsEmpty() )