|
KiCad PCB EDA Suite
|
An interface to the global shared library manager that is schematic-specific and linked to one project in particular. More...
#include <footprint_library_adapter.h>
Public Types | |
| enum | SAVE_T { SAVE_OK , SAVE_SKIPPED } |
| The set of return values from SaveSymbol() below. More... | |
Public Member Functions | |
| FOOTPRINT_LIBRARY_ADAPTER (LIBRARY_MANAGER &aManager) | |
| LIBRARY_TABLE_TYPE | Type () const override |
| The type of library table this adapter works with. | |
| std::optional< LIB_STATUS > | LoadOne (LIB_DATA *aLib) override |
| Loads or reloads the given library, if it exists. | |
| std::optional< LIB_STATUS > | LoadOne (const wxString &aNickname) |
| Loads or reloads the given library, if it exists. | |
| std::vector< FOOTPRINT * > | GetFootprints (const wxString &aNickname, bool aBestEfforts=false) |
| Retrieves a list of footprints contained in a given loaded library. | |
| std::vector< wxString > | GetFootprintNames (const wxString &aNickname, bool aBestEfforts=false) |
| Retrieves a list of footprint names contained in a given loaded library. | |
| long long | GenerateTimestamp (const wxString *aNickname) |
| Generates a filesystem timestamp / hash value for library(ies) | |
| bool | FootprintExists (const wxString &aNickname, const wxString &aName) |
| FOOTPRINT * | LoadFootprint (const wxString &aNickname, const wxString &aName, bool aKeepUUID) |
| Load a FOOTPRINT having aName from the library given by aNickname. | |
| FOOTPRINT * | LoadFootprint (const LIB_ID &aLibId, bool aKeepUUID) |
| FOOTPRINT * | LoadFootprintWithOptionalNickname (const LIB_ID &aFootprintId, bool aKeepUUID) |
| Load a footprint having aFootprintId with possibly an empty nickname. | |
| SAVE_T | SaveFootprint (const wxString &aNickname, const FOOTPRINT *aFootprint, bool aOverwrite=true) |
| Write aFootprint to an existing library given by aNickname. | |
| void | DeleteFootprint (const wxString &aNickname, const wxString &aFootprintName) |
| Deletes the aFootprintName from the library given by aNickname. | |
| bool | IsFootprintLibWritable (const wxString &aNickname) |
| Return true if the library given by aNickname is writable. | |
| LIBRARY_MANAGER & | Manager () const |
| LIBRARY_TABLE * | GlobalTable () const |
| Retrieves the global library table for this adapter type. | |
| std::optional< LIBRARY_TABLE * > | ProjectTable () const |
| Retrieves the project library table for this adapter type, or nullopt if one doesn't exist. | |
| std::optional< wxString > | FindLibraryByURI (const wxString &aURI) const |
| std::vector< wxString > | GetLibraryNames () const |
| Returns a list of library nicknames that are available (skips any that failed to load) | |
| bool | HasLibrary (const wxString &aNickname, bool aCheckEnabled=false) const |
| Test for the existence of aNickname in the library tables. | |
| bool | DeleteLibrary (const wxString &aNickname) |
| Deletes the given library from disk if it exists; returns true if deleted. | |
| std::optional< wxString > | GetLibraryDescription (const wxString &aNickname) const |
| std::vector< LIBRARY_TABLE_ROW * > | Rows (LIBRARY_TABLE_SCOPE aScope=LIBRARY_TABLE_SCOPE::BOTH, bool aIncludeInvalid=false) const |
| Like LIBRARY_MANAGER::Rows but filtered to the LIBRARY_TABLE_TYPE of this adapter. | |
| std::optional< LIBRARY_TABLE_ROW * > | GetRow (const wxString &aNickname, LIBRARY_TABLE_SCOPE aScope=LIBRARY_TABLE_SCOPE::BOTH) const |
| Like LIBRARY_MANAGER::GetRow but filtered to the LIBRARY_TABLE_TYPE of this adapter. | |
| std::optional< LIBRARY_TABLE_ROW * > | FindRowByURI (const wxString &aUri, LIBRARY_TABLE_SCOPE aScope=LIBRARY_TABLE_SCOPE::BOTH) const |
| Like LIBRARY_MANAGER::FindRowByURI but filtered to the LIBRARY_TABLE_TYPE of this adapter. | |
| virtual void | ProjectChanged () |
| Notify the adapter that the active project has changed. | |
| void | GlobalTablesChanged (std::initializer_list< LIBRARY_TABLE_TYPE > aChangedTables={}) |
| Notify the adapter that the global library tables have changed. | |
| void | CheckTableRow (LIBRARY_TABLE_ROW &aRow) |
| void | AsyncLoad () |
| Loads all available libraries for this adapter type in the background. | |
| std::optional< float > | AsyncLoadProgress () const |
| Returns async load progress between 0.0 and 1.0, or nullopt if load is not in progress. | |
| void | BlockUntilLoaded () |
| void | AbortAsyncLoad () |
| Aborts any async load in progress; blocks until fully done aborting. | |
| bool | IsLibraryLoaded (const wxString &aNickname) |
| std::optional< LIB_STATUS > | GetLibraryStatus (const wxString &aNickname) const |
| Returns the status of a loaded library, or nullopt if the library hasn't been loaded (yet) | |
| std::vector< std::pair< wxString, LIB_STATUS > > | GetLibraryStatuses () const |
| Returns a list of all library nicknames and their status (even if they failed to load) | |
| wxString | GetLibraryLoadErrors () const |
| Returns all library load errors as newline-separated strings for display. | |
| void | ReloadLibraryEntry (const wxString &aNickname, LIBRARY_TABLE_SCOPE aScope=LIBRARY_TABLE_SCOPE::BOTH) |
| virtual bool | IsWritable (const wxString &aNickname) const |
| Return true if the given nickname exists and is not a read-only library. | |
| bool | CreateLibrary (const wxString &aNickname) |
| Creates the library (i.e. saves to disk) for the given row if it exists. | |
| virtual bool | SupportsConfigurationDialog (const wxString &aNickname) const |
| virtual void | ShowConfigurationDialog (const wxString &aNickname, wxWindow *aParent) const |
| virtual std::optional< LIBRARY_ERROR > | LibraryError (const wxString &aNickname) const |
Static Public Member Functions | |
| static wxString | GlobalPathEnvVariableName () |
Protected Member Functions | |
| std::map< wxString, LIB_DATA > & | globalLibs () override |
| std::map< wxString, LIB_DATA > & | globalLibs () const override |
| std::shared_mutex & | globalLibsMutex () override |
| std::shared_mutex & | globalLibsMutex () const override |
| void | enumerateLibrary (LIB_DATA *aLib) override |
| Override in derived class to perform library-specific enumeration. | |
| LIBRARY_RESULT< IO_BASE * > | createPlugin (const LIBRARY_TABLE_ROW *row) override |
| Creates a concrete plugin for the given row. | |
| IO_BASE * | plugin (const LIB_DATA *aRow) override |
| std::optional< const LIB_DATA * > | fetchIfLoaded (const wxString &aNickname) const |
| std::optional< LIB_DATA * > | fetchIfLoaded (const wxString &aNickname) |
| LIBRARY_RESULT< LIB_DATA * > | loadIfNeeded (const wxString &aNickname) |
| Fetches a loaded library, triggering a load of that library if it isn't loaded yet. | |
| LIBRARY_RESULT< LIB_DATA * > | loadFromScope (const wxString &aNickname, LIBRARY_TABLE_SCOPE aScope, std::map< wxString, LIB_DATA > &aTarget, std::shared_mutex &aMutex) |
| void | abortLoad () |
| Aborts any async load in progress; blocks until fully done aborting. | |
Static Protected Member Functions | |
| static wxString | getUri (const LIBRARY_TABLE_ROW *aRow) |
Protected Attributes | |
| LIBRARY_MANAGER & | m_manager |
| std::map< wxString, LIB_DATA > | m_libraries |
| std::shared_mutex | m_librariesMutex |
| std::atomic_bool | m_abort |
| std::vector< std::future< void > > | m_futures |
| std::atomic< size_t > | m_loadCount { 0 } |
| std::atomic< size_t > | m_loadTotal { 0 } |
| std::mutex | m_loadMutex |
Static Private Member Functions | |
| static PCB_IO * | pcbplugin (const LIB_DATA *aRow) |
Static Private Attributes | |
| static LEAK_AT_EXIT< std::map< wxString, LIB_DATA > > | GlobalLibraries |
| static std::shared_mutex | GlobalLibraryMutex |
| static LEAK_AT_EXIT< std::map< wxString, std::vector< std::unique_ptr< FOOTPRINT > > > > | PreloadedFootprints |
| Storage for preloaded footprints, indexed by library nickname. | |
| static std::shared_mutex | PreloadedFootprintsMutex |
An interface to the global shared library manager that is schematic-specific and linked to one project in particular.
This is what can return actual concrete schematic library content (symbols).
Definition at line 39 of file footprint_library_adapter.h.
The set of return values from SaveSymbol() below.
| Enumerator | |
|---|---|
| SAVE_OK | |
| SAVE_SKIPPED | |
Definition at line 120 of file footprint_library_adapter.h.
| FOOTPRINT_LIBRARY_ADAPTER::FOOTPRINT_LIBRARY_ADAPTER | ( | LIBRARY_MANAGER & | aManager | ) |
Definition at line 46 of file footprint_library_adapter.cpp.
References LIBRARY_MANAGER_ADAPTER::LIBRARY_MANAGER_ADAPTER().
|
inherited |
Aborts any async load in progress; blocks until fully done aborting.
This is the public interface to allow LIBRARY_MANAGER to abort loads before project changes.
Definition at line 814 of file library_manager.cpp.
References abortLoad().
Referenced by LoadOne().
|
protectedinherited |
Aborts any async load in progress; blocks until fully done aborting.
Definition at line 989 of file library_manager.cpp.
References BlockUntilLoaded(), m_abort, m_futures, m_loadCount, m_loadMutex, m_loadTotal, and traceLibraries.
Referenced by AbortAsyncLoad(), CheckTableRow(), enumerateLibrary(), GlobalTablesChanged(), and ProjectChanged().
|
inherited |
Loads all available libraries for this adapter type in the background.
Definition at line 1360 of file library_manager.cpp.
References GetKiCadThreadPool(), globalLibs(), globalLibsMutex(), LOADED, LOADING, m_futures, m_libraries, m_librariesMutex, m_loadCount, m_loadMutex, m_loadTotal, m_manager, tp, traceLibraries, and Type().
Referenced by BOOST_AUTO_TEST_CASE(), filterFootprints(), EESCHEMA_JOBS_HANDLER::JobSchErc(), PANEL_FOOTPRINT_CHOOSER::PANEL_FOOTPRINT_CHOOSER(), PGM_BASE::PreloadDesignBlockLibraries(), PCB::IFACE::PreloadLibraries(), and SCH::IFACE::PreloadLibraries().
|
inherited |
Returns async load progress between 0.0 and 1.0, or nullopt if load is not in progress.
Definition at line 1014 of file library_manager.cpp.
References m_loadCount, and m_loadTotal.
Referenced by BOOST_AUTO_TEST_CASE(), LoadOne(), PGM_BASE::PreloadDesignBlockLibraries(), PCB::IFACE::PreloadLibraries(), and SCH::IFACE::PreloadLibraries().
|
inherited |
Definition at line 1026 of file library_manager.cpp.
References m_futures, m_loadCount, m_loadMutex, m_loadTotal, and traceLibraries.
Referenced by abortLoad(), BOOST_AUTO_TEST_CASE(), filterFootprints(), EESCHEMA_JOBS_HANDLER::JobSchErc(), LoadOne(), PANEL_FOOTPRINT_CHOOSER::PANEL_FOOTPRINT_CHOOSER(), PGM_BASE::PreloadDesignBlockLibraries(), PCB::IFACE::PreloadLibraries(), and SCH::IFACE::PreloadLibraries().
|
inherited |
Definition at line 845 of file library_manager.cpp.
References abortLoad(), createPlugin(), LOADED, LoadOne(), LIB_DATA::plugin, plugin(), LIB_DATA::row, LIBRARY_TABLE_ROW::SetErrorDescription(), and LIBRARY_TABLE_ROW::SetOk().
|
inherited |
Creates the library (i.e. saves to disk) for the given row if it exists.
Definition at line 1190 of file library_manager.cpp.
References IO_BASE::CreateLibrary(), LIBRARY_TABLE_ROW::GetOptionsMap(), getUri(), loadIfNeeded(), LIB_DATA::plugin, result, and LIB_DATA::row.
Referenced by SYMBOL_LIBRARY_MANAGER::addLibrary(), and LoadOne().
|
overrideprotectedvirtual |
Creates a concrete plugin for the given row.
Implements LIBRARY_MANAGER_ADAPTER.
Definition at line 414 of file footprint_library_adapter.cpp.
References _, PCB_IO_MGR::EnumFromStr(), PCB_IO_MGR::FindPlugin(), PCB_IO_MGR::NESTED_TABLE, LIBRARY_TABLE_ROW::Nickname(), PCB_IO_MGR::PCB_FILE_UNKNOWN, plugin(), LIBRARY_TABLE_ROW::Scope(), traceLibraries, LIBRARY_TABLE_ROW::Type(), and LIBRARY_TABLE_ROW::URI().
| void FOOTPRINT_LIBRARY_ADAPTER::DeleteFootprint | ( | const wxString & | aNickname, |
| const wxString & | aFootprintName ) |
Deletes the aFootprintName from the library given by aNickname.
| aNickname | is a locator for the "library", it is a "name" in LIB_TABLE_ROW. |
| aFootprintName | is the name of a footprint to delete from the specified library. |
| IO_ERROR | if there is a problem finding the footprint or the library, or deleting it. |
Definition at line 373 of file footprint_library_adapter.cpp.
References LIBRARY_MANAGER_ADAPTER::fetchIfLoaded(), PCB_IO::FootprintDelete(), LIBRARY_MANAGER_ADAPTER::getUri(), pcbplugin(), traceLibraries, and IO_ERROR::What().
Referenced by FOOTPRINT_EDIT_FRAME::DeleteFootprintFromLibrary().
|
inherited |
Deletes the given library from disk if it exists; returns true if deleted.
Definition at line 937 of file library_manager.cpp.
References IO_BASE::DeleteLibrary(), LIBRARY_TABLE_ROW::GetOptionsMap(), getUri(), loadIfNeeded(), LIB_DATA::plugin, result, and LIB_DATA::row.
Referenced by Type().
|
overrideprotectedvirtual |
Override in derived class to perform library-specific enumeration.
Implements LIBRARY_MANAGER_ADAPTER.
Definition at line 58 of file footprint_library_adapter.cpp.
References FOOTPRINT::Duplicate(), FOOTPRINT::GetFPID(), LIBRARY_TABLE_ROW::GetOptionsMap(), LIBRARY_MANAGER_ADAPTER::getUri(), IGNORE_PARENT_GROUP, LIBRARY_TABLE_ROW::Nickname(), pcbplugin(), plugin(), PreloadedFootprints, PreloadedFootprintsMutex, LIB_DATA::row, FOOTPRINT::SetFPID(), LIB_ID::SetLibNickname(), EDA_ITEM::SetParent(), traceLibraries, and IO_ERROR::What().
|
protectedinherited |
Definition at line 1248 of file library_manager.cpp.
References find, globalLibs(), globalLibsMutex(), LOADED, m_libraries, and m_librariesMutex.
|
protectedinherited |
Definition at line 1218 of file library_manager.cpp.
References find, globalLibs(), globalLibsMutex(), LOADED, m_libraries, and m_librariesMutex.
Referenced by DESIGN_BLOCK_LIBRARY_ADAPTER::DeleteDesignBlock(), FOOTPRINT_LIBRARY_ADAPTER::DeleteFootprint(), DESIGN_BLOCK_LIBRARY_ADAPTER::DesignBlockExists(), enumerateLibrary(), FOOTPRINT_LIBRARY_ADAPTER::FootprintExists(), FOOTPRINT_LIBRARY_ADAPTER::GenerateTimestamp(), SYMBOL_LIBRARY_ADAPTER::GetAvailableExtraFields(), DESIGN_BLOCK_LIBRARY_ADAPTER::GetDesignBlockNames(), DESIGN_BLOCK_LIBRARY_ADAPTER::GetDesignBlocks(), DESIGN_BLOCK_LIBRARY_ADAPTER::GetEnumeratedDesignBlock(), FOOTPRINT_LIBRARY_ADAPTER::GetFootprintNames(), GetLibraryDescription(), GetLibraryNames(), SYMBOL_LIBRARY_ADAPTER::GetModifyHash(), SYMBOL_LIBRARY_ADAPTER::GetSubLibraries(), SYMBOL_LIBRARY_ADAPTER::GetSymbolNames(), SYMBOL_LIBRARY_ADAPTER::GetSymbols(), HasLibrary(), DESIGN_BLOCK_LIBRARY_ADAPTER::IsDesignBlockLibWritable(), IsWritable(), DESIGN_BLOCK_LIBRARY_ADAPTER::LoadDesignBlock(), FOOTPRINT_LIBRARY_ADAPTER::LoadFootprint(), SYMBOL_LIBRARY_ADAPTER::LoadSymbol(), DESIGN_BLOCK_LIBRARY_ADAPTER::SaveDesignBlock(), FOOTPRINT_LIBRARY_ADAPTER::SaveFootprint(), SYMBOL_LIBRARY_ADAPTER::ShowConfigurationDialog(), SYMBOL_LIBRARY_ADAPTER::SupportsConfigurationDialog(), and SYMBOL_LIBRARY_ADAPTER::SupportsSubLibraries().
|
inherited |
Definition at line 894 of file library_manager.cpp.
References m_manager, Type(), and LIBRARY_MANAGER::UrisAreEquivalent().
Referenced by Type().
|
inherited |
Like LIBRARY_MANAGER::FindRowByURI but filtered to the LIBRARY_TABLE_TYPE of this adapter.
Definition at line 981 of file library_manager.cpp.
References m_manager, and Type().
Referenced by FOOTPRINT_EDIT_FRAME::KiwayMailIn(), SYMBOL_EDIT_FRAME::KiwayMailIn(), and Type().
| bool FOOTPRINT_LIBRARY_ADAPTER::FootprintExists | ( | const wxString & | aNickname, |
| const wxString & | aName ) |
Definition at line 233 of file footprint_library_adapter.cpp.
References LIBRARY_MANAGER_ADAPTER::fetchIfLoaded(), PCB_IO::FootprintExists(), LIBRARY_TABLE_ROW::GetOptionsMap(), LIBRARY_MANAGER_ADAPTER::getUri(), pcbplugin(), and LIB_DATA::row.
Referenced by DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::checkFootprintName(), PCB_BASE_FRAME::CreateNewFootprint(), FOOTPRINT_EDIT_FRAME::DuplicateFootprint(), DISPLAY_FOOTPRINTS_FRAME::GetFootprint(), CV::kiface(), and FOOTPRINT_EDIT_FRAME::SaveFootprintAs().
| long long FOOTPRINT_LIBRARY_ADAPTER::GenerateTimestamp | ( | const wxString * | aNickname | ) |
Generates a filesystem timestamp / hash value for library(ies)
| aNickname | is an optional specific library to timestamp. If nullptr, a timestamp will be calculated for all libraries in the table. |
Definition at line 201 of file footprint_library_adapter.cpp.
References LIBRARY_MANAGER_ADAPTER::fetchIfLoaded(), LIBRARY_MANAGER::GetFullURI(), LIBRARY_MANAGER_ADAPTER::GetLibraryNames(), LIBRARY_MANAGER_ADAPTER::HasLibrary(), and plugin().
Referenced by FOOTPRINT_LIST_IMPL::ReadFootprintFiles().
| std::vector< wxString > FOOTPRINT_LIBRARY_ADAPTER::GetFootprintNames | ( | const wxString & | aNickname, |
| bool | aBestEfforts = false ) |
Retrieves a list of footprint names contained in a given loaded library.
| aNickname | is the library to query |
| aBestEfforts | if true, don't throw on errors, just return a smaller or empty list. |
Definition at line 173 of file footprint_library_adapter.cpp.
References LIBRARY_MANAGER_ADAPTER::fetchIfLoaded(), PCB_IO::FootprintEnumerate(), LIBRARY_TABLE_ROW::GetOptionsMap(), LIBRARY_MANAGER_ADAPTER::getUri(), name, LIBRARY_TABLE_ROW::Nickname(), pcbplugin(), LIB_DATA::row, traceLibraries, and IO_ERROR::What().
Referenced by PCB_BASE_FRAME::CreateNewFootprint(), GetFootprints(), and guessNickname().
| std::vector< FOOTPRINT * > FOOTPRINT_LIBRARY_ADAPTER::GetFootprints | ( | const wxString & | aNickname, |
| bool | aBestEfforts = false ) |
Retrieves a list of footprints contained in a given loaded library.
| aNickname | is the library to query |
| aBestEfforts | if true, don't throw on errors, just return a smaller or empty list. |
Definition at line 153 of file footprint_library_adapter.cpp.
References PreloadedFootprints, and PreloadedFootprintsMutex.
Referenced by filterFootprints(), and FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList().
|
inherited |
Definition at line 958 of file library_manager.cpp.
References fetchIfLoaded().
Referenced by PCB_BASE_FRAME::GetLibraryItemsForListDialog(), SCH_BASE_FRAME::GetLibraryItemsForListDialog(), and Type().
|
inherited |
Returns all library load errors as newline-separated strings for display.
Definition at line 1105 of file library_manager.cpp.
References _, GetLibraryStatuses(), and LOAD_ERROR.
Referenced by PCB_EDIT_FRAME::KiwayMailIn(), SCH_EDIT_FRAME::KiwayMailIn(), LoadOne(), PCB::IFACE::PreloadLibraries(), and SCH::IFACE::PreloadLibraries().
|
inherited |
Returns a list of library nicknames that are available (skips any that failed to load)
Definition at line 906 of file library_manager.cpp.
References fetchIfLoaded(), m_manager, traceLibraries, and Type().
Referenced by CVPCB_MAINFRAME::BuildLibrariesList(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), DESIGN_BLOCK_LIBRARY_ADAPTER::DesignBlockLoadWithOptionalNickname(), filterFootprints(), FOOTPRINT_LIBRARY_ADAPTER::GenerateTimestamp(), GetFootprintLibraries(), SYMBOL_LIBRARY_MANAGER::GetLibraryCount(), PCB_BASE_FRAME::GetLibraryItemsForListDialog(), SCH_BASE_FRAME::GetLibraryItemsForListDialog(), guessNickname(), FOOTPRINT_LIBRARY_ADAPTER::LoadFootprintWithOptionalNickname(), FOOTPRINT_VIEWER_FRAME::OnActivate(), DIALOG_EDIT_SYMBOLS_LIBID::onClickOrphansButton(), SCH_EDIT_FRAME::OpenProjectFiles(), FOOTPRINT_LIST_IMPL::ReadFootprintFiles(), SYMBOL_VIEWER_FRAME::ReCreateLibList(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), SAVE_AS_DIALOG::SAVE_AS_DIALOG(), and Type().
|
inherited |
Returns the status of a loaded library, or nullopt if the library hasn't been loaded (yet)
Definition at line 1340 of file library_manager.cpp.
References find, globalLibs(), globalLibsMutex(), m_libraries, and m_librariesMutex.
Referenced by GetLibraryStatuses(), CV::kiface(), LoadOne(), and SCH_EDIT_FRAME::OpenProjectFiles().
|
inherited |
Returns a list of all library nicknames and their status (even if they failed to load)
Definition at line 1081 of file library_manager.cpp.
References _, GetLibraryStatus(), LOAD_ERROR, m_manager, result, and Type().
Referenced by BOOST_AUTO_TEST_CASE(), GetLibraryLoadErrors(), LoadOne(), and SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync().
|
inherited |
Like LIBRARY_MANAGER::GetRow but filtered to the LIBRARY_TABLE_TYPE of this adapter.
Definition at line 974 of file library_manager.cpp.
References m_manager, and Type().
Referenced by EXPORTER_STEP::buildFootprint3DShapes(), SYMBOL_VIEWER_FRAME::DisplayLibInfos(), CVPCB_MAINFRAME::DisplayStatus(), SCH_EDITOR_CONTROL::ExportSymbolsToLibrary(), EXPORTER_PCB_VRML::ExportVrmlFootprint(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue(), idf_export_footprint(), SYMBOL_EDIT_FRAME::IsSymbolFromLegacyLibrary(), SYMBOL_EDIT_FRAME::KiwayMailIn(), SYMBOL_VIEWER_FRAME::KiwayMailIn(), RENDER_3D_RAYTRACE_BASE::load3DModels(), RENDER_3D_OPENGL::load3dModels(), SCH_EDIT_FRAME::LoadSheetFromFile(), PANEL_FP_PROPERTIES_3D_MODEL::OnAdd3DModel(), PANEL_SYMBOL_CHOOSER::PANEL_SYMBOL_CHOOSER(), SYMBOL_VIEWER_FRAME::ReCreateLibList(), SYMBOL_EDIT_FRAME::replaceLibTableEntry(), DRC_TEST_PROVIDER_LIBRARY_PARITY::Run(), SYMBOL_EDIT_FRAME::saveLibrary(), PCB_BASE_FRAME::setFPWatcher(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync(), DIALOG_FOOTPRINT_ASSOCIATIONS::TransferDataToWindow(), Type(), and PANEL_FP_PROPERTIES_3D_MODEL::validateModelExists().
|
staticprotectedinherited |
Definition at line 1212 of file library_manager.cpp.
References LIBRARY_MANAGER::ExpandURI(), GetSettingsManager(), Pgm(), Prj(), and LIBRARY_TABLE_ROW::URI().
Referenced by CreateLibrary(), DESIGN_BLOCK_LIBRARY_ADAPTER::DeleteDesignBlock(), FOOTPRINT_LIBRARY_ADAPTER::DeleteFootprint(), DeleteLibrary(), DESIGN_BLOCK_LIBRARY_ADAPTER::DesignBlockExists(), DESIGN_BLOCK_LIBRARY_ADAPTER::enumerateLibrary(), FOOTPRINT_LIBRARY_ADAPTER::enumerateLibrary(), enumerateLibrary(), SYMBOL_LIBRARY_ADAPTER::enumerateLibrary(), FOOTPRINT_LIBRARY_ADAPTER::FootprintExists(), DESIGN_BLOCK_LIBRARY_ADAPTER::GetDesignBlockNames(), DESIGN_BLOCK_LIBRARY_ADAPTER::GetDesignBlocks(), DESIGN_BLOCK_LIBRARY_ADAPTER::GetEnumeratedDesignBlock(), FOOTPRINT_LIBRARY_ADAPTER::GetFootprintNames(), SYMBOL_LIBRARY_ADAPTER::GetSymbolNames(), SYMBOL_LIBRARY_ADAPTER::GetSymbols(), DESIGN_BLOCK_LIBRARY_ADAPTER::IsDesignBlockLibWritable(), FOOTPRINT_LIBRARY_ADAPTER::IsFootprintLibWritable(), SYMBOL_LIBRARY_ADAPTER::IsSymbolLibWritable(), IsWritable(), DESIGN_BLOCK_LIBRARY_ADAPTER::LoadDesignBlock(), FOOTPRINT_LIBRARY_ADAPTER::LoadFootprint(), DESIGN_BLOCK_LIBRARY_ADAPTER::LoadOne(), FOOTPRINT_LIBRARY_ADAPTER::LoadOne(), SYMBOL_LIBRARY_ADAPTER::LoadOne(), SYMBOL_LIBRARY_ADAPTER::LoadSymbol(), DESIGN_BLOCK_LIBRARY_ADAPTER::SaveDesignBlock(), FOOTPRINT_LIBRARY_ADAPTER::SaveFootprint(), and SYMBOL_LIBRARY_ADAPTER::SaveSymbol().
|
inlineoverrideprotectedvirtual |
Implements LIBRARY_MANAGER_ADAPTER.
Definition at line 167 of file footprint_library_adapter.h.
References GlobalLibraries.
|
inlineoverrideprotectedvirtual |
Implements LIBRARY_MANAGER_ADAPTER.
Definition at line 166 of file footprint_library_adapter.h.
References GlobalLibraries.
|
inlineoverrideprotectedvirtual |
Implements LIBRARY_MANAGER_ADAPTER.
Definition at line 169 of file footprint_library_adapter.h.
References GlobalLibraryMutex.
|
inlineoverrideprotectedvirtual |
Implements LIBRARY_MANAGER_ADAPTER.
Definition at line 168 of file footprint_library_adapter.h.
References GlobalLibraryMutex.
|
static |
Definition at line 52 of file footprint_library_adapter.cpp.
References ENV_VAR::GetVersionedEnvVarName().
Referenced by DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES().
|
inherited |
|
inherited |
Notify the adapter that the global library tables have changed.
Definition at line 820 of file library_manager.cpp.
References abortLoad(), globalLibs(), globalLibsMutex(), and Type().
Referenced by Type().
|
inherited |
Test for the existence of aNickname in the library tables.
| aCheckEnabled | if true will only return true for enabled libraries |
Definition at line 927 of file library_manager.cpp.
References fetchIfLoaded().
Referenced by SYMBOL_EDIT_FRAME::AddLibraryFile(), SYMBOL_EDIT_FRAME::addLibTableEntry(), SYMBOL_VIEWER_FRAME::ClickOnLibList(), SYMBOL_EDIT_FRAME::DdAddLibrary(), BOARD_INSPECTION_TOOL::DiffFootprint(), SCH_INSPECTION_TOOL::DiffSymbol(), FOOTPRINT_LIBRARY_ADAPTER::GenerateTimestamp(), DISPLAY_FOOTPRINTS_FRAME::GetFootprint(), CV::kiface(), FOOTPRINT_EDIT_FRAME::KiwayMailIn(), SYMBOL_EDIT_FRAME::KiwayMailIn(), SYMBOL_LIBRARY_MANAGER::LibraryExists(), SCH_EDIT_FRAME::LoadSheetFromFile(), PANEL_SYMBOL_CHOOSER::PANEL_SYMBOL_CHOOSER(), DRC_TEST_PROVIDER_LIBRARY_PARITY::Run(), SYMBOL_EDIT_FRAME::saveLibrary(), SCH_BASE_FRAME::SelectLibrary(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync(), Type(), and SCH_SCREEN::UpdateSymbolLinks().
| bool FOOTPRINT_LIBRARY_ADAPTER::IsFootprintLibWritable | ( | const wxString & | aNickname | ) |
Return true if the library given by aNickname is writable.
It is possible that some footprint libraries are read only because of where they are installed.
| aNickname | is the library nickname in the footprint library table. |
| IO_ERROR | if no library at aNickname exists. |
Definition at line 394 of file footprint_library_adapter.cpp.
References LIBRARY_MANAGER_ADAPTER::getUri(), GlobalLibraries, GlobalLibraryMutex, LIBRARY_MANAGER_ADAPTER::m_libraries, and LIBRARY_MANAGER_ADAPTER::m_librariesMutex.
Referenced by FOOTPRINT_EDIT_FRAME::DeleteFootprintFromLibrary(), and FOOTPRINT_EDIT_FRAME::UpdateTitle().
|
inherited |
Definition at line 1041 of file library_manager.cpp.
References find, globalLibs(), globalLibsMutex(), LOADED, m_libraries, and m_librariesMutex.
Referenced by SYMBOL_LIBRARY_MANAGER::IsLibraryLoaded(), LoadOne(), DRC_TEST_PROVIDER_LIBRARY_PARITY::Run(), and ERC_TESTER::TestLibSymbolIssues().
|
virtualinherited |
Return true if the given nickname exists and is not a read-only library.
Definition at line 1178 of file library_manager.cpp.
References fetchIfLoaded(), getUri(), IO_BASE::IsLibraryWritable(), LIB_DATA::plugin, result, and LIB_DATA::row.
Referenced by LoadOne().
|
virtualinherited |
Definition at line 1061 of file library_manager.cpp.
References find, globalLibs(), globalLibsMutex(), m_libraries, and m_librariesMutex.
Referenced by LIB_TABLE_GRID_TRICKS::onGridCellLeftClick().
|
inline |
Definition at line 95 of file footprint_library_adapter.h.
References LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), and LoadFootprint().
| FOOTPRINT * FOOTPRINT_LIBRARY_ADAPTER::LoadFootprint | ( | const wxString & | aNickname, |
| const wxString & | aName, | ||
| bool | aKeepUUID ) |
Load a FOOTPRINT having aName from the library given by aNickname.
| aNickname | is a locator for the "library", it is a "name" in #LIB_TABLE_ROW |
| aName | is the name of the FOOTPRINT to load. |
| aKeepUUID | = true to keep initial items UUID, false to set new UUID normally true if loaded in the footprint editor, false if loaded in the board editor. Make sense only in kicad_plugin |
| IO_ERROR | if the library cannot be found or read. No exception is thrown in the case where aNickname cannot be found. |
Definition at line 246 of file footprint_library_adapter.cpp.
References copy, LIBRARY_MANAGER_ADAPTER::fetchIfLoaded(), PCB_IO::FootprintLoad(), LIBRARY_MANAGER_ADAPTER::getUri(), IGNORE_PARENT_GROUP, pcbplugin(), PreloadedFootprints, PreloadedFootprintsMutex, LIB_ID::SetLibNickname(), traceLibraries, and IO_ERROR::What().
Referenced by PCB_BASE_FRAME::CreateNewFootprint(), BOARD_INSPECTION_TOOL::DiffFootprint(), FOOTPRINT_PREVIEW_PANEL::DisplayFootprint(), DISPLAY_FOOTPRINTS_FRAME::GetFootprint(), FOOTPRINT_INFO_IMPL::load(), LoadFootprint(), LoadFootprintWithOptionalNickname(), PCB_BASE_FRAME::OnFpChangeDebounceTimer(), PANEL_FOOTPRINT_CHOOSER::PANEL_FOOTPRINT_CHOOSER(), DRC_TEST_PROVIDER_LIBRARY_PARITY::Run(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), and DIALOG_FOOTPRINT_ASSOCIATIONS::TransferDataToWindow().
| FOOTPRINT * FOOTPRINT_LIBRARY_ADAPTER::LoadFootprintWithOptionalNickname | ( | const LIB_ID & | aFootprintId, |
| bool | aKeepUUID ) |
Load a footprint having aFootprintId with possibly an empty nickname.
| aFootprintId | the [nickname] and name of the design block to load. |
| aKeepUUID | = true to keep initial items UUID, false to set new UUID normally true if loaded in the footprint editor, false if loaded in the board editor used only in kicad_plugin |
| IO_ERROR | if the library cannot be found or read. No exception is thrown in the case where aFootprintId cannot be found. |
| PARSE_ERROR | if aFootprintId is not parsed OK. |
Definition at line 302 of file footprint_library_adapter.cpp.
References LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), LIBRARY_MANAGER_ADAPTER::GetLibraryNames(), library, and LoadFootprint().
Referenced by PCB_BASE_FRAME::loadFootprint().
|
protectedinherited |
Definition at line 1278 of file library_manager.cpp.
References createPlugin(), LOADING, m_manager, LIBRARY_TABLE_ROW::Nickname(), plugin(), result, traceLibraries, and Type().
Referenced by enumerateLibrary(), loadIfNeeded(), and ReloadLibraryEntry().
|
protectedinherited |
Fetches a loaded library, triggering a load of that library if it isn't loaded yet.
Definition at line 1322 of file library_manager.cpp.
References _, GLOBAL, globalLibs(), globalLibsMutex(), loadFromScope(), m_libraries, m_librariesMutex, PROJECT, and result.
Referenced by CreateLibrary(), DeleteLibrary(), enumerateLibrary(), DESIGN_BLOCK_LIBRARY_ADAPTER::LoadOne(), FOOTPRINT_LIBRARY_ADAPTER::LoadOne(), SYMBOL_LIBRARY_ADAPTER::LoadOne(), and SYMBOL_LIBRARY_ADAPTER::SaveSymbol().
| std::optional< LIB_STATUS > FOOTPRINT_LIBRARY_ADAPTER::LoadOne | ( | const wxString & | aNickname | ) |
Loads or reloads the given library, if it exists.
Definition at line 139 of file footprint_library_adapter.cpp.
References LOAD_ERROR, LIBRARY_MANAGER_ADAPTER::loadIfNeeded(), LoadOne(), and result.
|
overridevirtual |
Loads or reloads the given library, if it exists.
Implements LIBRARY_MANAGER_ADAPTER.
Definition at line 116 of file footprint_library_adapter.cpp.
References LIB_STATUS::error, PCB_IO::FootprintEnumerate(), LIBRARY_TABLE_ROW::GetOptionsMap(), LIBRARY_MANAGER_ADAPTER::getUri(), LOAD_ERROR, LIB_STATUS::load_status, LOADED, LOADING, LIBRARY_TABLE_ROW::Nickname(), pcbplugin(), LIB_DATA::row, LIB_DATA::status, traceLibraries, and IO_ERROR::What().
Referenced by PCB_BASE_EDIT_FRAME::AddLibrary(), CV::kiface(), and LoadOne().
|
inherited |
Definition at line 797 of file library_manager.cpp.
References m_manager.
Definition at line 447 of file footprint_library_adapter.cpp.
References IO_BASE::IsPCB_IO(), and LIB_DATA::plugin.
Referenced by DeleteFootprint(), enumerateLibrary(), FootprintExists(), GetFootprintNames(), LoadFootprint(), LoadOne(), plugin(), and SaveFootprint().
Implements LIBRARY_MANAGER_ADAPTER.
Definition at line 175 of file footprint_library_adapter.h.
References pcbplugin().
Referenced by createPlugin(), enumerateLibrary(), and GenerateTimestamp().
|
virtualinherited |
Notify the adapter that the active project has changed.
Definition at line 803 of file library_manager.cpp.
References abortLoad(), m_libraries, and m_librariesMutex.
|
inherited |
Retrieves the project library table for this adapter type, or nullopt if one doesn't exist.
Definition at line 888 of file library_manager.cpp.
References m_manager, PROJECT, and Type().
Referenced by SCH_IO_CADSTAR_ARCHIVE::LoadSchematicFile(), SCH_IO_EAGLE::LoadSchematicFile(), SCH_IO_EASYEDAPRO::LoadSchematicFile(), SCH_EDIT_FRAME::LoadSheetFromFile(), SCH_EDIT_FRAME::OpenProjectFiles(), and Type().
|
inherited |
Definition at line 1125 of file library_manager.cpp.
References BOTH, GLOBAL, globalLibs(), globalLibsMutex(), loadFromScope(), m_libraries, m_librariesMutex, PROJECT, result, traceLibraries, and UNINITIALIZED.
Referenced by LoadOne().
|
inherited |
Like LIBRARY_MANAGER::Rows but filtered to the LIBRARY_TABLE_TYPE of this adapter.
Definition at line 967 of file library_manager.cpp.
References m_manager, and Type().
Referenced by CVPCB_MAINFRAME::LoadFootprintFiles(), and Type().
| FOOTPRINT_LIBRARY_ADAPTER::SAVE_T FOOTPRINT_LIBRARY_ADAPTER::SaveFootprint | ( | const wxString & | aNickname, |
| const FOOTPRINT * | aFootprint, | ||
| bool | aOverwrite = true ) |
Write aFootprint to an existing library given by aNickname.
If a FOOTPRINT by the same name already exists or there are any conflicting alias names, the new FOOTPRINT will silently overwrite any existing aliases and/or part because libraries cannot have duplicate alias names. It is the responsibility of the caller to check the library for conflicts before saving.
| aNickname | is a locator for the "library", it is a "name" in LIB_TABLE_ROW |
| aFootprint | is what to store in the library. The library owns the footprint after this call. |
| aOverwrite | when true means overwrite any existing symbol by the same name, else if false means skip the write and return SAVE_SKIPPED. |
| IO_ERROR | if there is a problem saving the footprint. |
Definition at line 323 of file footprint_library_adapter.cpp.
References LIBRARY_MANAGER_ADAPTER::fetchIfLoaded(), PCB_IO::FootprintLoad(), PCB_IO::FootprintSave(), FOOTPRINT::GetFPID(), FOOTPRINT::GetFPIDAsString(), LIB_ID::GetLibItemName(), LIBRARY_MANAGER_ADAPTER::getUri(), pcbplugin(), SAVE_OK, SAVE_SKIPPED, traceLibraries, and IO_ERROR::What().
Referenced by FOOTPRINT_EDITOR_CONTROL::editFootprintPropertiesFromLibrary(), PCB_EDIT_FRAME::ExportFootprintsToLibrary(), and FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary().
|
inlinevirtualinherited |
Reimplemented in SYMBOL_LIBRARY_ADAPTER.
Definition at line 169 of file library_manager.h.
Referenced by LIB_TABLE_GRID_TRICKS::doPopupSelection(), and LIB_TABLE_GRID_TRICKS::onGridCellLeftClick().
|
inlinevirtualinherited |
Reimplemented in SYMBOL_LIBRARY_ADAPTER.
Definition at line 167 of file library_manager.h.
Referenced by LIB_TABLE_GRID_TRICKS::onGridCellLeftClick().
|
inlineoverridevirtual |
The type of library table this adapter works with.
Implements LIBRARY_MANAGER_ADAPTER.
Definition at line 44 of file footprint_library_adapter.h.
References FOOTPRINT.
|
staticprivate |
Definition at line 180 of file footprint_library_adapter.h.
Referenced by globalLibs(), globalLibs(), and IsFootprintLibWritable().
|
staticprivate |
Definition at line 181 of file footprint_library_adapter.h.
Referenced by globalLibsMutex(), globalLibsMutex(), and IsFootprintLibWritable().
|
protectedinherited |
Definition at line 211 of file library_manager.h.
Referenced by abortLoad().
|
protectedinherited |
Definition at line 212 of file library_manager.h.
Referenced by abortLoad(), AsyncLoad(), and BlockUntilLoaded().
|
protectedinherited |
Definition at line 207 of file library_manager.h.
Referenced by AsyncLoad(), fetchIfLoaded(), fetchIfLoaded(), GetLibraryStatus(), FOOTPRINT_LIBRARY_ADAPTER::IsFootprintLibWritable(), IsLibraryLoaded(), SYMBOL_LIBRARY_ADAPTER::IsSymbolLibWritable(), LibraryError(), loadIfNeeded(), ProjectChanged(), and ReloadLibraryEntry().
|
mutableprotectedinherited |
Definition at line 209 of file library_manager.h.
Referenced by AsyncLoad(), fetchIfLoaded(), fetchIfLoaded(), GetLibraryStatus(), FOOTPRINT_LIBRARY_ADAPTER::IsFootprintLibWritable(), IsLibraryLoaded(), SYMBOL_LIBRARY_ADAPTER::IsSymbolLibWritable(), LibraryError(), loadIfNeeded(), ProjectChanged(), and ReloadLibraryEntry().
|
protectedinherited |
Definition at line 214 of file library_manager.h.
Referenced by abortLoad(), AsyncLoad(), AsyncLoadProgress(), and BlockUntilLoaded().
|
protectedinherited |
Definition at line 216 of file library_manager.h.
Referenced by abortLoad(), AsyncLoad(), and BlockUntilLoaded().
|
protectedinherited |
Definition at line 215 of file library_manager.h.
Referenced by abortLoad(), AsyncLoad(), AsyncLoadProgress(), and BlockUntilLoaded().
|
protectedinherited |
Definition at line 204 of file library_manager.h.
Referenced by AsyncLoad(), FindLibraryByURI(), FindRowByURI(), GetLibraryNames(), GetLibraryStatuses(), SYMBOL_LIBRARY_ADAPTER::GetModifyHash(), GetRow(), GlobalTable(), LIBRARY_MANAGER_ADAPTER(), loadFromScope(), Manager(), ProjectTable(), and Rows().
|
staticprivate |
Storage for preloaded footprints, indexed by library nickname.
These are cloned during library enumeration so GetFootprints() returns instantly.
Definition at line 185 of file footprint_library_adapter.h.
Referenced by enumerateLibrary(), GetFootprints(), and LoadFootprint().
|
staticprivate |
Definition at line 186 of file footprint_library_adapter.h.
Referenced by enumerateLibrary(), GetFootprints(), and LoadFootprint().