Search component footprint text

- Added footprint text to search string for each component.
This commit is contained in:
Oliver Walters 2017-07-09 23:08:33 +10:00 committed by Wayne Stambaugh
parent 94b9524f6d
commit f509ccc7cf
3 changed files with 29 additions and 0 deletions

View File

@ -1350,6 +1350,14 @@ LIB_FIELD& LIB_PART::GetReferenceField()
}
LIB_FIELD& LIB_PART::GetFootprintField()
{
LIB_FIELD* field = GetField( FOOTPRINT );
wxASSERT( field != NULL );
return *field;
}
bool LIB_PART::SaveDateAndTime( OUTPUTFORMATTER& aFormatter )
{
int year, mon, day, hour, min, sec;

View File

@ -437,6 +437,9 @@ public:
/** Return reference to the reference designator field. */
LIB_FIELD& GetReferenceField();
/** Return reference to the footprint field */
LIB_FIELD& GetFootprintField();
/**
* Draw part.
*

View File

@ -142,6 +142,24 @@ CMP_TREE_NODE_ALIAS::CMP_TREE_NODE_ALIAS( CMP_TREE_NODE* aParent, LIB_ALIAS* aAl
MatchName = aAlias->GetName().Lower();
SearchText = (aAlias->GetKeyWords() + " " + Desc).Lower();
// Extract default footprint text
LIB_PART* part = aAlias->GetPart();
wxString footprint;
if( part )
{
footprint = part->GetFootprintField().GetText();
}
// If a footprint is defined for the part,
// add it to the serach string
if( !footprint.IsEmpty() )
{
SearchText += " ";
SearchText += footprint.Lower();
}
if( aAlias->GetPart()->IsMulti() )
{
for( int u = 1; u <= aAlias->GetPart()->GetUnitCount(); ++u )