|
KiCad PCB EDA Suite
|
#include <footprint_info_impl.h>
Public Member Functions | |
| FOOTPRINT_LIST_IMPL () | |
| virtual | ~FOOTPRINT_LIST_IMPL () |
| bool | ReadFootprintFiles (FOOTPRINT_LIBRARY_ADAPTER *aAdapter, const wxString *aNickname=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr) override |
| Read all the footprints provided by the combination of aTable and aNickname. | |
| void | Clear () override |
| void | WithFootprintsForLibrary (const wxString &aLibName, const std::function< void(const std::vector< LIB_TREE_ITEM * > &)> &aCallback) |
| Execute a callback with thread-safe access to the footprints for a library. | |
| 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 | PushError (std::unique_ptr< IO_ERROR > aError) |
| void | DisplayErrors (wxTopLevelWindow *aCaller=nullptr) |
| wxString | GetErrorMessages () |
| Returns all accumulated errors as a newline-separated string for display in the status bar. | |
| FOOTPRINT_LIBRARY_ADAPTER * | GetAdapter () const |
Protected Member Functions | |
| void | loadFootprints () |
Protected Attributes | |
| FOOTPRINT_LIBRARY_ADAPTER * | m_adapter |
| 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 |
| long long | m_list_timestamp |
| PROGRESS_REPORTER * | m_progress_reporter |
| std::atomic_bool | m_cancelled |
| std::mutex | m_join |
| std::mutex | m_loadInProgress |
Definition at line 84 of file footprint_info_impl.h.
| FOOTPRINT_LIST_IMPL::FOOTPRINT_LIST_IMPL | ( | ) |
Definition at line 294 of file footprint_info_impl.cpp.
References m_cancelled, m_list_timestamp, and m_progress_reporter.
|
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 114 of file footprint_info_impl.cpp.
References FOOTPRINT_LIST::m_errors, and THROW_IO_ERROR.
Referenced by loadFootprints(), and ReadFootprintFiles().
|
overridevirtual |
Implements FOOTPRINT_LIST.
Definition at line 72 of file footprint_info_impl.cpp.
References FOOTPRINT_LIST::m_list, m_list_timestamp, and m_loadInProgress.
|
inherited |
Definition at line 109 of file footprint_info.cpp.
References _, HTML_MESSAGE_BOX::AddHTML_Text(), EscapeHTML(), HTML_MESSAGE_BOX::MessageSet(), PopError(), and DIALOG_SHIM::ShowModal().
Referenced by ReadFootprintFiles().
|
inlineinherited |
Definition at line 254 of file footprint_info.h.
References m_adapter.
|
inlineinherited |
Definition at line 175 of file footprint_info.h.
References m_list.
|
inlineinherited |
Definition at line 213 of file footprint_info.h.
References m_errors.
|
inherited |
Returns all accumulated errors as a newline-separated string for display in the status bar.
This consumes the errors (pops them from the queue).
Definition at line 136 of file footprint_info.cpp.
References PopError().
Referenced by ReadFootprintFiles().
|
inherited |
Get info for a footprint by id.
Definition at line 53 of file footprint_info.cpp.
References GetFootprintInfo(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), and LIB_ID::Parse().
Referenced by Clear(), GetFootprintInfo(), and DISPLAY_FOOTPRINTS_FRAME::InitDisplay().
|
inherited |
Get info for a footprint by libNickname/footprintName.
Definition at line 37 of file footprint_info.cpp.
References m_list.
|
inlineinherited |
Get info for a footprint by index.
| aIdx | index of the given item. |
Definition at line 208 of file footprint_info.h.
References m_list.
|
inlineinherited |
Was forced to add this by modview_frame.cpp.
Definition at line 181 of file footprint_info.h.
References m_list.
Referenced by FOOTPRINT_LIST_IMPL::WithFootprintsForLibrary().
|
protected |
Definition at line 213 of file footprint_info_impl.cpp.
References CatchErrors(), GetKiCadThreadPool(), FOOTPRINT_LIST::m_adapter, m_cancelled, FOOTPRINT_LIST::m_list, m_progress_reporter, m_queue, SYNC_QUEUE< T >::move_push(), SYNC_QUEUE< T >::pop(), and tp.
Referenced by ReadFootprintFiles().
|
inlineinherited |
Definition at line 218 of file footprint_info.h.
References m_errors.
Referenced by DisplayErrors(), and GetErrorMessages().
|
inlineinherited |
Definition at line 226 of file footprint_info.h.
References m_errors.
|
overridevirtual |
Read all the footprints provided by the combination of aTable and aNickname.
| aAdapter | is used to access 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 145 of file footprint_info_impl.cpp.
References _, CatchErrors(), FOOTPRINT_LIBRARY_ADAPTER::GenerateTimestamp(), LIBRARY_MANAGER_ADAPTER::GetLibraryNames(), loadFootprints(), FOOTPRINT_LIST::m_adapter, m_cancelled, FOOTPRINT_LIST::m_errors, FOOTPRINT_LIST::m_list, m_list_timestamp, m_loadInProgress, m_progress_reporter, and m_queue.
| void FOOTPRINT_LIST_IMPL::WithFootprintsForLibrary | ( | const wxString & | aLibName, |
| const std::function< void(const std::vector< LIB_TREE_ITEM * > &)> & | aCallback ) |
Execute a callback with thread-safe access to the footprints for a library.
The callback receives a vector of pointers to footprint info objects. These pointers are only valid for the duration of the callback. The internal mutex is held while the callback executes, preventing modification of the underlying list.
| aLibName | the library nickname to get footprints for |
| aCallback | function to call with the footprints vector |
Definition at line 81 of file footprint_info_impl.cpp.
References dummy, FOOTPRINT_LIST::GetList(), and m_loadInProgress.
|
protectedinherited |
no ownership
Definition at line 257 of file footprint_info.h.
Referenced by FOOTPRINT_LIST(), GetAdapter(), FOOTPRINT_LIST_IMPL::loadFootprints(), and FOOTPRINT_LIST_IMPL::ReadFootprintFiles().
|
private |
Definition at line 122 of file footprint_info_impl.h.
Referenced by FOOTPRINT_LIST_IMPL(), loadFootprints(), and ReadFootprintFiles().
|
protectedinherited |
some can be PARSE_ERRORs also
Definition at line 260 of file footprint_info.h.
Referenced by FOOTPRINT_LIST_IMPL::CatchErrors(), GetErrorCount(), PopError(), PushError(), and FOOTPRINT_LIST_IMPL::ReadFootprintFiles().
|
private |
Definition at line 123 of file footprint_info_impl.h.
|
protectedinherited |
Definition at line 259 of file footprint_info.h.
Referenced by FOOTPRINT_LIST_IMPL::Clear(), GetCount(), GetFootprintInfo(), GetItem(), GetList(), FOOTPRINT_LIST_IMPL::loadFootprints(), and FOOTPRINT_LIST_IMPL::ReadFootprintFiles().
|
private |
Definition at line 120 of file footprint_info_impl.h.
Referenced by Clear(), FOOTPRINT_LIST_IMPL(), and ReadFootprintFiles().
|
private |
Definition at line 124 of file footprint_info_impl.h.
Referenced by Clear(), ReadFootprintFiles(), and WithFootprintsForLibrary().
|
private |
Definition at line 121 of file footprint_info_impl.h.
Referenced by FOOTPRINT_LIST_IMPL(), loadFootprints(), and ReadFootprintFiles().
|
private |
Definition at line 119 of file footprint_info_impl.h.
Referenced by loadFootprints(), and ReadFootprintFiles().