|
KiCad PCB EDA Suite
|
#include <design_block_library_adapter.h>
Public Types | |
| enum | SAVE_T { SAVE_OK , SAVE_SKIPPED } |
| The set of return values from DesignBlockSave() below. More... | |
Public Member Functions | |
| DESIGN_BLOCK_LIBRARY_ADAPTER (LIBRARY_MANAGER &aManager) | |
| LIBRARY_TABLE_TYPE | Type () const override |
| The type of library table this adapter works with. | |
| void | AsyncLoad () override |
| Loads all available libraries for this adapter type in the background. | |
| 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 &nickname) |
| std::optional< LIB_STATUS > | GetLibraryStatus (const wxString &aNickname) const override |
| Returns the status of a loaded library, or nullopt if the library hasn't been loaded (yet) | |
| std::vector< DESIGN_BLOCK * > | GetDesignBlocks (const wxString &aNickname) |
| std::vector< wxString > | GetDesignBlockNames (const wxString &aNickname) |
| DESIGN_BLOCK * | LoadDesignBlock (const wxString &aNickname, const wxString &aDesignBlockName, bool aKeepUUID=false) |
| Load a design block having aDesignBlockName from the library given by aNickname. | |
| bool | DesignBlockExists (const wxString &aNickname, const wxString &aDesignBlockName) |
| Indicates whether or not the given design block already exists in the given library. | |
| const DESIGN_BLOCK * | GetEnumeratedDesignBlock (const wxString &aNickname, const wxString &aDesignBlockName) |
| A version of #DesignBlockLoad() for use after #DesignBlockEnumerate() for more efficient cache management. | |
| SAVE_T | SaveDesignBlock (const wxString &aNickname, const DESIGN_BLOCK *aDesignBlock, bool aOverwrite=true) |
| Write aDesignBlock to an existing library given by aNickname. | |
| void | DeleteDesignBlock (const wxString &aNickname, const wxString &aDesignBlockName) |
| Delete the aDesignBlockName from the library given by aNickname. | |
| bool | IsDesignBlockLibWritable (const wxString &aNickname) |
| Return true if the library given by aNickname is writable. | |
| DESIGN_BLOCK * | DesignBlockLoadWithOptionalNickname (const LIB_ID &aDesignBlockId, bool aKeepUUID=false) |
| Load a design block having aDesignBlockId with possibly an empty nickname. | |
| 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) |
| 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 () |
| bool | IsLibraryLoaded (const wxString &aNickname) |
| 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::mutex & | globalLibsMutex () override |
| 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::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::mutex | m_libraries_mutex |
| std::atomic_bool | m_abort |
| std::vector< std::future< void > > | m_futures |
| std::atomic< size_t > | m_loadCount |
| size_t | m_loadTotal |
Static Private Member Functions | |
| static DESIGN_BLOCK_IO * | dbplugin (const LIB_DATA *aRow) |
| Helper to cast the ABC plugin in the LIB_DATA* to a concrete plugin. | |
Static Private Attributes | |
| static std::map< wxString, LIB_DATA > | GlobalLibraries |
| static std::mutex | GlobalLibraryMutex |
Definition at line 34 of file design_block_library_adapter.h.
The set of return values from DesignBlockSave() below.
| Enumerator | |
|---|---|
| SAVE_OK | |
| SAVE_SKIPPED | |
Definition at line 91 of file design_block_library_adapter.h.
| DESIGN_BLOCK_LIBRARY_ADAPTER::DESIGN_BLOCK_LIBRARY_ADAPTER | ( | LIBRARY_MANAGER & | aManager | ) |
Definition at line 42 of file design_block_library_adapter.cpp.
References LIBRARY_MANAGER_ADAPTER::LIBRARY_MANAGER_ADAPTER().
|
protectedinherited |
Aborts any async load in progress; blocks until fully done aborting.
Definition at line 954 of file library_manager.cpp.
References BlockUntilLoaded(), m_abort, m_futures, m_loadTotal, and traceLibraries.
Referenced by CheckTableRow(), globalLibsMutex(), GlobalTablesChanged(), and ProjectChanged().
|
overridevirtual |
Loads all available libraries for this adapter type in the background.
Implements LIBRARY_MANAGER_ADAPTER.
Definition at line 127 of file design_block_library_adapter.cpp.
References DESIGN_BLOCK, GetKiCadThreadPool(), GlobalLibraries, GlobalLibraryMutex, LOADED, LIBRARY_MANAGER_ADAPTER::m_futures, LIBRARY_MANAGER_ADAPTER::m_libraries, LIBRARY_MANAGER_ADAPTER::m_libraries_mutex, LIBRARY_MANAGER_ADAPTER::m_loadCount, LIBRARY_MANAGER_ADAPTER::m_loadTotal, LIBRARY_MANAGER_ADAPTER::m_manager, tp, and traceLibraries.
Referenced by PGM_BASE::PreloadDesignBlockLibraries().
|
inherited |
Returns async load progress between 0.0 and 1.0, or nullopt if load is not in progress.
Definition at line 971 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 981 of file library_manager.cpp.
References m_futures.
Referenced by abortLoad(), BOOST_AUTO_TEST_CASE(), EESCHEMA_JOBS_HANDLER::JobSchErc(), LoadOne(), PGM_BASE::PreloadDesignBlockLibraries(), PCB::IFACE::PreloadLibraries(), and SCH::IFACE::PreloadLibraries().
|
inherited |
Definition at line 822 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 1128 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 GetLibraryStatus().
|
overrideprotectedvirtual |
Creates a concrete plugin for the given row.
Implements LIBRARY_MANAGER_ADAPTER.
Definition at line 62 of file design_block_library_adapter.cpp.
References _, DESIGN_BLOCK_IO_MGR::DESIGN_BLOCK_FILE_UNKNOWN, DESIGN_BLOCK_IO_MGR::EnumFromStr(), DESIGN_BLOCK_IO_MGR::FindPlugin(), plugin(), traceLibraries, and LIBRARY_TABLE_ROW::Type().
|
staticprivate |
Helper to cast the ABC plugin in the LIB_DATA* to a concrete plugin.
Definition at line 54 of file design_block_library_adapter.cpp.
References LIB_DATA::plugin.
Referenced by DeleteDesignBlock(), DesignBlockExists(), GetDesignBlockNames(), GetDesignBlocks(), GetEnumeratedDesignBlock(), LoadDesignBlock(), LoadOne(), plugin(), and SaveDesignBlock().
| void DESIGN_BLOCK_LIBRARY_ADAPTER::DeleteDesignBlock | ( | const wxString & | aNickname, |
| const wxString & | aDesignBlockName ) |
Delete the aDesignBlockName from the library given by aNickname.
| aNickname | is a locator for the "library", it is a "name" in #LIB_TABLE_ROW. |
| aDesignBlockName | is the name of a design block to delete from the specified library. |
| IO_ERROR | if there is a problem finding the design block or the library, or deleting it. |
Definition at line 410 of file design_block_library_adapter.cpp.
References dbplugin(), DESIGN_BLOCK_IO::DesignBlockDelete(), LIBRARY_MANAGER_ADAPTER::fetchIfLoaded(), LIBRARY_TABLE_ROW::GetOptionsMap(), LIBRARY_MANAGER_ADAPTER::getUri(), and LIB_DATA::row.
|
inherited |
Deletes the given library from disk if it exists; returns true if deleted.
Definition at line 902 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().
| bool DESIGN_BLOCK_LIBRARY_ADAPTER::DesignBlockExists | ( | const wxString & | aNickname, |
| const wxString & | aDesignBlockName ) |
Indicates whether or not the given design block already exists in the given library.
Definition at line 362 of file design_block_library_adapter.cpp.
References dbplugin(), DESIGN_BLOCK_IO::DesignBlockExists(), LIBRARY_MANAGER_ADAPTER::fetchIfLoaded(), LIBRARY_TABLE_ROW::GetOptionsMap(), LIBRARY_MANAGER_ADAPTER::getUri(), and LIB_DATA::row.
Referenced by SaveDesignBlock().
| DESIGN_BLOCK * DESIGN_BLOCK_LIBRARY_ADAPTER::DesignBlockLoadWithOptionalNickname | ( | const LIB_ID & | aDesignBlockId, |
| bool | aKeepUUID = false ) |
Load a design block having aDesignBlockId with possibly an empty nickname.
| aDesignBlockId | 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 design block 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 aDesignBlockName cannot be found. |
| PARSE_ERROR | if aDesignBlockId is not parsed OK. |
Definition at line 434 of file design_block_library_adapter.cpp.
References LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), LIBRARY_MANAGER_ADAPTER::GetLibraryNames(), library, and LoadDesignBlock().
Referenced by DESIGN_BLOCK_PANE::GetDesignBlock().
|
protectedinherited |
Definition at line 1168 of file library_manager.cpp.
References globalLibs(), LOADED, and m_libraries.
|
protectedinherited |
Definition at line 1156 of file library_manager.cpp.
References globalLibs(), LOADED, and m_libraries.
Referenced by DESIGN_BLOCK_LIBRARY_ADAPTER::DeleteDesignBlock(), FOOTPRINT_LIBRARY_ADAPTER::DeleteFootprint(), DESIGN_BLOCK_LIBRARY_ADAPTER::DesignBlockExists(), 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(), FOOTPRINT_LIBRARY_ADAPTER::GetFootprints(), GetLibraryDescription(), GetLibraryNames(), SYMBOL_LIBRARY_ADAPTER::GetModifyHash(), SYMBOL_LIBRARY_ADAPTER::GetSubLibraries(), SYMBOL_LIBRARY_ADAPTER::GetSymbolNames(), SYMBOL_LIBRARY_ADAPTER::GetSymbols(), globalLibsMutex(), 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 866 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 946 of file library_manager.cpp.
References m_manager, and Type().
Referenced by FOOTPRINT_EDIT_FRAME::KiwayMailIn(), SYMBOL_EDIT_FRAME::KiwayMailIn(), and Type().
| std::vector< wxString > DESIGN_BLOCK_LIBRARY_ADAPTER::GetDesignBlockNames | ( | const wxString & | aNickname | ) |
Definition at line 324 of file design_block_library_adapter.cpp.
References dbplugin(), DESIGN_BLOCK_IO::DesignBlockEnumerate(), LIBRARY_MANAGER_ADAPTER::fetchIfLoaded(), LIBRARY_TABLE_ROW::GetOptionsMap(), LIBRARY_MANAGER_ADAPTER::getUri(), name, and LIB_DATA::row.
| std::vector< DESIGN_BLOCK * > DESIGN_BLOCK_LIBRARY_ADAPTER::GetDesignBlocks | ( | const wxString & | aNickname | ) |
Definition at line 286 of file design_block_library_adapter.cpp.
References dbplugin(), DESIGN_BLOCK_IO::DesignBlockEnumerate(), LIBRARY_MANAGER_ADAPTER::fetchIfLoaded(), LIBRARY_TABLE_ROW::GetOptionsMap(), LIBRARY_MANAGER_ADAPTER::getUri(), LIBRARY_TABLE_ROW::Nickname(), LIB_DATA::row, traceLibraries, and IO_ERROR::What().
Referenced by DESIGN_BLOCK_TREE_MODEL_ADAPTER::getDesignBlocks().
| const DESIGN_BLOCK * DESIGN_BLOCK_LIBRARY_ADAPTER::GetEnumeratedDesignBlock | ( | const wxString & | aNickname, |
| const wxString & | aDesignBlockName ) |
A version of #DesignBlockLoad() for use after #DesignBlockEnumerate() for more efficient cache management.
The return value is const to allow it to return a reference to a cached item.
Definition at line 376 of file design_block_library_adapter.cpp.
References dbplugin(), LIBRARY_MANAGER_ADAPTER::fetchIfLoaded(), DESIGN_BLOCK_IO::GetEnumeratedDesignBlock(), LIBRARY_TABLE_ROW::GetOptionsMap(), LIBRARY_MANAGER_ADAPTER::getUri(), and LIB_DATA::row.
|
inherited |
Definition at line 923 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 1043 of file library_manager.cpp.
References _, GetLibraryStatuses(), and LOAD_ERROR.
Referenced by GetLibraryStatus(), PCB_EDIT_FRAME::KiwayMailIn(), SCH_EDIT_FRAME::KiwayMailIn(), 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 878 of file library_manager.cpp.
References fetchIfLoaded(), m_manager, and Type().
Referenced by CVPCB_MAINFRAME::BuildLibrariesList(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), DESIGN_BLOCK_LIBRARY_ADAPTER::DesignBlockLoadWithOptionalNickname(), 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().
|
inlineoverridevirtual |
Returns the status of a loaded library, or nullopt if the library hasn't been loaded (yet)
Implements LIBRARY_MANAGER_ADAPTER.
Definition at line 50 of file design_block_library_adapter.h.
|
inherited |
Returns a list of all library nicknames and their status (even if they failed to load)
Definition at line 1019 of file library_manager.cpp.
References _, GetLibraryStatus(), LOAD_ERROR, m_manager, result, and Type().
Referenced by BOOST_AUTO_TEST_CASE(), GetLibraryLoadErrors(), GetLibraryStatus(), and SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync().
|
inherited |
Like LIBRARY_MANAGER::GetRow but filtered to the LIBRARY_TABLE_TYPE of this adapter.
Definition at line 939 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 1150 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(), FOOTPRINT_LIBRARY_ADAPTER::FootprintExists(), DESIGN_BLOCK_LIBRARY_ADAPTER::GetDesignBlockNames(), DESIGN_BLOCK_LIBRARY_ADAPTER::GetDesignBlocks(), DESIGN_BLOCK_LIBRARY_ADAPTER::GetEnumeratedDesignBlock(), FOOTPRINT_LIBRARY_ADAPTER::GetFootprintNames(), FOOTPRINT_LIBRARY_ADAPTER::GetFootprints(), SYMBOL_LIBRARY_ADAPTER::GetSymbolNames(), SYMBOL_LIBRARY_ADAPTER::GetSymbols(), globalLibsMutex(), 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 154 of file design_block_library_adapter.h.
References GlobalLibraries.
|
inlineoverrideprotectedvirtual |
Implements LIBRARY_MANAGER_ADAPTER.
Definition at line 153 of file design_block_library_adapter.h.
References GlobalLibraries.
|
inlineoverrideprotectedvirtual |
Implements LIBRARY_MANAGER_ADAPTER.
Definition at line 155 of file design_block_library_adapter.h.
References GlobalLibraryMutex.
|
static |
Definition at line 48 of file design_block_library_adapter.cpp.
References ENV_VAR::GetVersionedEnvVarName().
Referenced by PANEL_DESIGN_BLOCK_LIB_TABLE::populateEnvironReadOnlyTable().
|
inherited |
|
inherited |
Notify the adapter that the global library tables have changed.
Definition at line 797 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 892 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 DESIGN_BLOCK_LIBRARY_ADAPTER::IsDesignBlockLibWritable | ( | const wxString & | aNickname | ) |
Return true if the library given by aNickname is writable.
Often system libraries are read only because of where they are installed.
| IO_ERROR | if no library at aLibraryPath exists. |
Definition at line 422 of file design_block_library_adapter.cpp.
References LIBRARY_MANAGER_ADAPTER::fetchIfLoaded(), LIBRARY_MANAGER_ADAPTER::getUri(), IO_BASE::IsLibraryWritable(), plugin(), and LIB_DATA::row.
|
inherited |
Definition at line 988 of file library_manager.cpp.
References globalLibs(), and m_libraries.
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 1116 of file library_manager.cpp.
References fetchIfLoaded(), getUri(), IO_BASE::IsLibraryWritable(), LIB_DATA::plugin, result, and LIB_DATA::row.
Referenced by GetLibraryStatus().
|
virtualinherited |
Definition at line 1003 of file library_manager.cpp.
References globalLibs(), and m_libraries.
Referenced by LIB_TABLE_GRID_TRICKS::onGridCellLeftClick().
| DESIGN_BLOCK * DESIGN_BLOCK_LIBRARY_ADAPTER::LoadDesignBlock | ( | const wxString & | aNickname, |
| const wxString & | aDesignBlockName, | ||
| bool | aKeepUUID = false ) |
Load a design block having aDesignBlockName from the library given by aNickname.
| aNickname | is a locator for the "library", it is a "name" in #LIB_TABLE_ROW. |
| aDesignBlockName | is the 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 design block 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 aDesignBlockName cannot be found. |
Definition at line 345 of file design_block_library_adapter.cpp.
References dbplugin(), DESIGN_BLOCK_IO::DesignBlockLoad(), LIBRARY_MANAGER_ADAPTER::fetchIfLoaded(), DESIGN_BLOCK::GetLibId(), LIBRARY_TABLE_ROW::GetOptionsMap(), LIBRARY_MANAGER_ADAPTER::getUri(), LIB_DATA::row, and LIB_ID::SetLibNickname().
Referenced by DesignBlockLoadWithOptionalNickname(), and PANEL_DESIGN_BLOCK_CHOOSER::rebuildHistoryNode().
|
protectedinherited |
Definition at line 1180 of file library_manager.cpp.
References createPlugin(), LOADING, m_manager, LIBRARY_TABLE_ROW::Nickname(), plugin(), result, traceLibraries, and Type().
Referenced by globalLibsMutex(), loadIfNeeded(), and ReloadLibraryEntry().
|
protectedinherited |
Fetches a loaded library, triggering a load of that library if it isn't loaded yet.
Definition at line 1222 of file library_manager.cpp.
References _, GLOBAL, globalLibs(), globalLibsMutex(), loadFromScope(), m_libraries, m_libraries_mutex, PROJECT, and result.
Referenced by CreateLibrary(), DeleteLibrary(), globalLibsMutex(), DESIGN_BLOCK_LIBRARY_ADAPTER::LoadOne(), FOOTPRINT_LIBRARY_ADAPTER::LoadOne(), SYMBOL_LIBRARY_ADAPTER::LoadOne(), and SYMBOL_LIBRARY_ADAPTER::SaveSymbol().
| std::optional< LIB_STATUS > DESIGN_BLOCK_LIBRARY_ADAPTER::LoadOne | ( | const wxString & | nickname | ) |
Definition at line 113 of file design_block_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 88 of file design_block_library_adapter.cpp.
References dbplugin(), DESIGN_BLOCK_IO::DesignBlockEnumerate(), LIB_STATUS::error, LIBRARY_TABLE_ROW::GetOptionsMap(), LIBRARY_MANAGER_ADAPTER::getUri(), LOAD_ERROR, LIB_STATUS::load_status, LOADED, LOADING, LIB_DATA::mutex, LIBRARY_TABLE_ROW::Nickname(), LIB_DATA::row, LIB_DATA::status, traceLibraries, and IO_ERROR::What().
Referenced by DESIGN_BLOCK_PANE::AddDesignBlockLibrary(), and LoadOne().
|
inherited |
Definition at line 780 of file library_manager.cpp.
References m_manager.
Implements LIBRARY_MANAGER_ADAPTER.
Definition at line 81 of file design_block_library_adapter.cpp.
References dbplugin().
Referenced by createPlugin(), and IsDesignBlockLibWritable().
|
virtualinherited |
Notify the adapter that the active project has changed.
Definition at line 786 of file library_manager.cpp.
References abortLoad(), m_libraries, and m_libraries_mutex.
|
inherited |
Retrieves the project library table for this adapter type, or nullopt if one doesn't exist.
Definition at line 860 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 1063 of file library_manager.cpp.
References BOTH, GLOBAL, globalLibs(), globalLibsMutex(), loadFromScope(), m_libraries, m_libraries_mutex, PROJECT, result, traceLibraries, and UNINITIALIZED.
Referenced by GetLibraryStatus().
|
inherited |
Like LIBRARY_MANAGER::Rows but filtered to the LIBRARY_TABLE_TYPE of this adapter.
Definition at line 932 of file library_manager.cpp.
References m_manager, and Type().
Referenced by CVPCB_MAINFRAME::LoadFootprintFiles(), and Type().
| DESIGN_BLOCK_LIBRARY_ADAPTER::SAVE_T DESIGN_BLOCK_LIBRARY_ADAPTER::SaveDesignBlock | ( | const wxString & | aNickname, |
| const DESIGN_BLOCK * | aDesignBlock, | ||
| bool | aOverwrite = true ) |
Write aDesignBlock to an existing library given by aNickname.
If a design block by the same name already exists, it is replaced.
| aNickname | is a locator for the "library", it is a "name" in #LIB_TABLE_ROW. |
| aDesignBlock | is what to store in the library. The caller continues to own the design block after this call. |
| aOverwrite | when true means overwrite any existing design block by the same name, else if false means skip the write and return SAVE_SKIPPED. |
| IO_ERROR | if there is a problem saving. |
Definition at line 391 of file design_block_library_adapter.cpp.
References dbplugin(), DesignBlockExists(), DESIGN_BLOCK_IO::DesignBlockSave(), LIBRARY_MANAGER_ADAPTER::fetchIfLoaded(), DESIGN_BLOCK::GetName(), LIBRARY_TABLE_ROW::GetOptionsMap(), LIBRARY_MANAGER_ADAPTER::getUri(), LIB_DATA::row, SAVE_OK, and SAVE_SKIPPED.
Referenced by PCB_EDIT_FRAME::SaveBoardAsDesignBlock(), SCH_EDIT_FRAME::SaveSelectionAsDesignBlock(), PCB_EDIT_FRAME::saveSelectionToDesignBlock(), SCH_EDIT_FRAME::SaveSheetAsDesignBlock(), PCB_EDIT_FRAME::UpdateDesignBlockFromBoard(), SCH_EDIT_FRAME::UpdateDesignBlockFromSelection(), and SCH_EDIT_FRAME::UpdateDesignBlockFromSheet().
|
inlinevirtualinherited |
Reimplemented in SYMBOL_LIBRARY_ADAPTER.
Definition at line 165 of file library_manager.h.
Referenced by LIB_TABLE_GRID_TRICKS::onGridCellLeftClick().
|
inlinevirtualinherited |
Reimplemented in SYMBOL_LIBRARY_ADAPTER.
Definition at line 163 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 39 of file design_block_library_adapter.h.
References DESIGN_BLOCK.
|
staticprivate |
Definition at line 168 of file design_block_library_adapter.h.
Referenced by AsyncLoad(), globalLibs(), and globalLibs().
|
staticprivate |
Definition at line 170 of file design_block_library_adapter.h.
Referenced by AsyncLoad(), and globalLibsMutex().
|
protectedinherited |
Definition at line 206 of file library_manager.h.
Referenced by abortLoad().
|
protectedinherited |
Definition at line 207 of file library_manager.h.
Referenced by abortLoad(), DESIGN_BLOCK_LIBRARY_ADAPTER::AsyncLoad(), FOOTPRINT_LIBRARY_ADAPTER::AsyncLoad(), SYMBOL_LIBRARY_ADAPTER::AsyncLoad(), and BlockUntilLoaded().
|
protectedinherited |
Definition at line 202 of file library_manager.h.
Referenced by DESIGN_BLOCK_LIBRARY_ADAPTER::AsyncLoad(), FOOTPRINT_LIBRARY_ADAPTER::AsyncLoad(), SYMBOL_LIBRARY_ADAPTER::AsyncLoad(), fetchIfLoaded(), fetchIfLoaded(), FOOTPRINT_LIBRARY_ADAPTER::GetLibraryStatus(), SYMBOL_LIBRARY_ADAPTER::GetLibraryStatus(), FOOTPRINT_LIBRARY_ADAPTER::IsFootprintLibWritable(), IsLibraryLoaded(), SYMBOL_LIBRARY_ADAPTER::IsSymbolLibWritable(), LibraryError(), loadIfNeeded(), ProjectChanged(), and ReloadLibraryEntry().
|
protectedinherited |
Definition at line 204 of file library_manager.h.
Referenced by DESIGN_BLOCK_LIBRARY_ADAPTER::AsyncLoad(), FOOTPRINT_LIBRARY_ADAPTER::AsyncLoad(), SYMBOL_LIBRARY_ADAPTER::AsyncLoad(), loadIfNeeded(), ProjectChanged(), and ReloadLibraryEntry().
|
protectedinherited |
Definition at line 209 of file library_manager.h.
Referenced by DESIGN_BLOCK_LIBRARY_ADAPTER::AsyncLoad(), FOOTPRINT_LIBRARY_ADAPTER::AsyncLoad(), SYMBOL_LIBRARY_ADAPTER::AsyncLoad(), and AsyncLoadProgress().
|
protectedinherited |
Definition at line 210 of file library_manager.h.
Referenced by abortLoad(), DESIGN_BLOCK_LIBRARY_ADAPTER::AsyncLoad(), FOOTPRINT_LIBRARY_ADAPTER::AsyncLoad(), SYMBOL_LIBRARY_ADAPTER::AsyncLoad(), AsyncLoadProgress(), and LIBRARY_MANAGER_ADAPTER().
|
protectedinherited |
Definition at line 196 of file library_manager.h.
Referenced by DESIGN_BLOCK_LIBRARY_ADAPTER::AsyncLoad(), FOOTPRINT_LIBRARY_ADAPTER::AsyncLoad(), SYMBOL_LIBRARY_ADAPTER::AsyncLoad(), FindLibraryByURI(), FindRowByURI(), GetLibraryNames(), GetLibraryStatuses(), SYMBOL_LIBRARY_ADAPTER::GetModifyHash(), GetRow(), GlobalTable(), LIBRARY_MANAGER_ADAPTER(), loadFromScope(), Manager(), ProjectTable(), and Rows().