KiCad PCB EDA Suite
Loading...
Searching...
No Matches
FOOTPRINT_LIST Class Referenceabstract

Holds a list of FOOTPRINT_INFO objects, along with a list of IO_ERRORs or PARSE_ERRORs that were thrown acquiring the FOOTPRINT_INFOs. More...

#include <footprint_info.h>

Inheritance diagram for FOOTPRINT_LIST:
FOOTPRINT_LIST_IMPL

Public Member Functions

 FOOTPRINT_LIST ()
 
virtual ~FOOTPRINT_LIST ()
 
virtual void WriteCacheToFile (const wxString &aFilePath)
 
virtual void ReadCacheFromFile (const wxString &aFilePath)
 
unsigned GetCount () const
 
const std::vector< std::unique_ptr< FOOTPRINT_INFO > > & GetList () const
 Was forced to add this by modview_frame.cpp.
 
virtual void Clear ()=0
 
FOOTPRINT_INFOGetFootprintInfo (const wxString &aFootprintName)
 Get info for a footprint by id.
 
FOOTPRINT_INFOGetFootprintInfo (const wxString &aLibNickname, const wxString &aFootprintName)
 Get info for a footprint by libNickname/footprintName.
 
FOOTPRINT_INFOGetItem (unsigned aIdx) const
 Get info for a footprint by index.
 
unsigned GetErrorCount () const
 
std::unique_ptr< IO_ERRORPopError ()
 
virtual bool ReadFootprintFiles (FP_LIB_TABLE *aTable, const wxString *aNickname=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr)=0
 Read all the footprints provided by the combination of aTable and aNickname.
 
void DisplayErrors (wxTopLevelWindow *aCaller=nullptr)
 
FP_LIB_TABLEGetTable () const
 

Static Public Member Functions

static FOOTPRINT_LISTGetInstance (KIWAY &aKiway)
 Factory function to return a FOOTPRINT_LIST via Kiway.
 

Protected Attributes

FP_LIB_TABLEm_lib_table
 no ownership
 
std::vector< std::unique_ptr< FOOTPRINT_INFO > > m_list
 
SYNC_QUEUE< std::unique_ptr< IO_ERROR > > m_errors
 some can be PARSE_ERRORs also
 

Detailed Description

Holds a list of FOOTPRINT_INFO objects, along with a list of IO_ERRORs or PARSE_ERRORs that were thrown acquiring the FOOTPRINT_INFOs.

This is a virtual class; its implementation lives in pcbnew/footprint_info_impl.cpp. To get instances of these classes, see FOOTPRINT_LIST::GetInstance().

Definition at line 160 of file footprint_info.h.

Constructor & Destructor Documentation

◆ FOOTPRINT_LIST()

FOOTPRINT_LIST::FOOTPRINT_LIST ( )
inline

Definition at line 163 of file footprint_info.h.

◆ ~FOOTPRINT_LIST()

virtual FOOTPRINT_LIST::~FOOTPRINT_LIST ( )
inlinevirtual

Definition at line 168 of file footprint_info.h.

Member Function Documentation

◆ Clear()

virtual void FOOTPRINT_LIST::Clear ( )
pure virtual
Returns
Clears the footprint info cache

Implemented in FOOTPRINT_LIST_IMPL.

◆ DisplayErrors()

◆ GetCount()

◆ GetErrorCount()

unsigned FOOTPRINT_LIST::GetErrorCount ( ) const
inline

◆ GetFootprintInfo() [1/2]

◆ GetFootprintInfo() [2/2]

FOOTPRINT_INFO * FOOTPRINT_LIST::GetFootprintInfo ( const wxString &  aLibNickname,
const wxString &  aFootprintName 
)

Get info for a footprint by libNickname/footprintName.

Definition at line 43 of file footprint_info.cpp.

References m_list.

◆ GetInstance()

FOOTPRINT_LIST * FOOTPRINT_LIST::GetInstance ( KIWAY aKiway)
static

Factory function to return a FOOTPRINT_LIST via Kiway.

This is not guaranteed to succeed and will return null if the kiface is not available.

Parameters
aKiwayactive kiway instance.

Definition at line 163 of file footprint_info.cpp.

References get_instance_from_id(), GetCount(), PROJECT::GetProjectPath(), KIFACE_FOOTPRINT_LIST, KIWAY::Prj(), and ReadCacheFromFile().

Referenced by PANEL_SYMBOL_CHOOSER::constructRightPanel(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), FOOTPRINT_SELECT_WIDGET::Load(), and FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList().

◆ GetItem()

FOOTPRINT_INFO & FOOTPRINT_LIST::GetItem ( unsigned  aIdx) const
inline

Get info for a footprint by index.

Parameters
aIdxindex of the given item.
Returns
the aIdx item in list.

Definition at line 211 of file footprint_info.h.

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

◆ GetList()

const std::vector< std::unique_ptr< FOOTPRINT_INFO > > & FOOTPRINT_LIST::GetList ( ) const
inline

Was forced to add this by modview_frame.cpp.

Definition at line 184 of file footprint_info.h.

Referenced by FP_TREE_MODEL_ADAPTER::getFootprints().

◆ GetTable()

FP_LIB_TABLE * FOOTPRINT_LIST::GetTable ( ) const
inline

Definition at line 246 of file footprint_info.h.

Referenced by FOOTPRINT_INFO_IMPL::load().

◆ PopError()

std::unique_ptr< IO_ERROR > FOOTPRINT_LIST::PopError ( )
inline

Definition at line 221 of file footprint_info.h.

Referenced by DisplayErrors().

◆ ReadCacheFromFile()

virtual void FOOTPRINT_LIST::ReadCacheFromFile ( const wxString &  aFilePath)
inlinevirtual

Reimplemented in FOOTPRINT_LIST_IMPL.

Definition at line 173 of file footprint_info.h.

Referenced by GetInstance().

◆ ReadFootprintFiles()

virtual bool FOOTPRINT_LIST::ReadFootprintFiles ( FP_LIB_TABLE aTable,
const wxString *  aNickname = nullptr,
PROGRESS_REPORTER aProgressReporter = nullptr 
)
pure virtual

Read all the footprints provided by the combination of aTable and aNickname.

Parameters
aTabledefines all the libraries.
aNicknameis the library to read from, or if NULL means read all footprints from all known libraries in aTable.
aProgressReporteris an optional progress reporter. ReadFootprintFiles() will use 2 phases within the reporter.
Returns
true if it ran to completion, else false if it aborted after some number of errors. If true, it does not mean there were no errors, check GetErrorCount() for that, should be zero to indicate success.

Implemented in FOOTPRINT_LIST_IMPL.

Referenced by CVPCB_MAINFRAME::LoadFootprintFiles().

◆ WriteCacheToFile()

virtual void FOOTPRINT_LIST::WriteCacheToFile ( const wxString &  aFilePath)
inlinevirtual

Reimplemented in FOOTPRINT_LIST_IMPL.

Definition at line 172 of file footprint_info.h.

Member Data Documentation

◆ m_errors

SYNC_QUEUE<std::unique_ptr<IO_ERROR> > FOOTPRINT_LIST::m_errors
protected

some can be PARSE_ERRORs also

Definition at line 264 of file footprint_info.h.

Referenced by FOOTPRINT_LIST_IMPL::CatchErrors(), and FOOTPRINT_LIST_IMPL::ReadFootprintFiles().

◆ m_lib_table

FP_LIB_TABLE* FOOTPRINT_LIST::m_lib_table
protected

◆ m_list


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