![]() |
KiCad PCB EDA Suite
|
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>
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 FPILIST & | GetList () const |
Was forced to add this by modview_frame.cpp. More... | |
void | Clear () |
FOOTPRINT_INFO * | GetFootprintInfo (const wxString &aFootprintName) |
Get info for a footprint by id. More... | |
FOOTPRINT_INFO * | GetFootprintInfo (const wxString &aLibNickname, const wxString &aFootprintName) |
Get info for a footprint by libNickname/footprintName. More... | |
FOOTPRINT_INFO & | GetItem (unsigned aIdx) const |
Get info for a footprint by index. More... | |
unsigned | GetErrorCount () const |
std::unique_ptr< IO_ERROR > | PopError () |
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_TABLE * | GetTable () const |
Static Public Member Functions | |
static FOOTPRINT_LIST * | GetInstance (KIWAY &aKiway) |
Factory function to return a FOOTPRINT_LIST via Kiway. More... | |
Protected Member Functions | |
virtual void | startWorkers (FP_LIB_TABLE *aTable, const wxString *aNickname, FOOTPRINT_ASYNC_LOADER *aLoader, unsigned aNThreads)=0 |
Launch worker threads to load footprints. More... | |
virtual bool | joinWorkers ()=0 |
Join worker threads. More... | |
virtual void | stopWorkers ()=0 |
Stop worker threads. More... | |
Protected Attributes | |
FP_LIB_TABLE * | m_lib_table |
no ownership More... | |
FPILIST | m_list |
ERRLIST | m_errors |
some can be PARSE_ERRORs also More... | |
Friends | |
class | FOOTPRINT_ASYNC_LOADER |
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 166 of file footprint_info.h.
typedef SYNC_QUEUE<std::unique_ptr<IO_ERROR> > FOOTPRINT_LIST::ERRLIST |
Definition at line 170 of file footprint_info.h.
typedef std::vector<std::unique_ptr<FOOTPRINT_INFO> > FOOTPRINT_LIST::FPILIST |
Definition at line 169 of file footprint_info.h.
|
inline |
Definition at line 172 of file footprint_info.h.
|
inlinevirtual |
Definition at line 176 of file footprint_info.h.
|
inline |
Definition at line 200 of file footprint_info.h.
Referenced by PCB_EDIT_FRAME::OpenProjectFiles().
void FOOTPRINT_LIST::DisplayErrors | ( | wxTopLevelWindow * | aCaller = nullptr | ) |
Definition at line 93 of file footprint_info.cpp.
References _, HTML_MESSAGE_BOX::AddHTML_Text(), HTML_MESSAGE_BOX::MessageSet(), and PopError().
Referenced by FOOTPRINT_EDIT_FRAME::initLibraryTree(), CVPCB_MAINFRAME::LoadFootprintFiles(), and PCB_BASE_FRAME::SelectFootprintFromLibTree().
|
inline |
Definition at line 186 of file footprint_info.h.
Referenced by FOOTPRINT_FILTER::ITERATOR::dereference(), FOOTPRINT_FILTER::end(), GetInstance(), FOOTPRINT_FILTER::ITERATOR::increment(), FOOTPRINT_EDIT_FRAME::initLibraryTree(), FOOTPRINT_SELECT_WIDGET::Load(), and PCB_EDIT_FRAME::OpenProjectFiles().
|
inline |
Definition at line 227 of file footprint_info.h.
Referenced by FOOTPRINT_EDIT_FRAME::initLibraryTree(), CVPCB_MAINFRAME::LoadFootprintFiles(), and PCB_BASE_FRAME::SelectFootprintFromLibTree().
FOOTPRINT_INFO * FOOTPRINT_LIST::GetFootprintInfo | ( | const wxString & | aFootprintName | ) |
Get info for a footprint by id.
Definition at line 58 of file footprint_info.cpp.
References Format(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), and LIB_ID::Parse().
Referenced by CVPCB_MAINFRAME::AutomaticFootprintMatching(), CVPCB_MAINFRAME::DisplayStatus(), DISPLAY_FOOTPRINTS_FRAME::InitDisplay(), and PCB_BASE_FRAME::SelectFootprintFromLibTree().
FOOTPRINT_INFO * FOOTPRINT_LIST::GetFootprintInfo | ( | const wxString & | aLibNickname, |
const wxString & | aFootprintName | ||
) |
Get info for a footprint by libNickname/footprintName.
Definition at line 42 of file footprint_info.cpp.
References m_list.
|
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.
aKiway | active kiway instance. |
Definition at line 143 of file footprint_info.cpp.
References get_instance_from_id(), GetCount(), PROJECT::GetProjectPath(), KIFACE_FOOTPRINT_LIST, KIWAY::Prj(), and ReadCacheFromFile().
Referenced by DIALOG_CHOOSE_SYMBOL::ConstructRightPanel(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), FOOTPRINT_SELECT_WIDGET::Load(), and FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList().
|
inline |
Get info for a footprint by index.
aIdx | index of the given item. |
Definition at line 222 of file footprint_info.h.
Referenced by FOOTPRINT_FILTER::ITERATOR::increment().
|
inline |
Was forced to add this by modview_frame.cpp.
Definition at line 192 of file footprint_info.h.
Referenced by FP_TREE_MODEL_ADAPTER::getFootprints().
|
inline |
|
protectedpure virtual |
Join worker threads.
Part of the FOOTPRINT_ASYNC_LOADER implementation.
Implemented in FOOTPRINT_LIST_IMPL.
Referenced by FOOTPRINT_ASYNC_LOADER::Join().
|
inline |
Definition at line 232 of file footprint_info.h.
Referenced by DisplayErrors().
|
inlinevirtual |
Reimplemented in FOOTPRINT_LIST_IMPL.
Definition at line 181 of file footprint_info.h.
Referenced by GetInstance().
|
pure virtual |
Read all the footprints provided by the combination of aTable and aNickname.
aTable | defines all the libraries. |
aNickname | is the library to read from, or if NULL means read all footprints from all known libraries in aTable. |
aProgressReporter | is an optional progress reporter. ReadFootprintFiles() will use 2 phases within the reporter. |
Implemented in FOOTPRINT_LIST_IMPL.
Referenced by CVPCB_MAINFRAME::LoadFootprintFiles().
|
protectedpure virtual |
Launch worker threads to load footprints.
Part of the FOOTPRINT_ASYNC_LOADER implementation.
Implemented in FOOTPRINT_LIST_IMPL.
Referenced by FOOTPRINT_ASYNC_LOADER::Start().
|
protectedpure virtual |
Stop worker threads.
Part of the FOOTPRINT_ASYNC_LOADER implementation.
Implemented in FOOTPRINT_LIST_IMPL.
Referenced by FOOTPRINT_ASYNC_LOADER::Abort().
|
inlinevirtual |
|
friend |
Definition at line 290 of file footprint_info.h.
|
protected |
some can be PARSE_ERRORs also
Definition at line 296 of file footprint_info.h.
Referenced by FOOTPRINT_LIST_IMPL::CatchErrors(), FOOTPRINT_LIST_IMPL::joinWorkers(), FOOTPRINT_LIST_IMPL::ReadFootprintFiles(), and FOOTPRINT_LIST_IMPL::startWorkers().
|
protected |
no ownership
Definition at line 293 of file footprint_info.h.
Referenced by FOOTPRINT_LIST_IMPL::joinWorkers(), FOOTPRINT_LIST_IMPL::loader_job(), and FOOTPRINT_LIST_IMPL::startWorkers().
|
protected |
Definition at line 295 of file footprint_info.h.
Referenced by GetFootprintInfo(), FOOTPRINT_FILTER::ITERATOR::increment(), FOOTPRINT_LIST_IMPL::joinWorkers(), FOOTPRINT_LIST_IMPL::ReadCacheFromFile(), FOOTPRINT_LIST_IMPL::startWorkers(), and FOOTPRINT_LIST_IMPL::WriteCacheToFile().