KiCad PCB EDA Suite
BASIC_FOOTPRINT_INFO Class Reference
Inheritance diagram for BASIC_FOOTPRINT_INFO:
FOOTPRINT_INFO LIB_TREE_ITEM

Public Member Functions

 BASIC_FOOTPRINT_INFO (FOOTPRINT *aFootprint)
 
const wxString & GetFootprintName () const
 
wxString GetLibNickname () const override
 
wxString GetName () const override
 
LIB_ID GetLibId () const override
 
wxString GetDescription () override
 
wxString GetKeywords ()
 
wxString GetSearchText () override
 
unsigned GetPadCount ()
 
unsigned GetUniquePadCount ()
 
int GetOrderNum ()
 
bool InLibrary (const wxString &aLibrary) const
 Test if the FOOTPRINT_INFO object was loaded from aLibrary. More...
 
virtual bool IsRoot () const
 For items having aliases, IsRoot() indicates the principal item. More...
 
virtual int GetUnitCount () const
 For items with units, return the number of units. More...
 
virtual wxString GetUnitReference (int aUnit)
 For items with units, return an identifier for unit x. More...
 

Protected Member Functions

void ensure_loaded ()
 
virtual void load ()
 lazily load stuff not filled in by constructor. This may throw IO_ERRORS. More...
 

Protected Attributes

FOOTPRINT_LISTm_owner
 provides access to FP_LIB_TABLE More...
 
bool m_loaded
 
wxString m_nickname
 library as known in FP_LIB_TABLE More...
 
wxString m_fpname
 Module name. More...
 
int m_num
 Order number in the display list. More...
 
unsigned m_pad_count
 Number of pads. More...
 
unsigned m_unique_pad_count
 Number of unique pads. More...
 
wxString m_doc
 Footprint description. More...
 
wxString m_keywords
 Footprint keywords. More...
 

Detailed Description

Definition at line 134 of file footprint_editor_utils.cpp.

Constructor & Destructor Documentation

◆ BASIC_FOOTPRINT_INFO()

BASIC_FOOTPRINT_INFO::BASIC_FOOTPRINT_INFO ( FOOTPRINT aFootprint)
inline

Definition at line 137 of file footprint_editor_utils.cpp.

138  {
139  m_nickname = aFootprint->GetFPID().GetLibNickname().wx_str();
140  m_fpname = aFootprint->GetFPID().GetLibItemName().wx_str();
143  m_keywords = aFootprint->GetKeywords();
144  m_doc = aFootprint->GetDescription();
145  m_loaded = true;
146  }
const wxString & GetDescription() const
Definition: footprint.h:197
const UTF8 & GetLibItemName() const
Definition: lib_id.h:104
unsigned GetPadCount(INCLUDE_NPTH_T aIncludeNPTH=INCLUDE_NPTH_T(INCLUDE_NPTH)) const
Return the number of pads.
Definition: footprint.cpp:1111
unsigned m_pad_count
Number of pads.
wxString m_doc
Footprint description.
wxString m_fpname
Module name.
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:90
const LIB_ID & GetFPID() const
Definition: footprint.h:194
const wxString & GetKeywords() const
Definition: footprint.h:200
wxString m_keywords
Footprint keywords.
wxString wx_str() const
Definition: utf8.cpp:46
unsigned GetUniquePadCount(INCLUDE_NPTH_T aIncludeNPTH=INCLUDE_NPTH_T(INCLUDE_NPTH)) const
Return the number of unique non-blank pads.
Definition: footprint.cpp:1130
wxString m_nickname
library as known in FP_LIB_TABLE
unsigned m_unique_pad_count
Number of unique pads.

References DO_NOT_INCLUDE_NPTH, FOOTPRINT::GetDescription(), FOOTPRINT::GetFPID(), FOOTPRINT::GetKeywords(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), FOOTPRINT::GetPadCount(), FOOTPRINT::GetUniquePadCount(), and UTF8::wx_str().

Member Function Documentation

◆ ensure_loaded()

void FOOTPRINT_INFO::ensure_loaded ( )
inlineprotectedinherited

Definition at line 136 of file footprint_info.h.

