Exclude from Sim: move from field to attribute
This commit is contained in:
parent
88cb1ed8b5
commit
bdecdce1b4
|
@ -594,6 +594,7 @@ int DIALOG_CHANGE_SYMBOLS::processSymbols( SCH_COMMIT* aCommit,
|
|||
{
|
||||
// Fetch the attributes from the *flattened* library symbol. They are not supported
|
||||
// in derived symbols.
|
||||
symbol->SetExcludedFromSim( symbol->GetLibSymbolRef()->GetExcludedFromSim() );
|
||||
symbol->SetExcludedFromBOM( symbol->GetLibSymbolRef()->GetExcludedFromBOM() );
|
||||
symbol->SetExcludedFromBoard( symbol->GetLibSymbolRef()->GetExcludedFromBoard() );
|
||||
}
|
||||
|
|
|
@ -182,9 +182,7 @@ bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow()
|
|||
if( m_libEntry->IsPower() )
|
||||
m_spiceFieldsButton->Hide();
|
||||
|
||||
LIB_FIELD* simEnableField = m_libEntry->FindField( SIM_ENABLE_FIELD );
|
||||
m_excludeFromSim->SetValue( simEnableField && simEnableField->GetText() == wxT( "0" ) );
|
||||
|
||||
m_excludeFromSimCheckBox->SetValue( m_libEntry->GetExcludedFromSim() );
|
||||
m_excludeFromBomCheckBox->SetValue( m_libEntry->GetExcludedFromBOM() );
|
||||
m_excludeFromBoardCheckBox->SetValue( m_libEntry->GetExcludedFromBoard() );
|
||||
|
||||
|
@ -227,45 +225,6 @@ bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow()
|
|||
}
|
||||
|
||||
|
||||
void DIALOG_LIB_SYMBOL_PROPERTIES::OnExcludeFromSimulation( wxCommandEvent& event )
|
||||
{
|
||||
int simEnableFieldRow = -1;
|
||||
|
||||
for( int ii = MANDATORY_FIELDS; ii < m_grid->GetNumberRows(); ++ii )
|
||||
{
|
||||
if( m_grid->GetCellValue( ii, FDC_NAME ) == SIM_ENABLE_FIELD )
|
||||
simEnableFieldRow = ii;
|
||||
}
|
||||
|
||||
if( event.IsChecked() )
|
||||
{
|
||||
if( simEnableFieldRow == -1 )
|
||||
{
|
||||
simEnableFieldRow = (int) m_fields->size();
|
||||
m_fields->emplace_back( m_libEntry, simEnableFieldRow, SIM_ENABLE_FIELD );
|
||||
|
||||
// notify the grid
|
||||
wxGridTableMessage msg( m_fields, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, 1 );
|
||||
m_grid->ProcessTableMessage( msg );
|
||||
}
|
||||
|
||||
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 )
|
||||
{
|
||||
m_fields->erase( m_fields->begin() + simEnableFieldRow );
|
||||
|
||||
// notify the grid
|
||||
wxGridTableMessage msg( m_fields, wxGRIDTABLE_NOTIFY_ROWS_DELETED, simEnableFieldRow, 1 );
|
||||
m_grid->ProcessTableMessage( msg );
|
||||
}
|
||||
|
||||
OnModify();
|
||||
}
|
||||
|
||||
|
||||
bool DIALOG_LIB_SYMBOL_PROPERTIES::Validate()
|
||||
{
|
||||
if( !m_grid->CommitPendingChanges() )
|
||||
|
@ -437,6 +396,7 @@ bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow()
|
|||
m_libEntry->SetNormal();
|
||||
}
|
||||
|
||||
m_libEntry->SetExcludedFromSim( m_excludeFromSimCheckBox->GetValue() );
|
||||
m_libEntry->SetExcludedFromBOM( m_excludeFromBomCheckBox->GetValue() );
|
||||
m_libEntry->SetExcludedFromBoard( m_excludeFromBoardCheckBox->GetValue() );
|
||||
|
||||
|
@ -895,19 +855,6 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event )
|
|||
m_delayedFocusRow = -1;
|
||||
m_delayedFocusColumn = -1;
|
||||
}
|
||||
|
||||
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" ) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -940,16 +887,19 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::onPowerCheckBox( wxCommandEvent& aEvent )
|
|||
{
|
||||
if( m_OptionPower->IsChecked() )
|
||||
{
|
||||
m_excludeFromSimCheckBox->SetValue( true );
|
||||
m_excludeFromBomCheckBox->SetValue( true );
|
||||
m_excludeFromBoardCheckBox->SetValue( true );
|
||||
m_excludeFromBomCheckBox->Enable( false );
|
||||
m_excludeFromBoardCheckBox->Enable( false );
|
||||
m_excludeFromSimCheckBox->Enable( false );
|
||||
m_spiceFieldsButton->Show( false );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_excludeFromBomCheckBox->Enable( true );
|
||||
m_excludeFromBoardCheckBox->Enable( true );
|
||||
m_excludeFromSimCheckBox->Enable( true );
|
||||
m_spiceFieldsButton->Show( true );
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,6 @@ private:
|
|||
void OnUpdateUI( wxUpdateUIEvent& event ) override;
|
||||
void OnFilterDClick( wxMouseEvent& event ) override;
|
||||
void OnCancelButtonClick( wxCommandEvent& event ) override;
|
||||
void OnExcludeFromSimulation( wxCommandEvent& event ) override;
|
||||
|
||||
void adjustGridColumns();
|
||||
void syncControlStates( bool aIsAlias );
|
||||
|
|
|
@ -267,8 +267,8 @@ DIALOG_LIB_SYMBOL_PROPERTIES_BASE::DIALOG_LIB_SYMBOL_PROPERTIES_BASE( wxWindow*
|
|||
wxStaticBoxSizer* sbSizerAttributes;
|
||||
sbSizerAttributes = new wxStaticBoxSizer( new wxStaticBox( m_PanelBasic, wxID_ANY, _("Attributes") ), wxVERTICAL );
|
||||
|
||||
m_excludeFromSim = new wxCheckBox( sbSizerAttributes->GetStaticBox(), wxID_ANY, _("Exclude from simulation"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
sbSizerAttributes->Add( m_excludeFromSim, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
m_excludeFromSimCheckBox = new wxCheckBox( sbSizerAttributes->GetStaticBox(), wxID_ANY, _("Exclude from simulation"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
sbSizerAttributes->Add( m_excludeFromSimCheckBox, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
sbSizerAttributes->Add( 0, 10, 0, wxEXPAND, 5 );
|
||||
|
@ -397,7 +397,7 @@ DIALOG_LIB_SYMBOL_PROPERTIES_BASE::DIALOG_LIB_SYMBOL_PROPERTIES_BASE( wxWindow*
|
|||
m_ShowPinNameButt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_PinsNameInsideButt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_nameOffsetCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnText ), NULL, this );
|
||||
m_excludeFromSim->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnExcludeFromSimulation ), NULL, this );
|
||||
m_excludeFromSimCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_excludeFromBomCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_excludeFromBoardCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_FootprintFilterListBox->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnFilterDClick ), NULL, this );
|
||||
|
@ -432,7 +432,7 @@ DIALOG_LIB_SYMBOL_PROPERTIES_BASE::~DIALOG_LIB_SYMBOL_PROPERTIES_BASE()
|
|||
m_ShowPinNameButt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_PinsNameInsideButt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_nameOffsetCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnText ), NULL, this );
|
||||
m_excludeFromSim->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnExcludeFromSimulation ), NULL, this );
|
||||
m_excludeFromSimCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_excludeFromBomCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_excludeFromBoardCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_FootprintFilterListBox->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnFilterDClick ), NULL, this );
|
||||
|
|
|
@ -1903,7 +1903,7 @@
|
|||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_excludeFromSim</property>
|
||||
<property name="name">m_excludeFromSimCheckBox</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
|
@ -1924,7 +1924,7 @@
|
|||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnCheckBox">OnExcludeFromSimulation</event>
|
||||
<event name="OnCheckBox">OnCheckBox</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
|
|
|
@ -74,7 +74,7 @@ class DIALOG_LIB_SYMBOL_PROPERTIES_BASE : public DIALOG_SHIM
|
|||
wxStaticText* m_nameOffsetLabel;
|
||||
wxTextCtrl* m_nameOffsetCtrl;
|
||||
wxStaticText* m_nameOffsetUnits;
|
||||
wxCheckBox* m_excludeFromSim;
|
||||
wxCheckBox* m_excludeFromSimCheckBox;
|
||||
wxCheckBox* m_excludeFromBomCheckBox;
|
||||
wxCheckBox* m_excludeFromBoardCheckBox;
|
||||
wxPanel* m_PanelFootprintFilter;
|
||||
|
@ -103,7 +103,6 @@ class DIALOG_LIB_SYMBOL_PROPERTIES_BASE : public DIALOG_SHIM
|
|||
virtual void OnSpinCtrlText( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnCheckBox( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onPowerCheckBox( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnExcludeFromSimulation( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnFilterDClick( wxMouseEvent& event ) { event.Skip(); }
|
||||
virtual void OnEditFootprintFilter( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnAddFootprintFilter( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
|
|
@ -511,7 +511,7 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataToWindow()
|
|||
case SYM_MIRROR_Y: m_mirrorCtrl->SetSelection( 2 ); break;
|
||||
}
|
||||
|
||||
m_cbExcludeFromSim->SetValue( m_symbol->GetFieldText( SIM_ENABLE_FIELD ) == wxS( "0" ) );
|
||||
m_cbExcludeFromSim->SetValue( m_symbol->GetExcludedFromSim() );
|
||||
m_cbExcludeFromBom->SetValue( m_symbol->GetExcludedFromBOM() );
|
||||
m_cbExcludeFromBoard->SetValue( m_symbol->GetExcludedFromBoard() );
|
||||
m_cbDNP->SetValue( m_symbol->GetDNP() );
|
||||
|
@ -533,45 +533,6 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataToWindow()
|
|||
}
|
||||
|
||||
|
||||
void DIALOG_SYMBOL_PROPERTIES::OnExcludeFromSimulation( wxCommandEvent& event )
|
||||
{
|
||||
int simEnableFieldRow = -1;
|
||||
|
||||
for( int ii = MANDATORY_FIELDS; ii < m_fieldsGrid->GetNumberRows(); ++ii )
|
||||
{
|
||||
if( m_fieldsGrid->GetCellValue( ii, FDC_NAME ) == SIM_ENABLE_FIELD )
|
||||
simEnableFieldRow = ii;
|
||||
}
|
||||
|
||||
if( event.IsChecked() )
|
||||
{
|
||||
if( simEnableFieldRow == -1 )
|
||||
{
|
||||
simEnableFieldRow = (int) m_fields->size();
|
||||
m_fields->emplace_back( VECTOR2I( 0, 0 ), simEnableFieldRow, m_symbol, SIM_ENABLE_FIELD );
|
||||
|
||||
// notify the grid
|
||||
wxGridTableMessage msg( m_fields, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, 1 );
|
||||
m_fieldsGrid->ProcessTableMessage( msg );
|
||||
}
|
||||
|
||||
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 )
|
||||
{
|
||||
m_fields->erase( m_fields->begin() + simEnableFieldRow );
|
||||
|
||||
// notify the grid
|
||||
wxGridTableMessage msg( m_fields, wxGRIDTABLE_NOTIFY_ROWS_DELETED, simEnableFieldRow, 1 );
|
||||
m_fieldsGrid->ProcessTableMessage( msg );
|
||||
}
|
||||
|
||||
OnModify();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_SYMBOL_PROPERTIES::OnEditSpiceModel( wxCommandEvent& event )
|
||||
{
|
||||
if( !m_fieldsGrid->CommitPendingChanges() )
|
||||
|
@ -780,6 +741,7 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow()
|
|||
m_symbol->SetValueFieldText( m_fields->at( VALUE_FIELD ).GetText() );
|
||||
m_symbol->SetFootprintFieldText( m_fields->at( FOOTPRINT_FIELD ).GetText() );
|
||||
|
||||
m_symbol->SetExcludedFromSim( m_cbExcludeFromSim->IsChecked() );
|
||||
m_symbol->SetExcludedFromBOM( m_cbExcludeFromBom->IsChecked() );
|
||||
m_symbol->SetExcludedFromBoard( m_cbExcludeFromBoard->IsChecked() );
|
||||
m_symbol->SetDNP( m_cbDNP->IsChecked() );
|
||||
|
@ -847,6 +809,7 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow()
|
|||
otherUnit->GetFields().erase( otherUnit->GetFields().begin() + ii );
|
||||
}
|
||||
|
||||
otherUnit->SetExcludedFromSim( m_cbExcludeFromSim->IsChecked() );
|
||||
otherUnit->SetExcludedFromBOM( m_cbExcludeFromBom->IsChecked() );
|
||||
otherUnit->SetExcludedFromBoard( m_cbExcludeFromBoard->IsChecked() );
|
||||
otherUnit->SetDNP( m_cbDNP->IsChecked() );
|
||||
|
@ -1168,19 +1131,6 @@ void DIALOG_SYMBOL_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event )
|
|||
if( !m_fieldsGrid->IsCellEditControlShown() )
|
||||
AdjustFieldsGridColumns();
|
||||
}
|
||||
|
||||
wxString simEnable;
|
||||
|
||||
for( int ii = MANDATORY_FIELDS; ii < m_fieldsGrid->GetNumberRows(); ++ii )
|
||||
{
|
||||
if( m_fieldsGrid->GetCellValue( ii, FDC_NAME ) == SIM_ENABLE_FIELD )
|
||||
{
|
||||
simEnable = m_fieldsGrid->GetCellValue( ii, FDC_VALUE );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
m_cbExcludeFromSim->SetValue( simEnable == wxS( "0" ) );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -83,8 +83,7 @@ private:
|
|||
void OnGridEditorShown( wxGridEvent& event ) override;
|
||||
void OnGridEditorHidden( wxGridEvent& event ) override;
|
||||
void OnUnitChoice( wxCommandEvent& event ) override;
|
||||
void OnCheckBox( wxCommandEvent& event ) override;
|
||||
void OnExcludeFromSimulation( wxCommandEvent& event ) override;
|
||||
void OnCheckBox( wxCommandEvent& event ) override;
|
||||
|
||||
void OnEditSymbol( wxCommandEvent& ) override;
|
||||
void OnEditLibrarySymbol( wxCommandEvent& ) override;
|
||||
|
|
|
@ -199,7 +199,6 @@ DIALOG_SYMBOL_PROPERTIES_BASE::DIALOG_SYMBOL_PROPERTIES_BASE( wxWindow* parent,
|
|||
sbAttributes = new wxStaticBoxSizer( new wxStaticBox( generalPage, wxID_ANY, _("Attributes") ), wxVERTICAL );
|
||||
|
||||
m_cbExcludeFromSim = new wxCheckBox( sbAttributes->GetStaticBox(), wxID_ANY, _("Exclude from simulation"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_cbExcludeFromSim->SetValue(true);
|
||||
sbAttributes->Add( m_cbExcludeFromSim, 0, wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
|
@ -362,7 +361,7 @@ DIALOG_SYMBOL_PROPERTIES_BASE::DIALOG_SYMBOL_PROPERTIES_BASE( wxWindow* parent,
|
|||
m_mirrorCtrl->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnChoice ), NULL, this );
|
||||
m_ShowPinNumButt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_ShowPinNameButt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_cbExcludeFromSim->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnExcludeFromSimulation ), NULL, this );
|
||||
m_cbExcludeFromSim->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_cbExcludeFromBom->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_cbExcludeFromBoard->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_updateSymbolBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnUpdateSymbol ), NULL, this );
|
||||
|
@ -395,7 +394,7 @@ DIALOG_SYMBOL_PROPERTIES_BASE::~DIALOG_SYMBOL_PROPERTIES_BASE()
|
|||
m_mirrorCtrl->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnChoice ), NULL, this );
|
||||
m_ShowPinNumButt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_ShowPinNameButt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_cbExcludeFromSim->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnExcludeFromSimulation ), NULL, this );
|
||||
m_cbExcludeFromSim->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_cbExcludeFromBom->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_cbExcludeFromBoard->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_updateSymbolBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnUpdateSymbol ), NULL, this );
|
||||
|
|
|
@ -1296,7 +1296,7 @@
|
|||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">1</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
|
@ -1340,7 +1340,7 @@
|
|||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnCheckBox">OnExcludeFromSimulation</event>
|
||||
<event name="OnCheckBox">OnCheckBox</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
|
|
|
@ -93,7 +93,6 @@ class DIALOG_SYMBOL_PROPERTIES_BASE : public DIALOG_SHIM
|
|||
virtual void OnUnitChoice( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnCheckBox( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnChoice( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnExcludeFromSimulation( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnUpdateSymbol( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnExchangeSymbol( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnEditSymbol( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
|
|
@ -262,7 +262,7 @@ bool DIALOG_TEXT_PROPERTIES::TransferDataToWindow()
|
|||
m_textCtrl->SetValue( schematic.ConvertKIIDsToRefs( m_currentText->GetText() ) );
|
||||
m_textCtrl->EmptyUndoBuffer();
|
||||
|
||||
m_excludeFromSim->SetValue( m_currentItem->GetExcludeFromSim() );
|
||||
m_excludeFromSim->SetValue( m_currentItem->GetExcludedFromSim() );
|
||||
|
||||
m_fontCtrl->SetFontSelection( m_currentText->GetFont() );
|
||||
m_textSize.SetValue( m_currentText->GetTextWidth() );
|
||||
|
@ -482,7 +482,7 @@ bool DIALOG_TEXT_PROPERTIES::TransferDataFromWindow()
|
|||
return false;
|
||||
}
|
||||
|
||||
m_currentItem->SetExcludeFromSim( m_excludeFromSim->GetValue() );
|
||||
m_currentItem->SetExcludedFromSim( m_excludeFromSim->GetValue() );
|
||||
|
||||
if( !m_currentText->ValidateHyperlink( m_hyperlinkCombo->GetValue() ) )
|
||||
{
|
||||
|
|
|
@ -1032,7 +1032,7 @@ int ERC_TESTER::TestSimModelIssues()
|
|||
|
||||
// Power symbols and other symbols which have the reference starting with "#" are
|
||||
// not included in simulation
|
||||
if( symbol->GetRef( &sheet ).StartsWith( '#' ) || symbol->GetExcludeFromSim() )
|
||||
if( symbol->GetRef( &sheet ).StartsWith( '#' ) || symbol->GetExcludedFromSim() )
|
||||
continue;
|
||||
|
||||
// Reset for each symbol
|
||||
|
|
|
@ -430,7 +430,7 @@ wxString FIELDS_EDITOR_GRID_DATA_MODEL::getAttributeValue( const SCH_REFERENCE&
|
|||
return aRef.GetSymbol()->GetExcludedFromBOM() ? wxS( "1" ) : wxS( "0" );
|
||||
|
||||
if( aAttributeName == wxS( "${EXCLUDE_FROM_SIM}" ) )
|
||||
return aRef.GetSymbol()->GetExcludeFromSim() ? wxS( "1" ) : wxS( "0" );
|
||||
return aRef.GetSymbol()->GetExcludedFromSim() ? wxS( "1" ) : wxS( "0" );
|
||||
|
||||
return wxS( "0" );
|
||||
}
|
||||
|
@ -446,7 +446,7 @@ void FIELDS_EDITOR_GRID_DATA_MODEL::setAttributeValue( const SCH_REFERENCE& aRef
|
|||
else if( aAttributeName == wxS( "${EXCLUDE_FROM_BOM}" ) )
|
||||
aRef.GetSymbol()->SetExcludedFromBOM( aValue == wxS( "1" ) );
|
||||
else if( aAttributeName == wxS( "${EXCLUDE_FROM_SIM}" ) )
|
||||
aRef.GetSymbol()->SetExcludeFromSim( aValue == wxS( "1" ) );
|
||||
aRef.GetSymbol()->SetExcludedFromSim( aValue == wxS( "1" ) );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -108,6 +108,7 @@ struct null_deleter
|
|||
LIB_SYMBOL::LIB_SYMBOL( const wxString& aName, LIB_SYMBOL* aParent, SYMBOL_LIB* aLibrary ) :
|
||||
EDA_ITEM( LIB_SYMBOL_T ),
|
||||
m_me( this, null_deleter() ),
|
||||
m_excludedFromSim( false ),
|
||||
m_excludedFromBOM( false ),
|
||||
m_excludedFromBoard( false )
|
||||
{
|
||||
|
@ -147,6 +148,7 @@ LIB_SYMBOL::LIB_SYMBOL( const LIB_SYMBOL& aSymbol, SYMBOL_LIB* aLibrary ) :
|
|||
m_unitsLocked = aSymbol.m_unitsLocked;
|
||||
m_pinNameOffset = aSymbol.m_pinNameOffset;
|
||||
m_showPinNumbers = aSymbol.m_showPinNumbers;
|
||||
m_excludedFromSim = aSymbol.m_excludedFromSim;
|
||||
m_excludedFromBOM = aSymbol.m_excludedFromBOM;
|
||||
m_excludedFromBoard = aSymbol.m_excludedFromBoard;
|
||||
m_showPinNames = aSymbol.m_showPinNames;
|
||||
|
@ -200,6 +202,7 @@ const LIB_SYMBOL& LIB_SYMBOL::operator=( const LIB_SYMBOL& aSymbol )
|
|||
m_pinNameOffset = aSymbol.m_pinNameOffset;
|
||||
m_showPinNumbers = aSymbol.m_showPinNumbers;
|
||||
m_showPinNames = aSymbol.m_showPinNames;
|
||||
m_excludedFromSim = aSymbol.m_excludedFromSim;
|
||||
m_excludedFromBOM = aSymbol.m_excludedFromBOM;
|
||||
m_excludedFromBoard = aSymbol.m_excludedFromBoard;
|
||||
m_lastModDate = aSymbol.m_lastModDate;
|
||||
|
@ -467,6 +470,15 @@ int LIB_SYMBOL::Compare( const LIB_SYMBOL& aRhs, int aCompareFlags, REPORTER* aR
|
|||
return retv;
|
||||
}
|
||||
|
||||
if( m_excludedFromSim != aRhs.m_excludedFromSim )
|
||||
{
|
||||
retv = ( m_excludedFromSim ) ? -1 : 1;
|
||||
REPORT( _( "Exclude from simulation settings differ." ) );
|
||||
|
||||
if( !aReporter )
|
||||
return retv;
|
||||
}
|
||||
|
||||
if( m_excludedFromBOM != aRhs.m_excludedFromBOM )
|
||||
{
|
||||
retv = ( m_excludedFromBOM ) ? -1 : 1;
|
||||
|
@ -634,6 +646,7 @@ std::unique_ptr< LIB_SYMBOL > LIB_SYMBOL::Flatten() const
|
|||
retv->SetKeyWords( m_keyWords.IsEmpty() ? parent->GetKeyWords() : m_keyWords );
|
||||
retv->SetFPFilters( m_fpFilters.IsEmpty() ? parent->GetFPFilters() : m_fpFilters );
|
||||
|
||||
retv->SetExcludedFromSim( parent->GetExcludedFromSim() );
|
||||
retv->SetExcludedFromBOM( parent->GetExcludedFromBOM() );
|
||||
retv->SetExcludedFromBoard( parent->GetExcludedFromBoard() );
|
||||
|
||||
|
|
|
@ -294,7 +294,7 @@ public:
|
|||
* or NULL if not found.
|
||||
* @param aFieldName is the name of the field to find.
|
||||
* @param aCaseInsensitive ignore the filed name case if true.
|
||||
*
|
||||
*
|
||||
* @return the field if found or NULL if the field was not found.
|
||||
*/
|
||||
LIB_FIELD* FindField( const wxString& aFieldName, bool aCaseInsensitive = false );
|
||||
|
@ -653,6 +653,14 @@ public:
|
|||
void SetShowPinNumbers( bool aShow ) { m_showPinNumbers = aShow; }
|
||||
bool ShowPinNumbers() const { return m_showPinNumbers; }
|
||||
|
||||
/**
|
||||
* Set or clear the exclude from simulation flag.
|
||||
*
|
||||
* @param aExcludeFromSim true to exclude symbol from simulation
|
||||
*/
|
||||
void SetExcludedFromSim( bool aExcludeFromSim ) { m_excludedFromSim = aExcludeFromSim; }
|
||||
bool GetExcludedFromSim() const { return m_excludedFromSim; }
|
||||
|
||||
/**
|
||||
* Set or clear the exclude from schematic bill of materials flag.
|
||||
*
|
||||
|
@ -759,6 +767,7 @@ private:
|
|||
bool m_showPinNames;
|
||||
bool m_showPinNumbers;
|
||||
|
||||
bool m_excludedFromSim;
|
||||
bool m_excludedFromBOM;
|
||||
bool m_excludedFromBoard;
|
||||
LIBRENTRYOPTIONS m_options; ///< Special symbol features such as POWER or NORMAL.)
|
||||
|
|
|
@ -210,7 +210,7 @@ bool NETLIST_EXPORTER_SPICE::ReadSchematicAndLibraries( unsigned aNetlistOptions
|
|||
{
|
||||
SCH_SYMBOL* symbol = findNextSymbol( item, &sheet );
|
||||
|
||||
if( !symbol || symbol->GetExcludeFromSim() )
|
||||
if( !symbol || symbol->GetExcludedFromSim() )
|
||||
continue;
|
||||
|
||||
SPICE_ITEM spiceItem;
|
||||
|
@ -332,7 +332,7 @@ void NETLIST_EXPORTER_SPICE::ReadDirectives( unsigned aNetlistOptions )
|
|||
{
|
||||
for( SCH_ITEM* item : sheet.LastScreen()->Items() )
|
||||
{
|
||||
if( item->GetExcludeFromSim() )
|
||||
if( item->GetExcludedFromSim() )
|
||||
continue;
|
||||
|
||||
if( item->Type() == SCH_TEXT_T )
|
||||
|
|
|
@ -1490,7 +1490,7 @@ void SCH_EDIT_FRAME::RefreshOperatingPointDisplay()
|
|||
|
||||
// Power symbols and other symbols which have the reference starting with "#" are
|
||||
// not included in simulation
|
||||
if( ref.StartsWith( '#' ) || symbol->GetExcludeFromSim() )
|
||||
if( ref.StartsWith( '#' ) || symbol->GetExcludedFromSim() )
|
||||
continue;
|
||||
|
||||
for( SCH_PIN* pin : pins )
|
||||
|
|
|
@ -98,4 +98,5 @@
|
|||
//#define SEXPR_SCHEMATIC_FILE_VERSION 20230121 // SCH_MARKER specific sheet path serialisation
|
||||
//#define SEXPR_SCHEMATIC_FILE_VERSION 20230221 // Modern power symbols (editable value = net)
|
||||
//#define SEXPR_SCHEMATIC_FILE_VERSION 20230409 // Add exclude_from_sim markup
|
||||
#define SEXPR_SCHEMATIC_FILE_VERSION 20230620 // ki_description -> Description Field
|
||||
//#define SEXPR_SCHEMATIC_FILE_VERSION 20230620 // ki_description -> Description Field
|
||||
#define SEXPR_SCHEMATIC_FILE_VERSION 20230808 // Move Sim.Enable field to exclude_from_sim attr
|
||||
|
|
|
@ -206,8 +206,8 @@ public:
|
|||
*/
|
||||
SCH_ITEM* Duplicate( bool doClone = false ) const;
|
||||
|
||||
virtual void SetExcludeFromSim( bool aExclude ) { }
|
||||
virtual bool GetExcludeFromSim() const { return false; }
|
||||
virtual void SetExcludedFromSim( bool aExclude ) { }
|
||||
virtual bool GetExcludedFromSim() const { return false; }
|
||||
|
||||
/**
|
||||
* @return true for items which are moved with the anchor point at mouse cursor
|
||||
|
|
|
@ -331,6 +331,7 @@ void SCH_DATABASE_PLUGIN::connect()
|
|||
columns.insert( tableIter.properties.description );
|
||||
columns.insert( tableIter.properties.footprint_filters );
|
||||
columns.insert( tableIter.properties.keywords );
|
||||
columns.insert( tableIter.properties.exclude_from_sim );
|
||||
columns.insert( tableIter.properties.exclude_from_bom );
|
||||
columns.insert( tableIter.properties.exclude_from_board );
|
||||
|
||||
|
@ -483,6 +484,22 @@ LIB_SYMBOL* SCH_DATABASE_PLUGIN::loadSymbolFromRow( const wxString& aSymbolName,
|
|||
symbol->SetFPFilters( filters );
|
||||
}
|
||||
|
||||
if( !aTable.properties.exclude_from_sim.empty()
|
||||
&& aRow.count( aTable.properties.exclude_from_sim ) )
|
||||
{
|
||||
std::optional<bool> val = boolFromAny( aRow.at( aTable.properties.exclude_from_sim ) );
|
||||
|
||||
if( val )
|
||||
{
|
||||
symbol->SetExcludedFromSim( *val );
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogTrace( traceDatabase, wxT( "loadSymbolFromRow: exclude_from_sim value for %s "
|
||||
"could not be cast to a boolean" ), aSymbolName );
|
||||
}
|
||||
}
|
||||
|
||||
if( !aTable.properties.exclude_from_board.empty()
|
||||
&& aRow.count( aTable.properties.exclude_from_board ) )
|
||||
{
|
||||
|
|
|
@ -181,6 +181,8 @@ void SCH_SEXPR_PLUGIN_CACHE::SaveSymbol( LIB_SYMBOL* aSymbol, OUTPUTFORMATTER& a
|
|||
aFormatter.Print( 0, ")" );
|
||||
}
|
||||
|
||||
aFormatter.Print( 0, " (exclude_from_sim %s)",
|
||||
( aSymbol->GetExcludedFromSim() ) ? "yes" : "no" );
|
||||
aFormatter.Print( 0, " (in_bom %s)", ( aSymbol->GetExcludedFromBOM() ) ? "no" : "yes" );
|
||||
aFormatter.Print( 0, " (on_board %s)", ( aSymbol->GetExcludedFromBoard() ) ? "no" : "yes" );
|
||||
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
#include <trigo.h>
|
||||
#include <progress_reporter.h>
|
||||
#include <sch_shape.h>
|
||||
#include <sim/sim_model.h>
|
||||
|
||||
|
||||
using namespace TSCHEMATIC_T;
|
||||
|
@ -274,6 +275,11 @@ LIB_SYMBOL* SCH_SEXPR_PARSER::parseLibSymbol( LIB_SYMBOL_MAP& aSymbolLibMap )
|
|||
NeedRIGHT();
|
||||
break;
|
||||
|
||||
case T_exclude_from_sim:
|
||||
symbol->SetExcludedFromSim( parseBool() );
|
||||
NeedRIGHT();
|
||||
break;
|
||||
|
||||
case T_in_bom:
|
||||
symbol->SetExcludedFromBOM( !parseBool() );
|
||||
NeedRIGHT();
|
||||
|
@ -2734,6 +2740,11 @@ SCH_SYMBOL* SCH_SEXPR_PARSER::parseSchematicSymbol()
|
|||
NeedRIGHT();
|
||||
break;
|
||||
|
||||
case T_exclude_from_sim:
|
||||
symbol->SetExcludedFromSim( parseBool() );
|
||||
NeedRIGHT();
|
||||
break;
|
||||
|
||||
case T_in_bom:
|
||||
symbol->SetExcludedFromBOM( !parseBool() );
|
||||
NeedRIGHT();
|
||||
|
@ -2886,6 +2897,21 @@ SCH_SYMBOL* SCH_SEXPR_PARSER::parseSchematicSymbol()
|
|||
// the field positions are set.
|
||||
field = parseSchField( symbol.get() );
|
||||
|
||||
// Exclude from simulation used to be managed by a Sim.Enable field set to "0" when
|
||||
// simulation was disabled.
|
||||
if( field->GetCanonicalName() == SIM_ENABLE_FIELD )
|
||||
{
|
||||
symbol->SetExcludedFromSim( field->GetText() == wxS( "0" ) );
|
||||
break;
|
||||
}
|
||||
|
||||
// Even longer ago, we had a "Spice_Netlist_Enabled" field
|
||||
if( field->GetCanonicalName() == SIM_LEGACY_ENABLE_FIELD )
|
||||
{
|
||||
symbol->SetExcludedFromSim( field->GetText() == wxS( "N" ) );
|
||||
break;
|
||||
}
|
||||
|
||||
if( ( field->GetId() >= MANDATORY_FIELDS ) && m_fieldIDsRead.count( field->GetId() ) )
|
||||
{
|
||||
int nextAvailableId = field->GetId() + 1;
|
||||
|
@ -3800,7 +3826,7 @@ SCH_TEXT* SCH_SEXPR_PARSER::parseSchText()
|
|||
switch( token )
|
||||
{
|
||||
case T_exclude_from_sim:
|
||||
text->SetExcludeFromSim( parseBool() );
|
||||
text->SetExcludedFromSim( parseBool() );
|
||||
NeedRIGHT();
|
||||
break;
|
||||
|
||||
|
@ -3983,7 +4009,7 @@ SCH_TEXTBOX* SCH_SEXPR_PARSER::parseSchTextBox()
|
|||
switch( token )
|
||||
{
|
||||
case T_exclude_from_sim:
|
||||
textBox->SetExcludeFromSim( parseBool() );
|
||||
textBox->SetExcludedFromSim( parseBool() );
|
||||
NeedRIGHT();
|
||||
break;
|
||||
|
||||
|
|
|
@ -724,7 +724,9 @@ void SCH_SEXPR_PLUGIN::saveSymbol( SCH_SYMBOL* aSymbol, const SCHEMATIC& aSchema
|
|||
|
||||
m_out->Print( 0, "\n" );
|
||||
|
||||
m_out->Print( aNestLevel + 1, "(in_bom %s)", ( aSymbol->GetExcludedFromBOM() ) ? "no" : "yes" );
|
||||
m_out->Print( aNestLevel + 1, "(exclude_from_sim %s)",
|
||||
( aSymbol->GetExcludedFromSim() ) ? "yes" : "no" );
|
||||
m_out->Print( 0, " (in_bom %s)", ( aSymbol->GetExcludedFromBOM() ) ? "no" : "yes" );
|
||||
m_out->Print( 0, " (on_board %s)", ( aSymbol->GetExcludedFromBoard() ) ? "no" : "yes" );
|
||||
m_out->Print( 0, " (dnp %s)", ( aSymbol->GetDNP() ) ? "yes" : "no" );
|
||||
|
||||
|
@ -1270,8 +1272,7 @@ void SCH_SEXPR_PLUGIN::saveText( SCH_TEXT* aText, int aNestLevel )
|
|||
|
||||
if( aText->Type() == SCH_TEXT_T )
|
||||
{
|
||||
m_out->Print( 0, " (exclude_from_sim %s)\n",
|
||||
aText->GetExcludeFromSim() ? "yes" : "no" );
|
||||
m_out->Print( 0, " (exclude_from_sim %s)\n", aText->GetExcludedFromSim() ? "yes" : "no" );
|
||||
}
|
||||
else if( aText->Type() == SCH_DIRECTIVE_LABEL_T )
|
||||
{
|
||||
|
@ -1354,7 +1355,7 @@ void SCH_SEXPR_PLUGIN::saveTextBox( SCH_TEXTBOX* aTextBox, int aNestLevel )
|
|||
VECTOR2I size = aTextBox->GetEnd() - pos;
|
||||
|
||||
m_out->Print( aNestLevel + 1, "(exclude_from_sim %s) (at %s %s %s) (size %s %s)\n",
|
||||
aTextBox->GetExcludeFromSim() ? "yes" : "no",
|
||||
aTextBox->GetExcludedFromSim() ? "yes" : "no",
|
||||
EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, pos.x ).c_str(),
|
||||
EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, pos.y ).c_str(),
|
||||
EDA_UNIT_UTILS::FormatAngle( aTextBox->GetTextAngle() ).c_str(),
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
|
||||
#include <utility>
|
||||
#include "plotters/plotter.h"
|
||||
#include "sim/sim_model.h"
|
||||
|
||||
|
||||
std::unordered_map<TRANSFORM, int> SCH_SYMBOL::s_transformToOrientationCache;
|
||||
|
@ -137,6 +136,7 @@ SCH_SYMBOL::SCH_SYMBOL( const LIB_SYMBOL& aSymbol, const LIB_ID& aLibId,
|
|||
|
||||
// Inherit the include in bill of materials and board netlist settings from flattened
|
||||
// library symbol.
|
||||
m_excludedFromSim = m_part->GetExcludedFromSim();
|
||||
m_excludedFromBOM = m_part->GetExcludedFromBOM();
|
||||
m_excludedFromBoard = m_part->GetExcludedFromBoard();
|
||||
m_DNP = false;
|
||||
|
@ -169,6 +169,7 @@ SCH_SYMBOL::SCH_SYMBOL( const SCH_SYMBOL& aSymbol ) :
|
|||
m_convert = aSymbol.m_convert;
|
||||
m_lib_id = aSymbol.m_lib_id;
|
||||
m_isInNetlist = aSymbol.m_isInNetlist;
|
||||
m_excludedFromSim = aSymbol.m_excludedFromSim;
|
||||
m_excludedFromBOM = aSymbol.m_excludedFromBOM;
|
||||
m_excludedFromBoard = aSymbol.m_excludedFromBoard;
|
||||
m_DNP = aSymbol.m_DNP;
|
||||
|
@ -217,6 +218,7 @@ void SCH_SYMBOL::Init( const VECTOR2I& pos )
|
|||
|
||||
m_prefix = wxString( wxT( "U" ) );
|
||||
m_isInNetlist = true;
|
||||
m_excludedFromSim = false;
|
||||
m_excludedFromBOM = false;
|
||||
m_excludedFromBoard = false;
|
||||
}
|
||||
|
@ -496,30 +498,6 @@ void SCH_SYMBOL::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffse
|
|||
}
|
||||
|
||||
|
||||
void SCH_SYMBOL::SetExcludeFromSim( bool aExclude )
|
||||
{
|
||||
SCH_FIELD* enable = FindField( SIM_ENABLE_FIELD );
|
||||
|
||||
if( aExclude )
|
||||
{
|
||||
if( !enable )
|
||||
enable = AddField( SCH_FIELD( VECTOR2I( 0, 0 ), -1, this, SIM_ENABLE_FIELD ) );
|
||||
|
||||
enable->SetText( wxS( "0" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
RemoveField( SIM_ENABLE_FIELD );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool SCH_SYMBOL::GetExcludeFromSim() const
|
||||
{
|
||||
return GetFieldText( SIM_ENABLE_FIELD ) == wxS( "0" );
|
||||
}
|
||||
|
||||
|
||||
bool SCH_SYMBOL::GetInstance( SCH_SYMBOL_INSTANCE& aInstance,
|
||||
const KIID_PATH& aSheetPath, bool aTestFromEnd ) const
|
||||
{
|
||||
|
@ -1159,6 +1137,7 @@ void SCH_SYMBOL::SwapData( SCH_ITEM* aItem )
|
|||
m_transform = symbol->m_transform;
|
||||
symbol->m_transform = tmp;
|
||||
|
||||
std::swap( m_excludedFromSim, symbol->m_excludedFromSim );
|
||||
std::swap( m_excludedFromBOM, symbol->m_excludedFromBOM );
|
||||
std::swap( m_DNP, symbol->m_DNP );
|
||||
std::swap( m_excludedFromBoard, symbol->m_excludedFromBoard );
|
||||
|
@ -1331,8 +1310,8 @@ bool SCH_SYMBOL::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, i
|
|||
}
|
||||
else if( token->IsSameAs( wxT( "EXCLUDE_FROM_SIM" ) ) )
|
||||
{
|
||||
*token = this->GetExcludeFromSim() ? _( "Excluded from simulation" )
|
||||
: wxString( wxT( "" ) );
|
||||
*token = this->GetExcludedFromSim() ? _( "Excluded from simulation" )
|
||||
: wxString( wxT( "" ) );
|
||||
return true;
|
||||
}
|
||||
else if( token->IsSameAs( wxT( "DNP" ) ) )
|
||||
|
@ -1720,7 +1699,7 @@ void SCH_SYMBOL::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_
|
|||
{
|
||||
wxArrayString msgs;
|
||||
|
||||
if( GetExcludeFromSim() )
|
||||
if( GetExcludedFromSim() )
|
||||
msgs.Add( _( "Simulation" ) );
|
||||
|
||||
if( GetExcludedFromBOM() )
|
||||
|
@ -2432,7 +2411,7 @@ static struct SCH_SYMBOL_DESC
|
|||
&SCH_SYMBOL::SetExcludedFromBoard, &SCH_SYMBOL::GetExcludedFromBoard ),
|
||||
groupAttributes );
|
||||
propMgr.AddProperty( new PROPERTY<SCH_SYMBOL, bool>( _HKI( "Exclude from simulation" ),
|
||||
&SCH_SYMBOL::SetExcludeFromSim, &SCH_SYMBOL::GetExcludeFromSim ),
|
||||
&SCH_SYMBOL::SetExcludedFromSim, &SCH_SYMBOL::GetExcludedFromSim ),
|
||||
groupAttributes );
|
||||
propMgr.AddProperty( new PROPERTY<SCH_SYMBOL, bool>( _HKI( "Exclude from bill of materials" ),
|
||||
&SCH_SYMBOL::SetExcludedFromBOM, &SCH_SYMBOL::GetExcludedFromBOM ),
|
||||
|
|
|
@ -152,9 +152,6 @@ public:
|
|||
void SortInstances( bool ( *aSortFunction )( const SCH_SYMBOL_INSTANCE& aLhs,
|
||||
const SCH_SYMBOL_INSTANCE& aRhs ) );
|
||||
|
||||
void SetExcludeFromSim( bool aExclude ) override;
|
||||
bool GetExcludeFromSim() const override;
|
||||
|
||||
void ViewGetLayers( int aLayers[], int& aCount ) const override;
|
||||
|
||||
/**
|
||||
|
@ -748,6 +745,9 @@ public:
|
|||
|
||||
bool HasBrightenedPins();
|
||||
|
||||
bool GetExcludedFromSim() const override { return m_excludedFromSim; }
|
||||
void SetExcludedFromSim( bool aExclude ) override { m_excludedFromSim = aExclude; }
|
||||
|
||||
bool GetExcludedFromBOM() const { return m_excludedFromBOM; }
|
||||
void SetExcludedFromBOM( bool aIncludeInBOM ) { m_excludedFromBOM = aIncludeInBOM; }
|
||||
|
||||
|
@ -803,10 +803,11 @@ private:
|
|||
std::vector<std::unique_ptr<SCH_PIN>> m_pins; ///< a SCH_PIN for every LIB_PIN (all units)
|
||||
std::unordered_map<LIB_PIN*, unsigned> m_pinMap; ///< library pin pointer : SCH_PIN's index
|
||||
|
||||
bool m_isInNetlist; ///< True if the symbol should appear in the netlist
|
||||
bool m_excludedFromBOM; ///< True to include in bill of materials export.
|
||||
bool m_excludedFromBoard; ///< True to include in netlist when updating board.
|
||||
bool m_DNP; ///< True if symbol is set to 'Do Not Populate'.
|
||||
bool m_isInNetlist; ///< True if the symbol should appear in the netlist
|
||||
bool m_excludedFromSim; ///< True to exclude from simulation.
|
||||
bool m_excludedFromBOM; ///< True to exclude from bill of materials export.
|
||||
bool m_excludedFromBoard; ///< True to exclude from netlist when updating board.
|
||||
bool m_DNP; ///< True if symbol is set to 'Do Not Populate'.
|
||||
|
||||
// Defines the hierarchical path and reference of the symbol. This allows support
|
||||
// for multiple references to a single sub-sheet.
|
||||
|
|
|
@ -122,7 +122,7 @@ SCH_TEXT::SCH_TEXT( const VECTOR2I& pos, const wxString& text, KICAD_T aType ) :
|
|||
SetTextSpinStyle( TEXT_SPIN_STYLE::LEFT );
|
||||
SetMultilineAllowed( true );
|
||||
|
||||
m_excludeFromSim = false;
|
||||
m_excludedFromSim = false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -131,7 +131,7 @@ SCH_TEXT::SCH_TEXT( const SCH_TEXT& aText ) :
|
|||
EDA_TEXT( aText ),
|
||||
m_spin_style( aText.m_spin_style )
|
||||
{
|
||||
m_excludeFromSim = aText.m_excludeFromSim;
|
||||
m_excludedFromSim = aText.m_excludedFromSim;
|
||||
}
|
||||
|
||||
|
||||
|
@ -258,8 +258,8 @@ bool SCH_TEXT::operator<( const SCH_ITEM& aItem ) const
|
|||
if( GetPosition().y != other->GetPosition().y )
|
||||
return GetPosition().y < other->GetPosition().y;
|
||||
|
||||
if( GetExcludeFromSim() != other->GetExcludeFromSim() )
|
||||
return GetExcludeFromSim() - other->GetExcludeFromSim();
|
||||
if( GetExcludedFromSim() != other->GetExcludedFromSim() )
|
||||
return GetExcludedFromSim() - other->GetExcludedFromSim();
|
||||
|
||||
return GetText() < other->GetText();
|
||||
}
|
||||
|
@ -503,7 +503,7 @@ void SCH_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_IT
|
|||
// Don't use GetShownText() here; we want to show the user the variable references
|
||||
aList.emplace_back( _( "Graphic Text" ), KIUI::EllipsizeStatusText( aFrame, GetText() ) );
|
||||
|
||||
if( m_excludeFromSim )
|
||||
if( m_excludedFromSim )
|
||||
aList.emplace_back( _( "Exclude from" ), _( "Simulation" ) );
|
||||
|
||||
aList.emplace_back( _( "Font" ), GetFont() ? GetFont()->GetName() : _( "Default" ) );
|
||||
|
|
|
@ -143,8 +143,8 @@ public:
|
|||
|
||||
void DoHypertextAction( EDA_DRAW_FRAME* aFrame ) const override;
|
||||
|
||||
void SetExcludeFromSim( bool aExclude ) override { m_excludeFromSim = aExclude; }
|
||||
bool GetExcludeFromSim() const override { return m_excludeFromSim; }
|
||||
void SetExcludedFromSim( bool aExclude ) override { m_excludedFromSim = aExclude; }
|
||||
bool GetExcludedFromSim() const override { return m_excludedFromSim; }
|
||||
|
||||
/**
|
||||
* Set a spin or rotation angle, along with specific horizontal and vertical justification
|
||||
|
@ -248,7 +248,7 @@ protected:
|
|||
*/
|
||||
TEXT_SPIN_STYLE m_spin_style;
|
||||
|
||||
bool m_excludeFromSim;
|
||||
bool m_excludedFromSim;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ SCH_TEXTBOX::SCH_TEXTBOX( int aLineWidth, FILL_T aFillType, const wxString& text
|
|||
SetVertJustify( GR_TEXT_V_ALIGN_TOP );
|
||||
SetMultilineAllowed( true );
|
||||
|
||||
m_excludeFromSim = false;
|
||||
m_excludedFromSim = false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -61,7 +61,7 @@ SCH_TEXTBOX::SCH_TEXTBOX( const SCH_TEXTBOX& aText ) :
|
|||
SCH_SHAPE( aText ),
|
||||
EDA_TEXT( aText )
|
||||
{
|
||||
m_excludeFromSim = aText.m_excludeFromSim;
|
||||
m_excludedFromSim = aText.m_excludedFromSim;
|
||||
}
|
||||
|
||||
|
||||
|
@ -213,8 +213,8 @@ bool SCH_TEXTBOX::operator<( const SCH_ITEM& aItem ) const
|
|||
if( GetPosition().y != other->GetPosition().y )
|
||||
return GetPosition().y < other->GetPosition().y;
|
||||
|
||||
if( GetExcludeFromSim() != other->GetExcludeFromSim() )
|
||||
return GetExcludeFromSim() - other->GetExcludeFromSim();
|
||||
if( GetExcludedFromSim() != other->GetExcludedFromSim() )
|
||||
return GetExcludedFromSim() - other->GetExcludedFromSim();
|
||||
|
||||
return GetText() < other->GetText();
|
||||
}
|
||||
|
@ -445,7 +445,7 @@ void SCH_TEXTBOX::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL
|
|||
// Don't use GetShownText() here; we want to show the user the variable references
|
||||
aList.emplace_back( _( "Text Box" ), KIUI::EllipsizeStatusText( aFrame, GetText() ) );
|
||||
|
||||
if( m_excludeFromSim )
|
||||
if( m_excludedFromSim )
|
||||
aList.emplace_back( _( "Exclude from" ), _( "Simulation" ) );
|
||||
|
||||
aList.emplace_back( _( "Font" ), GetFont() ? GetFont()->GetName() : _( "Default" ) );
|
||||
|
|
|
@ -70,8 +70,8 @@ public:
|
|||
|
||||
void DoHypertextAction( EDA_DRAW_FRAME* aFrame ) const override;
|
||||
|
||||
void SetExcludeFromSim( bool aExclude ) override { m_excludeFromSim = aExclude; }
|
||||
bool GetExcludeFromSim() const override { return m_excludeFromSim; }
|
||||
void SetExcludedFromSim( bool aExclude ) override { m_excludedFromSim = aExclude; }
|
||||
bool GetExcludedFromSim() const override { return m_excludedFromSim; }
|
||||
|
||||
void Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& offset ) override;
|
||||
|
||||
|
@ -126,7 +126,7 @@ protected:
|
|||
const KIFONT::METRICS& getFontMetrics() const override { return GetFontMetrics(); }
|
||||
|
||||
protected:
|
||||
bool m_excludeFromSim;
|
||||
bool m_excludedFromSim;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1590,19 +1590,19 @@ void SIM_MODEL::MigrateSimModel( T_symbol& aSymbol, const PROJECT* aProject )
|
|||
FIELD_INFO pinMapInfo;
|
||||
bool modelFromValueField = false;
|
||||
|
||||
if( aSymbol.FindField( wxT( "Spice_Primitive" ) )
|
||||
|| aSymbol.FindField( wxT( "Spice_Node_Sequence" ) )
|
||||
|| aSymbol.FindField( wxT( "Spice_Model" ) )
|
||||
|| aSymbol.FindField( wxT( "Spice_Netlist_Enabled" ) )
|
||||
|| aSymbol.FindField( wxT( "Spice_Lib_File" ) ) )
|
||||
if( aSymbol.FindField( SIM_LEGACY_DEVICE_TYPE_FIELD )
|
||||
|| aSymbol.FindField( SIM_LEGACY_PINS_FIELD )
|
||||
|| aSymbol.FindField( SIM_LEGACY_TYPE_FIELD )
|
||||
|| aSymbol.FindField( SIM_LEGACY_ENABLE_FIELD )
|
||||
|| aSymbol.FindField( SIM_LEGACY_LIBRARY_FIELD ) )
|
||||
{
|
||||
if( T_field* primitiveField = aSymbol.FindField( wxT( "Spice_Primitive" ) ) )
|
||||
if( T_field* primitiveField = aSymbol.FindField( SIM_LEGACY_DEVICE_TYPE_FIELD ) )
|
||||
{
|
||||
spiceDeviceInfo = FIELD_INFO( primitiveField->GetText(), primitiveField );
|
||||
aSymbol.RemoveField( primitiveField );
|
||||
}
|
||||
|
||||
if( T_field* nodeSequenceField = aSymbol.FindField( wxT( "Spice_Node_Sequence" ) ) )
|
||||
if( T_field* nodeSequenceField = aSymbol.FindField( SIM_LEGACY_PINS_FIELD ) )
|
||||
{
|
||||
const wxString delimiters( "{:,; }" );
|
||||
const wxString& nodeSequence = nodeSequenceField->GetText();
|
||||
|
@ -1628,7 +1628,7 @@ void SIM_MODEL::MigrateSimModel( T_symbol& aSymbol, const PROJECT* aProject )
|
|||
aSymbol.RemoveField( nodeSequenceField );
|
||||
}
|
||||
|
||||
if( T_field* modelField = aSymbol.FindField( wxT( "Spice_Model" ) ) )
|
||||
if( T_field* modelField = aSymbol.FindField( SIM_LEGACY_TYPE_FIELD ) )
|
||||
{
|
||||
spiceModelInfo = FIELD_INFO( getSIValue( modelField ), modelField );
|
||||
aSymbol.RemoveField( modelField );
|
||||
|
@ -1639,24 +1639,7 @@ void SIM_MODEL::MigrateSimModel( T_symbol& aSymbol, const PROJECT* aProject )
|
|||
modelFromValueField = true;
|
||||
}
|
||||
|
||||
if( T_field* netlistEnabledField = aSymbol.FindField( wxT( "Spice_Netlist_Enabled" ) ) )
|
||||
{
|
||||
wxString netlistEnabled = netlistEnabledField->GetText().Lower();
|
||||
|
||||
if( netlistEnabled.StartsWith( wxT( "0" ) )
|
||||
|| netlistEnabled.StartsWith( wxT( "n" ) )
|
||||
|| netlistEnabled.StartsWith( wxT( "f" ) ) )
|
||||
{
|
||||
netlistEnabledField->SetName( SIM_ENABLE_FIELD );
|
||||
netlistEnabledField->SetText( wxT( "0" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
aSymbol.RemoveField( netlistEnabledField );
|
||||
}
|
||||
}
|
||||
|
||||
if( T_field* libFileField = aSymbol.FindField( wxT( "Spice_Lib_File" ) ) )
|
||||
if( T_field* libFileField = aSymbol.FindField( SIM_LEGACY_LIBRARY_FIELD ) )
|
||||
{
|
||||
spiceLibInfo = FIELD_INFO( libFileField->GetText(), libFileField );
|
||||
aSymbol.RemoveField( libFileField );
|
||||
|
|
|
@ -53,10 +53,18 @@ class PROJECT;
|
|||
#define SIM_TYPE_FIELD wxT( "Sim.Type" )
|
||||
#define SIM_PINS_FIELD wxT( "Sim.Pins" )
|
||||
#define SIM_PARAMS_FIELD wxT( "Sim.Params" )
|
||||
// Note: this has been moved to an actual attribute and is no longer written
|
||||
// out as a field
|
||||
#define SIM_ENABLE_FIELD wxT( "Sim.Enable" )
|
||||
#define SIM_LIBRARY_FIELD wxT( "Sim.Library" )
|
||||
#define SIM_NAME_FIELD wxT( "Sim.Name" )
|
||||
|
||||
#define SIM_LEGACY_DEVICE_TYPE_FIELD wxS( "Spice_Primitive" )
|
||||
#define SIM_LEGACY_TYPE_FIELD wxS( "Spice_Model" )
|
||||
#define SIM_LEGACY_PINS_FIELD wxS( "Spice_Node_Sequence" )
|
||||
#define SIM_LEGACY_ENABLE_FIELD wxS( "Spice_Netlist_Enabled" )
|
||||
#define SIM_LEGACY_LIBRARY_FIELD wxS( "Spice_Lib_File" )
|
||||
|
||||
|
||||
class SIM_MODEL
|
||||
{
|
||||
|
|
|
@ -56,12 +56,6 @@ public:
|
|||
LIB
|
||||
)
|
||||
|
||||
static constexpr auto LEGACY_TYPE_FIELD = "Spice_Primitive";
|
||||
static constexpr auto LEGACY_PINS_FIELD = "Spice_Node_Sequence";
|
||||
static constexpr auto LEGACY_MODEL_FIELD = "Spice_Model";
|
||||
static constexpr auto LEGACY_ENABLED_FIELD = "Spice_Netlist_Enabled";
|
||||
static constexpr auto LEGACY_LIB_FIELD = "Spice_Lib_File";
|
||||
|
||||
SIM_MODEL_RAW_SPICE( const std::string& aSpiceSource = "" );
|
||||
|
||||
void SetSource( const std::string& aSpiceSource ) { m_spiceCode = aSpiceSource; }
|
||||
|
|
|
@ -2543,7 +2543,7 @@ int SCH_EDIT_TOOL::SetAttribute( const TOOL_EVENT& aEvent )
|
|||
symbol->SetDNP( true );
|
||||
|
||||
if( aEvent.IsAction( &EE_ACTIONS::setExcludeFromSimulation ) )
|
||||
symbol->SetExcludeFromSim( true );
|
||||
symbol->SetExcludedFromSim( true );
|
||||
|
||||
if( aEvent.IsAction( &EE_ACTIONS::setExcludeFromBOM ) )
|
||||
symbol->SetExcludedFromBOM( true );
|
||||
|
@ -2580,7 +2580,7 @@ int SCH_EDIT_TOOL::UnsetAttribute( const TOOL_EVENT& aEvent )
|
|||
symbol->SetDNP( false );
|
||||
|
||||
if( aEvent.IsAction( &EE_ACTIONS::unsetExcludeFromSimulation ) )
|
||||
symbol->SetExcludeFromSim( false );
|
||||
symbol->SetExcludedFromSim( false );
|
||||
|
||||
if( aEvent.IsAction( &EE_ACTIONS::unsetExcludeFromBOM ) )
|
||||
symbol->SetExcludedFromBOM( false );
|
||||
|
@ -2617,7 +2617,7 @@ int SCH_EDIT_TOOL::ToggleAttribute( const TOOL_EVENT& aEvent )
|
|||
symbol->SetDNP( !symbol->GetDNP() );
|
||||
|
||||
if( aEvent.IsAction( &EE_ACTIONS::toggleExcludeFromSimulation ) )
|
||||
symbol->SetExcludeFromSim( !symbol->GetExcludeFromSim() );
|
||||
symbol->SetExcludedFromSim( !symbol->GetExcludedFromSim() );
|
||||
|
||||
if( aEvent.IsAction( &EE_ACTIONS::toggleExcludeFromBOM ) )
|
||||
symbol->SetExcludedFromBOM( !symbol->GetExcludedFromBOM() );
|
||||
|
|
|
@ -58,6 +58,7 @@ struct MAPPABLE_SYMBOL_PROPERTIES
|
|||
std::string description;
|
||||
std::string footprint_filters;
|
||||
std::string keywords;
|
||||
std::string exclude_from_sim;
|
||||
std::string exclude_from_bom;
|
||||
std::string exclude_from_board;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue