Support pin count and footprint filters in symbol editor.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17105
This commit is contained in:
Jeff Young 2024-02-25 13:10:54 +00:00
parent 2b09653abb
commit 74339e9a9f
1 changed files with 23 additions and 0 deletions

View File

@ -84,6 +84,28 @@ static wxString netList( SCH_SYMBOL* aSymbol, SCH_SHEET_PATH& aSheetPath )
}
static wxString netList( LIB_SYMBOL* aSymbol )
{
/*
* Symbol netlist format:
* pinCount
* fpFilters
*/
wxString netlist;
netlist << wxString::Format( wxS( "%d\r" ), aSymbol->GetPinCount() );
wxArrayString fpFilters = aSymbol->GetFPFilters();
if( !fpFilters.IsEmpty() )
netlist << EscapeString( wxJoin( fpFilters, ' ' ), CTX_LINE );
netlist << wxS( "\r" );
return netlist;
}
template <class T>
FIELDS_GRID_TABLE<T>::FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_BASE_FRAME* aFrame,
WX_GRID* aGrid, LIB_SYMBOL* aSymbol ) :
@ -93,6 +115,7 @@ FIELDS_GRID_TABLE<T>::FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_BASE_FRAME* a
m_parentType( SCH_SYMBOL_T ),
m_mandatoryFieldCount( MANDATORY_FIELDS ),
m_part( aSymbol ),
m_symbolNetlist( netList( aSymbol ) ),
m_fieldNameValidator( FIELD_NAME ),
m_referenceValidator( REFERENCE_FIELD ),
m_valueValidator( VALUE_FIELD ),