137  {
138  if( !m_loaded )
139  load();
140  }
virtual void load()
lazily load stuff not filled in by constructor. This may throw IO_ERRORS.

◆ GetDescription()

wxString FOOTPRINT_INFO::GetDescription ( )
inlineoverridevirtualinherited

Implements LIB_TREE_ITEM.

Definition at line 81 of file footprint_info.h.

82  {
83  ensure_loaded();
84  return m_doc;
85  }
wxString m_doc
Footprint description.

Referenced by CVPCB_MAINFRAME::DisplayStatus().

◆ GetFootprintName()

const wxString& FOOTPRINT_INFO::GetFootprintName ( ) const
inlineinherited

◆ GetKeywords()

wxString FOOTPRINT_INFO::GetKeywords ( )
inlineinherited

Definition at line 87 of file footprint_info.h.

88  {
89  ensure_loaded();
90  return m_keywords;
91  }
wxString m_keywords
Footprint keywords.

Referenced by CVPCB_MAINFRAME::DisplayStatus().

◆ GetLibId()

LIB_ID FOOTPRINT_INFO::GetLibId ( ) const
inlineoverridevirtualinherited

Implements LIB_TREE_ITEM.

Definition at line 76 of file footprint_info.h.

77  {
78  return LIB_ID( m_nickname, m_fpname );
79  }
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
wxString m_fpname
Module name.
wxString m_nickname
library as known in FP_LIB_TABLE

◆ GetLibNickname()

wxString FOOTPRINT_INFO::GetLibNickname ( ) const
inlineoverridevirtualinherited

◆ GetName()

wxString FOOTPRINT_INFO::GetName ( void  ) const
inlineoverridevirtualinherited

Implements LIB_TREE_ITEM.

Definition at line 74 of file footprint_info.h.

74 { return m_fpname; }
wxString m_fpname
Module name.

◆ GetOrderNum()

int FOOTPRINT_INFO::GetOrderNum ( )
inlineinherited

Definition at line 114 of file footprint_info.h.

115  {
116  ensure_loaded();
117  return m_num;
118  }
int m_num
Order number in the display list.

◆ GetPadCount()

unsigned FOOTPRINT_INFO::GetPadCount ( )
inlineinherited

Definition at line 102 of file footprint_info.h.

103  {
104  ensure_loaded();
105  return m_pad_count;
106  }
unsigned m_pad_count
Number of pads.

◆ GetSearchText()

wxString FOOTPRINT_INFO::GetSearchText ( )
inlineoverridevirtualinherited

Reimplemented from LIB_TREE_ITEM.

Definition at line 93 of file footprint_info.h.

94  {
95  // Matches are scored by offset from front of string, so inclusion of this spacer
96  // discounts matches found after it.
97  static const wxString discount( wxT( " " ) );
98 
99  return GetKeywords() + discount + GetDescription();
100  }
wxString GetDescription() override
wxString GetKeywords()

References LIB_TREE_ITEM::GetDescription().

Referenced by FOOTPRINT_FILTER::ITERATOR::increment().

◆ GetUniquePadCount()

unsigned FOOTPRINT_INFO::GetUniquePadCount ( )
inlineinherited

Definition at line 108 of file footprint_info.h.

109  {
110  ensure_loaded();
111  return m_unique_pad_count;
112  }
unsigned m_unique_pad_count
Number of unique pads.

Referenced by FOOTPRINT_FILTER::ITERATOR::PinCountMatch().

◆ GetUnitCount()

virtual int LIB_TREE_ITEM::GetUnitCount ( void  ) const
inlinevirtualinherited

For items with units, return the number of units.

Reimplemented in LIB_SYMBOL.

Definition at line 62 of file lib_tree_item.h.

62 { return 0; }

Referenced by LIB_TREE_NODE_LIB_ID::LIB_TREE_NODE_LIB_ID(), and LIB_TREE_NODE_LIB_ID::Update().

◆ GetUnitReference()

virtual wxString LIB_TREE_ITEM::GetUnitReference ( int  aUnit)
inlinevirtualinherited

For items with units, return an identifier for unit x.

Reimplemented in LIB_SYMBOL.

