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 Types

typedef std::vector< std::unique_ptr< FOOTPRINT_INFO > > FPILIST
 
typedef SYNC_QUEUE< std::unique_ptr< IO_ERROR > > ERRLIST
 

Public Member Functions

 FOOTPRINT_LIST ()
 
virtual ~FOOTPRINT_LIST ()
 
virtual void WriteCacheToFile (const wxString &aFilePath)
 
virtual void ReadCacheFromFile (const wxString &aFilePath)
 
unsigned GetCount () const
 
const FPILISTGetList () const
 Was forced to add this by modview_frame.cpp. More...
 
void Clear ()
 
FOOTPRINT_INFOGetFootprintInfo (const wxString &aFootprintName)
 Get info for a footprint by id. More...
 
FOOTPRINT_INFOGetFootprintInfo (const wxString &aLibNickname, const wxString &aFootprintName)
 Get info for a footprint by libNickname/footprintName. More...
 
FOOTPRINT_INFOGetItem (unsigned aIdx) const
 Get info for a footprint by index. More...
 
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. More...
 
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. More...
 

Protected Attributes

FP_LIB_TABLEm_lib_table
 no ownership More...
 
FPILIST m_list
 
ERRLIST m_errors
 some can be PARSE_ERRORs also More...
 

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.

Member Typedef Documentation

◆ ERRLIST

typedef SYNC_QUEUE<std::unique_ptr<IO_ERROR> > FOOTPRINT_LIST::ERRLIST

Definition at line 164 of file footprint_info.h.

◆ FPILIST

typedef std::vector<std::unique_ptr<FOOTPRINT_INFO> > FOOTPRINT_LIST::FPILIST

Definition at line 163 of file footprint_info.h.

Constructor & Destructor Documentation

◆ FOOTPRINT_LIST()

FOOTPRINT_LIST::FOOTPRINT_LIST ( )
inline

Definition at line 166 of file footprint_info.h.

◆ ~FOOTPRINT_LIST()

virtual FOOTPRINT_LIST::~FOOTPRINT_LIST ( )
inlinevirtual

Definition at line 170 of file footprint_info.h.

Member Function Documentation

◆ Clear()

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

Definition at line 194 of file footprint_info.h.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ DisplayErrors()

void FOOTPRINT_LIST::DisplayErrors ( wxTopLevelWindow *  aCaller = nullptr)

◆ 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 216 of file footprint_info.h.

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

◆ GetList()

const FPILIST & FOOTPRINT_LIST::GetList ( ) const
inline

Was forced to add this by modview_frame.cpp.

Definition at line 186 of file footprint_info.h.

Referenced by FP_TREE_MODEL_ADAPTER::getFootprints().

◆ GetTable()

FP_LIB_TABLE * FOOTPRINT_LIST::GetTable ( ) const
inline

Definition at line 251 of file footprint_info.h.

Referenced by FOOTPRINT_INFO_IMPL::load().

◆ PopError()

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

Definition at line 226 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 175 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 174 of file footprint_info.h.

Member Data Documentation

◆ m_errors

ERRLIST FOOTPRINT_LIST::m_errors
protected

some can be PARSE_ERRORs also

Definition at line 269 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: