KiCad PCB EDA Suite
|
#include <footprint_info_impl.h>
Public Member Functions | |
FOOTPRINT_LIST_IMPL () | |
virtual | ~FOOTPRINT_LIST_IMPL () |
void | WriteCacheToFile (const wxString &aFilePath) override |
void | ReadCacheFromFile (const wxString &aFilePath) override |
bool | ReadFootprintFiles (FP_LIB_TABLE *aTable, const wxString *aNickname=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr) override |
Read all the footprints provided by the combination of aTable and aNickname. | |
void | Clear () override |
unsigned | GetCount () const |
const std::vector< std::unique_ptr< FOOTPRINT_INFO > > & | GetList () const |
Was forced to add this by modview_frame.cpp. | |
FOOTPRINT_INFO * | GetFootprintInfo (const wxString &aFootprintName) |
Get info for a footprint by id. | |
FOOTPRINT_INFO * | GetFootprintInfo (const wxString &aLibNickname, const wxString &aFootprintName) |
Get info for a footprint by libNickname/footprintName. | |
FOOTPRINT_INFO & | GetItem (unsigned aIdx) const |
Get info for a footprint by index. | |
unsigned | GetErrorCount () const |
std::unique_ptr< IO_ERROR > | PopError () |
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. | |
Protected Member Functions | |
void | loadLibs () |
void | loadFootprints () |
Protected Attributes | |
FP_LIB_TABLE * | m_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 | |
Private Member Functions | |
bool | CatchErrors (const std::function< void()> &aFunc) |
Call aFunc, pushing any IO_ERRORs and std::exceptions it throws onto m_errors. | |
Private Attributes | |
SYNC_QUEUE< wxString > | m_queue_in |
SYNC_QUEUE< wxString > | m_queue_out |
long long | m_list_timestamp |
PROGRESS_REPORTER * | m_progress_reporter |
std::atomic_bool | m_cancelled |
std::mutex | m_join |
Definition at line 84 of file footprint_info_impl.h.
FOOTPRINT_LIST_IMPL::FOOTPRINT_LIST_IMPL | ( | ) |
Definition at line 307 of file footprint_info_impl.cpp.
|
inlinevirtual |
Definition at line 88 of file footprint_info_impl.h.
|
private |
Call aFunc, pushing any IO_ERRORs and std::exceptions it throws onto m_errors.
Definition at line 76 of file footprint_info_impl.cpp.
References FOOTPRINT_LIST::m_errors, SYNC_QUEUE< T >::move_push(), and THROW_IO_ERROR.
Referenced by loadFootprints(), loadLibs(), and ReadFootprintFiles().
|
overridevirtual |
Implements FOOTPRINT_LIST.
Definition at line 69 of file footprint_info_impl.cpp.
References FOOTPRINT_LIST::m_list, and m_list_timestamp.
Referenced by PCB_EDIT_FRAME::OpenProjectFiles().
|
inherited |
Definition at line 113 of file footprint_info.cpp.
References _, HTML_MESSAGE_BOX::AddHTML_Text(), EscapeHTML(), HTML_MESSAGE_BOX::MessageSet(), FOOTPRINT_LIST::PopError(), and DIALOG_SHIM::ShowModal().
Referenced by FOOTPRINT_EDIT_FRAME::initLibraryTree(), CVPCB_MAINFRAME::LoadFootprintFiles(), and PANEL_FOOTPRINT_CHOOSER::PANEL_FOOTPRINT_CHOOSER().
|
inlineinherited |
Definition at line 178 of file footprint_info.h.
Referenced by FOOTPRINT_FILTER::ITERATOR::dereference(), FOOTPRINT_FILTER::end(), FOOTPRINT_LIST::GetInstance(), FOOTPRINT_FILTER::ITERATOR::increment(), FOOTPRINT_EDIT_FRAME::initLibraryTree(), FOOTPRINT_SELECT_WIDGET::Load(), and PCB_EDIT_FRAME::OpenProjectFiles().
|
inlineinherited |
Definition at line 216 of file footprint_info.h.
Referenced by FOOTPRINT_EDIT_FRAME::initLibraryTree(), CVPCB_MAINFRAME::LoadFootprintFiles(), and PANEL_FOOTPRINT_CHOOSER::PANEL_FOOTPRINT_CHOOSER().
|
inherited |
Get info for a footprint by id.
Definition at line 59 of file footprint_info.cpp.
References FOOTPRINT_LIST::GetFootprintInfo(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), and LIB_ID::Parse().
Referenced by CVPCB_MAINFRAME::AssociateFootprint(), CVPCB_MAINFRAME::AutomaticFootprintMatching(), CVPCB_MAINFRAME::DisplayStatus(), FOOTPRINT_LIST::GetFootprintInfo(), DISPLAY_FOOTPRINTS_FRAME::InitDisplay(), PANEL_FOOTPRINT_CHOOSER::PANEL_FOOTPRINT_CHOOSER(), and CVPCB_MAINFRAME::readNetListAndFpFiles().
|
inherited |
Get info for a footprint by libNickname/footprintName.
Definition at line 43 of file footprint_info.cpp.
References FOOTPRINT_LIST::m_list.
|
staticinherited |
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 163 of file footprint_info.cpp.
References get_instance_from_id(), FOOTPRINT_LIST::GetCount(), PROJECT::GetProjectPath(), KIFACE_FOOTPRINT_LIST, KIWAY::Prj(), and FOOTPRINT_LIST::ReadCacheFromFile().
Referenced by PANEL_SYMBOL_CHOOSER::constructRightPanel(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), FOOTPRINT_SELECT_WIDGET::Load(), and FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList().
|
inlineinherited |
Get info for a footprint by index.
aIdx | index of the given item. |
Definition at line 211 of file footprint_info.h.
Referenced by FOOTPRINT_FILTER::ITERATOR::increment().
|
inlineinherited |
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().
|
inlineinherited |
Definition at line 246 of file footprint_info.h.
Referenced by FOOTPRINT_INFO_IMPL::load().
|
protected |
Definition at line 226 of file footprint_info_impl.cpp.
References PROGRESS_REPORTER::AdvanceProgress(), CatchErrors(), FP_LIB_TABLE::FootprintEnumerate(), GetKiCadThreadPool(), PROGRESS_REPORTER::KeepRefreshing(), m_cancelled, FOOTPRINT_LIST::m_lib_table, FOOTPRINT_LIST::m_list, m_progress_reporter, m_queue_out, SYNC_QUEUE< T >::move_push(), SYNC_QUEUE< T >::pop(), SYNC_QUEUE< T >::size(), and tp.
Referenced by ReadFootprintFiles().
|
protected |
Definition at line 179 of file footprint_info_impl.cpp.
References PROGRESS_REPORTER::AdvanceProgress(), CatchErrors(), GetKiCadThreadPool(), PROGRESS_REPORTER::KeepRefreshing(), m_cancelled, FOOTPRINT_LIST::m_lib_table, m_progress_reporter, m_queue_in, m_queue_out, SYNC_QUEUE< T >::pop(), FP_LIB_TABLE::PrefetchLib(), SYNC_QUEUE< T >::push(), SYNC_QUEUE< T >::size(), and tp.
Referenced by ReadFootprintFiles().
|
inlineinherited |
Definition at line 221 of file footprint_info.h.
Referenced by FOOTPRINT_LIST::DisplayErrors().
|
overridevirtual |
Reimplemented from FOOTPRINT_LIST.
Definition at line 354 of file footprint_info_impl.cpp.
References FOOTPRINT_LIST::m_list, m_list_timestamp, name, and UnescapeString().
Referenced by FOOTPRINT_EDIT_FRAME::initLibraryTree(), and PCB_EDIT_FRAME::OpenProjectFiles().
|
overridevirtual |
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. |
Implements FOOTPRINT_LIST.
Definition at line 107 of file footprint_info_impl.cpp.
References _, PROGRESS_REPORTER::AdvancePhase(), CatchErrors(), SYNC_QUEUE< T >::clear(), SYNC_QUEUE< T >::empty(), FP_LIB_TABLE::GenerateTimestamp(), LIB_TABLE::GetLogicalLibs(), loadFootprints(), loadLibs(), m_cancelled, FOOTPRINT_LIST::m_errors, FOOTPRINT_LIST::m_lib_table, FOOTPRINT_LIST::m_list, m_list_timestamp, m_progress_reporter, m_queue_in, m_queue_out, SYNC_QUEUE< T >::push(), PROGRESS_REPORTER::Report(), PROGRESS_REPORTER::SetMaxProgress(), and SYNC_QUEUE< T >::size().
Referenced by FOOTPRINT_EDIT_FRAME::initLibraryTree(), FOOTPRINT_SELECT_WIDGET::Load(), PANEL_FOOTPRINT_CHOOSER::PANEL_FOOTPRINT_CHOOSER(), and FOOTPRINT_EDIT_FRAME::SyncLibraryTree().
|
overridevirtual |
Reimplemented from FOOTPRINT_LIST.
Definition at line 315 of file footprint_info_impl.cpp.
References CTX_LINE, KIPLATFORM::IO::DuplicatePermissions(), EscapeString(), FOOTPRINT_LIST::m_list, and m_list_timestamp.
Referenced by FOOTPRINT_EDIT_FRAME::doCloseWindow(), and PCB_BASE_EDIT_FRAME::doCloseWindow().
|
private |
Definition at line 114 of file footprint_info_impl.h.
Referenced by loadFootprints(), loadLibs(), and ReadFootprintFiles().
|
protectedinherited |
some can be PARSE_ERRORs also
Definition at line 264 of file footprint_info.h.
Referenced by CatchErrors(), and ReadFootprintFiles().
|
private |
Definition at line 115 of file footprint_info_impl.h.
|
protectedinherited |
no ownership
Definition at line 261 of file footprint_info.h.
Referenced by loadFootprints(), loadLibs(), and ReadFootprintFiles().
|
protectedinherited |
Definition at line 263 of file footprint_info.h.
Referenced by Clear(), FOOTPRINT_LIST::GetFootprintInfo(), FOOTPRINT_FILTER::ITERATOR::increment(), loadFootprints(), ReadCacheFromFile(), ReadFootprintFiles(), and WriteCacheToFile().
|
private |
Definition at line 112 of file footprint_info_impl.h.
Referenced by Clear(), ReadCacheFromFile(), ReadFootprintFiles(), and WriteCacheToFile().
|
private |
Definition at line 113 of file footprint_info_impl.h.
Referenced by loadFootprints(), loadLibs(), and ReadFootprintFiles().
|
private |
Definition at line 110 of file footprint_info_impl.h.
Referenced by loadLibs(), and ReadFootprintFiles().
|
private |
Definition at line 111 of file footprint_info_impl.h.
Referenced by loadFootprints(), loadLibs(), and ReadFootprintFiles().