Definition at line 67 of file lib_tree_item.h.

67 { return wxEmptyString; }

Referenced by LIB_TREE_NODE_UNIT::LIB_TREE_NODE_UNIT().

◆ InLibrary()

bool FOOTPRINT_INFO::InLibrary ( const wxString &  aLibrary) const
inherited

Test if the FOOTPRINT_INFO object was loaded from aLibrary.

Parameters
aLibraryis the nickname of the library to test.
Returns
true if the FOOTPRINT_INFO object was loaded from aLibrary. Otherwise false.

Definition at line 72 of file footprint_info.cpp.

73 {
74  return aLibrary == m_nickname;
75 }
wxString m_nickname
library as known in FP_LIB_TABLE

References FOOTPRINT_INFO::m_nickname.

Referenced by FOOTPRINT_FILTER::ITERATOR::increment().

◆ IsRoot()

virtual bool LIB_TREE_ITEM::IsRoot ( ) const
inlinevirtualinherited

For items having aliases, IsRoot() indicates the principal item.

Reimplemented in LIB_SYMBOL.

Definition at line 57 of file lib_tree_item.h.

57 { return true; }

Referenced by LIB_TREE_NODE_LIB_ID::LIB_TREE_NODE_LIB_ID(), and LIB_TREE_NODE_LIB_ID::Update().

◆ load()

virtual void FOOTPRINT_INFO::load ( )
inlineprotectedvirtualinherited

lazily load stuff not filled in by constructor. This may throw IO_ERRORS.

Reimplemented in FOOTPRINT_INFO_IMPL.

Definition at line 143 of file footprint_info.h.

143 { };

Member Data Documentation

◆ m_doc

wxString FOOTPRINT_INFO::m_doc
protectedinherited

Footprint description.

Definition at line 154 of file footprint_info.h.

Referenced by FOOTPRINT_INFO_IMPL::FOOTPRINT_INFO_IMPL(), and FOOTPRINT_INFO_IMPL::load().

◆ m_fpname

wxString FOOTPRINT_INFO::m_fpname
protectedinherited

Module name.

Definition at line 150 of file footprint_info.h.

Referenced by FOOTPRINT_INFO_IMPL::FOOTPRINT_INFO_IMPL(), FOOTPRINT_INFO_IMPL::load(), and operator<().

◆ m_keywords

wxString FOOTPRINT_INFO::m_keywords
protectedinherited

Footprint keywords.

Definition at line 155 of file footprint_info.h.

Referenced by FOOTPRINT_INFO_IMPL::FOOTPRINT_INFO_IMPL(), and FOOTPRINT_INFO_IMPL::load().

◆ m_loaded

bool FOOTPRINT_INFO::m_loaded
protectedinherited

◆ m_nickname

wxString FOOTPRINT_INFO::m_nickname
protectedinherited

◆ m_num

int FOOTPRINT_INFO::m_num
protectedinherited

Order number in the display list.

Definition at line 151 of file footprint_info.h.

Referenced by FOOTPRINT_INFO_IMPL::FOOTPRINT_INFO_IMPL().

◆ m_owner

FOOTPRINT_LIST* FOOTPRINT_INFO::m_owner
protectedinherited

provides access to FP_LIB_TABLE

Definition at line 143 of file footprint_info.h.

Referenced by FOOTPRINT_INFO_IMPL::FOOTPRINT_INFO_IMPL(), and FOOTPRINT_INFO_IMPL::load().

◆ m_pad_count

unsigned FOOTPRINT_INFO::m_pad_count
protectedinherited

Number of pads.

Definition at line 152 of file footprint_info.h.

Referenced by FOOTPRINT_INFO_IMPL::FOOTPRINT_INFO_IMPL(), and FOOTPRINT_INFO_IMPL::load().

◆ m_unique_pad_count

unsigned FOOTPRINT_INFO::m_unique_pad_count
protectedinherited

Number of unique pads.

Definition at line 153 of file footprint_info.h.

Referenced by FOOTPRINT_INFO_IMPL::FOOTPRINT_INFO_IMPL(), and FOOTPRINT_INFO_IMPL::load().


The documentation for this class was generated from the following file: