Search component footprint text
- Added footprint text to search string for each component.
This commit is contained in:
parent
94b9524f6d
commit
f509ccc7cf
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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 )
|
||||
|
|
Loading…
Reference in New Issue