|
KiCad PCB EDA Suite
|
#include <library_manager.h>
Public Member Functions | |
| LIBRARY_MANAGER () | |
| ~LIBRARY_MANAGER () | |
| LIBRARY_MANAGER (const LIBRARY_MANAGER &)=delete | |
| LIBRARY_MANAGER & | operator= (const LIBRARY_MANAGER &)=delete |
| void | LoadGlobalTables (std::initializer_list< LIBRARY_TABLE_TYPE > aTablesToLoad={}) |
| (Re)loads the global library tables in the given list, or all tables if no list is given | |
| void | LoadProjectTables (std::initializer_list< LIBRARY_TABLE_TYPE > aTablesToLoad={}) |
| (Re)loads the project library tables in the given list, or all tables if no list is given | |
| void | ReloadTables (LIBRARY_TABLE_SCOPE aScope, std::initializer_list< LIBRARY_TABLE_TYPE > aTablesToLoad={}) |
| void | ProjectChanged () |
| Notify all adapters that the project has changed. | |
| void | AbortAsyncLoads () |
| Abort any async library loading operations in progress. | |
| void | RegisterAdapter (LIBRARY_TABLE_TYPE aType, std::unique_ptr< LIBRARY_MANAGER_ADAPTER > &&aAdapter) |
| bool | RemoveAdapter (LIBRARY_TABLE_TYPE aType, LIBRARY_MANAGER_ADAPTER *aAdapter) |
| std::optional< LIBRARY_MANAGER_ADAPTER * > | Adapter (LIBRARY_TABLE_TYPE aType) const |
| std::optional< LIBRARY_TABLE * > | Table (LIBRARY_TABLE_TYPE aType, LIBRARY_TABLE_SCOPE aScope) |
| Retrieves a given table; creating a new empty project table if a valid project is loaded and the given table type doesn't exist in the project. | |
| std::vector< LIBRARY_TABLE_ROW * > | Rows (LIBRARY_TABLE_TYPE aType, LIBRARY_TABLE_SCOPE aScope=LIBRARY_TABLE_SCOPE::BOTH, bool aIncludeInvalid=false) const |
| Returns a flattened list of libraries of the given type. | |
| std::optional< LIBRARY_TABLE_ROW * > | GetRow (LIBRARY_TABLE_TYPE aType, const wxString &aNickname, LIBRARY_TABLE_SCOPE aScope=LIBRARY_TABLE_SCOPE::BOTH) |
| std::optional< LIBRARY_TABLE_ROW * > | FindRowByURI (LIBRARY_TABLE_TYPE aType, const wxString &aUri, LIBRARY_TABLE_SCOPE aScope=LIBRARY_TABLE_SCOPE::BOTH) const |
| void | ReloadLibraryEntry (LIBRARY_TABLE_TYPE aType, const wxString &aNickname, LIBRARY_TABLE_SCOPE aScope=LIBRARY_TABLE_SCOPE::BOTH) |
| std::optional< LIB_STATUS > | LoadLibraryEntry (LIBRARY_TABLE_TYPE aType, const wxString &aNickname) |
| Synchronously loads the named library to LOADED state for the given type. | |
| void | LoadProjectTables (const wxString &aProjectPath, std::initializer_list< LIBRARY_TABLE_TYPE > aTablesToLoad={}) |
| std::optional< wxString > | GetFullURI (LIBRARY_TABLE_TYPE aType, const wxString &aNickname, bool aSubstituted=false) |
| Return the full location specifying URI for the LIB, either in original UI form or in environment variable expanded form. | |
| void | ApplyLibOverrides (LIBRARY_TABLE &aTable) |
| Applies stored user overrides (disabled/hidden) to rows of a read-only table. | |
| void | SetLibOverride (const wxString &aTablePath, const wxString &aNickname, bool aDisabled, bool aHidden) |
| Set a user override for a library in a read-only nested table. | |
| void | ClearLibOverride (const wxString &aTablePath, const wxString &aNickname) |
| Removes any override for a library that no longer needs one. | |
Static Public Member Functions | |
| static wxString | DefaultGlobalTablePath (LIBRARY_TABLE_TYPE aType) |
| static wxString | StockTablePath (LIBRARY_TABLE_TYPE aType) |
| static wxString | StockTableTokenizedURI (LIBRARY_TABLE_TYPE aType) |
| static wxString | StockTableReferenceURI (LIBRARY_TABLE_TYPE aType) |
| static bool | IsTableValid (const wxString &aPath) |
| static bool | GlobalTablesValid () |
| static std::vector< LIBRARY_TABLE_TYPE > | InvalidGlobalTables () |
| static bool | CreateGlobalTable (LIBRARY_TABLE_TYPE aType, bool aPopulateDefaultLibraries) |
| static wxString | GetFullURI (const LIBRARY_TABLE_ROW *aRow, bool aSubstituted=false) |
| static wxString | ExpandURI (const wxString &aShortURI, const PROJECT &aProject) |
| static bool | UrisAreEquivalent (const wxString &aURI1, const wxString &aURI2) |
| static bool | IsPcmManagedRow (const LIBRARY_TABLE_ROW &aRow) |
| Return true if a library table row was added by the Plugin and Content Manager. | |
Private Types | |
| typedef std::tuple< LIBRARY_TABLE_TYPE, LIBRARY_TABLE_SCOPE, wxString > | ROW_CACHE_KEY |
Private Member Functions | |
| void | loadTables (const wxString &aTablePath, LIBRARY_TABLE_SCOPE aScope, std::vector< LIBRARY_TABLE_TYPE > aTablesToLoad={}) |
| void | loadNestedTables (LIBRARY_TABLE &aTable) |
| void | applyLibOverrides (LIBRARY_TABLE &aTable) |
| Applies user overrides (disabled/hidden) to rows of a read-only nested table. | |
| void | createEmptyTable (LIBRARY_TABLE_TYPE aType, LIBRARY_TABLE_SCOPE aScope) |
Static Private Member Functions | |
| static wxString | tableFileName (LIBRARY_TABLE_TYPE aType) |
Private Attributes | |
| std::map< LIBRARY_TABLE_TYPE, std::unique_ptr< LIBRARY_TABLE > > | m_tables |
| std::map< wxString, std::unique_ptr< LIBRARY_TABLE > > | m_childTables |
| Map of full URI to table object for tables that are referenced by global or project tables. | |
| std::map< LIBRARY_TABLE_TYPE, std::unique_ptr< LIBRARY_TABLE > > | m_projectTables |
| std::map< LIBRARY_TABLE_TYPE, std::unique_ptr< LIBRARY_MANAGER_ADAPTER > > | m_adapters |
| std::mutex | m_adaptersMutex |
| std::map< ROW_CACHE_KEY, LIBRARY_TABLE_ROW * > | m_rowCache |
| std::mutex | m_rowCacheMutex |
Definition at line 262 of file library_manager.h.
|
private |
Definition at line 449 of file library_manager.h.
| LIBRARY_MANAGER::LIBRARY_MANAGER | ( | ) |
Definition at line 52 of file library_manager.cpp.
Referenced by LIBRARY_MANAGER(), and operator=().
|
default |
|
delete |
References LIBRARY_MANAGER().
| void LIBRARY_MANAGER::AbortAsyncLoads | ( | ) |
Abort any async library loading operations in progress.
This should be called before modifying the project list to prevent race conditions with background threads that access Prj().
Definition at line 655 of file library_manager.cpp.
References m_adapters, and m_adaptersMutex.
Referenced by SCH_EDIT_FRAME::KiwayMailIn(), SETTINGS_MANAGER::LoadProject(), ProjectChanged(), ReloadTables(), and SETTINGS_MANAGER::UnloadProject().
| std::optional< LIBRARY_MANAGER_ADAPTER * > LIBRARY_MANAGER::Adapter | ( | LIBRARY_TABLE_TYPE | aType | ) | const |
Definition at line 689 of file library_manager.cpp.
References m_adapters, and m_adaptersMutex.
Referenced by PROJECT::DesignBlockLibs(), PROJECT_PCB::FootprintLibAdapter(), LoadLibraryEntry(), TEST_SYMBOL_LIBRARY_FIXTURE::RegisterSymbolAdapter(), ReloadLibraryEntry(), and PROJECT_SCH::SymbolLibAdapter().
| void LIBRARY_MANAGER::ApplyLibOverrides | ( | LIBRARY_TABLE & | aTable | ) |
Applies stored user overrides (disabled/hidden) to rows of a read-only table.
Call this after constructing a LIBRARY_TABLE from a read-only file before displaying it in the UI.
Definition at line 174 of file library_manager.cpp.
References SETTINGS_MANAGER::GetAppSettings(), PGM_BASE::GetSettingsManager(), LIBRARY_TABLE::IsReadOnly(), KICAD_SETTINGS::m_LibOverrides, LIBRARY_TABLE::Path(), Pgm(), and LIBRARY_TABLE::Rows().
Referenced by applyLibOverrides(), DESIGN_BLOCK_GRID_TRICKS::openTable(), FP_GRID_TRICKS::openTable(), SYMBOL_GRID_TRICKS::openTable(), and LIB_TABLE_NOTEBOOK_PANEL::TableModified().
|
private |
Applies user overrides (disabled/hidden) to rows of a read-only nested table.
Definition at line 207 of file library_manager.cpp.
References ApplyLibOverrides().
Referenced by loadNestedTables().
| void LIBRARY_MANAGER::ClearLibOverride | ( | const wxString & | aTablePath, |
| const wxString & | aNickname ) |
Removes any override for a library that no longer needs one.
Definition at line 231 of file library_manager.cpp.
References SETTINGS_MANAGER::GetAppSettings(), PGM_BASE::GetSettingsManager(), KICAD_SETTINGS::m_LibOverrides, and Pgm().
Referenced by BOOST_AUTO_TEST_CASE(), LIB_TABLE_NOTEBOOK_PANEL::SaveOverrides(), and SetLibOverride().
|
private |
Definition at line 262 of file library_manager.cpp.
References PATHS::GetUserSettingsPath(), GLOBAL, m_projectTables, m_tables, Pgm(), Prj(), PROJECT, and tableFileName().
Referenced by Table().
|
static |
Definition at line 507 of file library_manager.cpp.
References _, DefaultGlobalTablePath(), PRETTIFIED_FILE_OUTPUTFORMATTER::Finish(), GLOBAL, LIBRARY_TABLE_ROW::SetDescription(), LIBRARY_TABLE_ROW::SetNickname(), LIBRARY_TABLE_ROW::SetType(), LIBRARY_TABLE_ROW::SetURI(), StockTablePath(), StockTableReferenceURI(), table, LIBRARY_TABLE_ROW::TABLE_TYPE_NAME, traceLibraries, and IO_ERROR::What().
Referenced by STARTWIZARD_PROVIDER_LIBRARIES::ApplyDefaults(), BOOST_AUTO_TEST_CASE(), STARTWIZARD_PROVIDER_LIBRARIES::Finish(), PANEL_FP_LIB_TABLE::onReset(), PANEL_SYM_LIB_TABLE::onReset(), and operator=().
|
static |
Definition at line 418 of file library_manager.cpp.
References FN_NORMALIZE_FLAGS, PATHS::GetUserSettingsPath(), and tableFileName().
Referenced by BOOST_AUTO_TEST_CASE(), CreateGlobalTable(), STARTWIZARD_PROVIDER_LIBRARIES::Finish(), and operator=().
|
static |
Definition at line 956 of file library_manager.cpp.
References ExpandEnvVarSubstitutions(), and path.
Referenced by LIBRARY_MANAGER_ADAPTER::getUri(), LIBRARY_TABLE::HasRowWithURI(), loadNestedTables(), DESIGN_BLOCK_GRID_TRICKS::openTable(), FP_GRID_TRICKS::openTable(), SYMBOL_GRID_TRICKS::openTable(), DESIGN_BLOCK_LIB_TABLE_GRID_DATA_MODEL::SetValue(), FP_LIB_TABLE_GRID_DATA_MODEL::SetValue(), and SYMBOL_LIB_TABLE_GRID_DATA_MODEL::SetValue().
| std::optional< LIBRARY_TABLE_ROW * > LIBRARY_MANAGER::FindRowByURI | ( | LIBRARY_TABLE_TYPE | aType, |
| const wxString & | aUri, | ||
| LIBRARY_TABLE_SCOPE | aScope = LIBRARY_TABLE_SCOPE::BOTH ) const |
Definition at line 845 of file library_manager.cpp.
References GetFullURI(), Rows(), and UrisAreEquivalent().
Referenced by DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable().
|
static |
Definition at line 947 of file library_manager.cpp.
References ExpandEnvVarSubstitutions(), Pgm(), Prj(), and LIBRARY_TABLE_ROW::URI().
| std::optional< wxString > LIBRARY_MANAGER::GetFullURI | ( | LIBRARY_TABLE_TYPE | aType, |
| const wxString & | aNickname, | ||
| bool | aSubstituted = false ) |
Return the full location specifying URI for the LIB, either in original UI form or in environment variable expanded form.
| aType | determines which tables will be searched for the library |
| aNickname | is the library to look up |
| aSubstituted | Tells if caller wanted the substituted form, else not. |
Definition at line 937 of file library_manager.cpp.
References GetFullURI(), GetRow(), and result.
Referenced by EXPORTER_STEP::buildFootprint3DShapes(), FOOTPRINT_EDITOR_CONTROL::CompareLibraryWithFile(), FOOTPRINT_EDIT_FRAME::DeleteFootprintFromLibrary(), SYMBOL_VIEWER_FRAME::DisplayLibInfos(), CVPCB_MAINFRAME::DisplayStatus(), FOOTPRINT_EDIT_FRAME::DuplicateFootprint(), SYMBOL_EDIT_FRAME::ExportSymbol(), SCH_EDITOR_CONTROL::ExportSymbolsToLibrary(), EXPORTER_PCB_VRML::ExportVrmlFootprint(), FindRowByURI(), FOOTPRINT_LIBRARY_ADAPTER::GenerateTimestamp(), GetFullURI(), SYMBOL_LIBRARY_MANAGER::GetLibraryHash(), idf_export_footprint(), SYMBOL_EDIT_FRAME::KiwayMailIn(), SYMBOL_VIEWER_FRAME::KiwayMailIn(), RENDER_3D_RAYTRACE_BASE::load3DModels(), RENDER_3D_OPENGL::load3dModels(), SCH_EDIT_FRAME::LoadSheetFromFile(), NETLIST_EXPORTER_XML::makeLibraries(), PANEL_FP_PROPERTIES_3D_MODEL::OnAdd3DModel(), FOOTPRINT_EDITOR_CONTROL::OpenDirectory(), SYMBOL_EDITOR_CONTROL::OpenDirectory(), FOOTPRINT_EDITOR_CONTROL::OpenWithTextEditor(), SYMBOL_EDITOR_CONTROL::OpenWithTextEditor(), DRC_TEST_PROVIDER_LIBRARY_PARITY::Run(), FOOTPRINT_EDITOR_CONTROL::SaveAs(), FOOTPRINT_EDIT_FRAME::SaveFootprint(), FOOTPRINT_EDIT_FRAME::SaveFootprintAs(), SYMBOL_LIBRARY_MANAGER::SaveLibrary(), SYMBOL_EDIT_FRAME::saveLibrary(), PCB_BASE_FRAME::setFPWatcher(), SCH_BASE_FRAME::setSymWatcher(), ERC_TESTER::TestLibSymbolIssues(), FOOTPRINT_VIEWER_FRAME::UpdateTitle(), and PANEL_FP_PROPERTIES_3D_MODEL::validateModelExists().
| std::optional< LIBRARY_TABLE_ROW * > LIBRARY_MANAGER::GetRow | ( | LIBRARY_TABLE_TYPE | aType, |
| const wxString & | aNickname, | ||
| LIBRARY_TABLE_SCOPE | aScope = LIBRARY_TABLE_SCOPE::BOTH ) |
| aType | determines which type of libraries to return (symbol, footprint, ...) |
| aScope | determines whether to search project, global, or both library tables |
| aNickname | is the library nickname to retrieve |
Definition at line 820 of file library_manager.cpp.
References m_rowCache, m_rowCacheMutex, and Rows().
Referenced by SYMBOL_TREE_MODEL_ADAPTER::AddLibraries(), SYMBOL_TREE_MODEL_ADAPTER::AddLibrary(), GetFullURI(), SYMBOL_EDIT_FRAME::LoadSymbol(), SYMBOL_LIB_TABLE_RESCUER::OpenRescueLibrary(), ERC_TESTER::TestLibSymbolIssues(), and SYMBOL_LIB_TABLE_RESCUER::WriteRescueLibrary().
|
static |
Definition at line 482 of file library_manager.cpp.
References InvalidGlobalTables().
Referenced by STARTWIZARD_PROVIDER_LIBRARIES::NeedsUserInput(), and operator=().
|
static |
Definition at line 488 of file library_manager.cpp.
References DESIGN_BLOCK, FOOTPRINT, PATHS::GetUserSettingsPath(), IsTableValid(), SYMBOL, and tableFileName().
Referenced by STARTWIZARD_PROVIDER_LIBRARIES::ApplyDefaults(), STARTWIZARD_PROVIDER_LIBRARIES::Finish(), STARTWIZARD_PROVIDER_LIBRARIES::GetWizardPanel(), GlobalTablesValid(), and operator=().
|
static |
Return true if a library table row was added by the Plugin and Content Manager.
PCM-managed rows are identified by the unexpanded URI template referencing the versioned 3RD_PARTY env var (as produced by PCM_LIB_TRAVERSER). Matching on the URI template, rather than on the expanded absolute path, prevents false positives when a user library uses a different env var whose expanded path is a descendant of the 3RD_PARTY directory (e.g. KICAD_USER_LIB pointing inside KICAD10_3RD_PARTY).
Definition at line 966 of file library_manager.cpp.
References end, and LIBRARY_TABLE_ROW::URI().
Referenced by BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 468 of file library_manager.cpp.
References GLOBAL, and LIBRARY_TABLE::IsOk().
Referenced by STARTWIZARD_PROVIDER_LIBRARIES::Finish(), PANEL_STARTWIZARD_LIBRARIES::InitTableListMsg(), InvalidGlobalTables(), STARTWIZARD_PROVIDER_LIBRARIES::MigrateBuiltInLibraries(), and operator=().
| void LIBRARY_MANAGER::LoadGlobalTables | ( | std::initializer_list< LIBRARY_TABLE_TYPE > | aTablesToLoad = {} | ) |
(Re)loads the global library tables in the given list, or all tables if no list is given
Definition at line 548 of file library_manager.cpp.
References DESIGN_BLOCK, FOOTPRINT, SETTINGS_MANAGER::GetAppSettings(), PGM_BASE::GetLocalEnvVariables(), PGM_BASE::GetSettingsManager(), PATHS::GetUserSettingsPath(), ENV_VAR::GetVersionedEnvVarValue(), GLOBAL, loadTables(), m_adapters, m_adaptersMutex, KICAD_SETTINGS::m_PcmLibAutoAdd, KICAD_SETTINGS::m_PcmLibAutoRemove, KICAD_SETTINGS::m_PcmLibPrefix, LIBRARY_ERROR::message, PCM_LIB_TRAVERSER::Modified(), Pgm(), SYMBOL, Table(), table, and traceLibraries.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), InvokeEditDesignBlockLibTable(), InvokePcbLibTableEditor(), InvokeSchEditSymbolLibTable(), PGM_KICAD::OnPgmInit(), PANEL_FP_LIB_TABLE::onReset(), PANEL_SYM_LIB_TABLE::onReset(), operator=(), and ReloadTables().
| std::optional< LIB_STATUS > LIBRARY_MANAGER::LoadLibraryEntry | ( | LIBRARY_TABLE_TYPE | aType, |
| const wxString & | aNickname ) |
Synchronously loads the named library to LOADED state for the given type.
Returns the resulting status, or nullopt if the library is not found.
Definition at line 867 of file library_manager.cpp.
References Adapter().
Referenced by REMOTE_SYMBOL_IMPORT_JOB::Import(), and PANEL_REMOTE_SYMBOL::receiveFootprint().
|
private |
Definition at line 121 of file library_manager.cpp.
References _, applyLibOverrides(), ExpandURI(), m_childTables, Pgm(), Prj(), WX_FILENAME::ResolvePossibleSymlinks(), LIBRARY_TABLE::Scope(), LIBRARY_TABLE_ROW::TABLE_TYPE_NAME, and traceLibraries.
Referenced by loadTables().
| void LIBRARY_MANAGER::LoadProjectTables | ( | const wxString & | aProjectPath, |
| std::initializer_list< LIBRARY_TABLE_TYPE > | aTablesToLoad = {} ) |
Definition at line 877 of file library_manager.cpp.
References loadTables(), m_adapters, m_adaptersMutex, m_projectTables, m_rowCache, m_rowCacheMutex, PROJECT, and traceLibraries.
| void LIBRARY_MANAGER::LoadProjectTables | ( | std::initializer_list< LIBRARY_TABLE_TYPE > | aTablesToLoad = {} | ) |
(Re)loads the project library tables in the given list, or all tables if no list is given
Definition at line 633 of file library_manager.cpp.
References LoadProjectTables(), Pgm(), and Prj().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), SCH_EDIT_FRAME::KiwayMailIn(), loadEagleSchematic(), LoadProjectTables(), ProjectChanged(), and ReloadTables().
|
private |
Definition at line 60 of file library_manager.cpp.
References DESIGN_BLOCK, FOOTPRINT, GLOBAL, loadNestedTables(), m_projectTables, m_rowCache, m_rowCacheMutex, m_tables, PROJECT, SYMBOL, table, tableFileName(), and traceLibraries.
Referenced by LoadGlobalTables(), and LoadProjectTables().
|
delete |
| void LIBRARY_MANAGER::ProjectChanged | ( | ) |
Notify all adapters that the project has changed.
Definition at line 639 of file library_manager.cpp.
References AbortAsyncLoads(), LoadProjectTables(), m_adapters, m_adaptersMutex, Pgm(), and Prj().
Referenced by BOOST_AUTO_TEST_CASE(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), InvokeEditDesignBlockLibTable(), InvokePcbLibTableEditor(), InvokeSchEditSymbolLibTable(), and SETTINGS_MANAGER::LoadProject().
| void LIBRARY_MANAGER::RegisterAdapter | ( | LIBRARY_TABLE_TYPE | aType, |
| std::unique_ptr< LIBRARY_MANAGER_ADAPTER > && | aAdapter ) |
Definition at line 664 of file library_manager.cpp.
References m_adapters, and m_adaptersMutex.
Referenced by PROJECT::DesignBlockLibs(), PROJECT_PCB::FootprintLibAdapter(), TEST_SYMBOL_LIBRARY_FIXTURE::RegisterSymbolAdapter(), and PROJECT_SCH::SymbolLibAdapter().
| void LIBRARY_MANAGER::ReloadLibraryEntry | ( | LIBRARY_TABLE_TYPE | aType, |
| const wxString & | aNickname, | ||
| LIBRARY_TABLE_SCOPE | aScope = LIBRARY_TABLE_SCOPE::BOTH ) |
Definition at line 859 of file library_manager.cpp.
References Adapter().
Referenced by REMOTE_SYMBOL_IMPORT_JOB::Import(), PANEL_REMOTE_SYMBOL::receiveFootprint(), and PANEL_REMOTE_SYMBOL::receiveSymbol().
| void LIBRARY_MANAGER::ReloadTables | ( | LIBRARY_TABLE_SCOPE | aScope, |
| std::initializer_list< LIBRARY_TABLE_TYPE > | aTablesToLoad = {} ) |
Definition at line 922 of file library_manager.cpp.
References AbortAsyncLoads(), LoadGlobalTables(), LoadProjectTables(), and PROJECT.
Referenced by DESIGN_BLOCK_PANE::AddDesignBlockLibrary(), PCB_BASE_EDIT_FRAME::AddLibrary(), SYMBOL_EDIT_FRAME::addLibTableEntry(), and SYMBOL_EDIT_FRAME::replaceLibTableEntry().
| bool LIBRARY_MANAGER::RemoveAdapter | ( | LIBRARY_TABLE_TYPE | aType, |
| LIBRARY_MANAGER_ADAPTER * | aAdapter ) |
Definition at line 675 of file library_manager.cpp.
References m_adapters, and m_adaptersMutex.
| std::vector< LIBRARY_TABLE_ROW * > LIBRARY_MANAGER::Rows | ( | LIBRARY_TABLE_TYPE | aType, |
| LIBRARY_TABLE_SCOPE | aScope = LIBRARY_TABLE_SCOPE::BOTH, | ||
| bool | aIncludeInvalid = false ) const |
Returns a flattened list of libraries of the given type.
| aType | determines which type of libraries to return (symbol, footprint, ...) |
| aIncludeInvalid | will include the nicknames of libraries even if they could not be loaded for some reason (file not found, etc) |
Definition at line 740 of file library_manager.cpp.
References BOTH, GLOBAL, m_childTables, m_projectTables, m_tables, PROJECT, table, LIBRARY_TABLE_ROW::TABLE_TYPE_NAME, and UNINITIALIZED.
Referenced by DESIGN_BLOCK_TREE_MODEL_ADAPTER::AddLibraries(), SYMBOL_TREE_MODEL_ADAPTER::AddLibraries(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), FindRowByURI(), SYMBOL_LIBRARY_MANAGER::GetLibraryNames(), GetRow(), and DIALOG_CONFIGURE_PATHS::TransferDataToWindow().
| void LIBRARY_MANAGER::SetLibOverride | ( | const wxString & | aTablePath, |
| const wxString & | aNickname, | ||
| bool | aDisabled, | ||
| bool | aHidden ) |
Set a user override for a library in a read-only nested table.
The override is saved to user settings so it persists across sessions.
| aTablePath | normalized path of the read-only library table file |
| aNickname | the library nickname to override |
| aDisabled | true to mark the library as disabled |
| aHidden | true to mark the library as hidden |
Definition at line 213 of file library_manager.cpp.
References ClearLibOverride(), SETTINGS_MANAGER::GetAppSettings(), PGM_BASE::GetSettingsManager(), KICAD_SETTINGS::m_LibOverrides, and Pgm().
Referenced by BOOST_AUTO_TEST_CASE(), and LIB_TABLE_NOTEBOOK_PANEL::SaveOverrides().
|
static |
Definition at line 429 of file library_manager.cpp.
References FN_NORMALIZE_FLAGS, PATHS::GetStockTemplatesPath(), and tableFileName().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), CreateGlobalTable(), STARTWIZARD_PROVIDER_LIBRARIES::Finish(), PANEL_STARTWIZARD_LIBRARIES::InitTableListMsg(), operator=(), and StockTableReferenceURI().
|
static |
When the versioned template-dir env var is defined externally to the process – as relocatable installs (AppImage, Nix) do at launch – this returns the unresolved StockTableTokenizedURI() so the reference re-resolves on every launch. Otherwise the variable is at its built-in default and this returns the resolved StockTablePath(), preserving the historical absolute-path behavior of standard installs.
Definition at line 448 of file library_manager.cpp.
References ENV_VAR::GetVersionedEnvVarName(), Pgm(), StockTablePath(), and StockTableTokenizedURI().
Referenced by BOOST_AUTO_TEST_CASE(), CreateGlobalTable(), and operator=().
|
static |
aType against the versioned template-dir env var, e.g. ${KICAD10_TEMPLATE_DIR}/sym-lib-table.Unlike StockTablePath() this URI stays unresolved, so it survives the per-launch prefix change of relocatable installs (AppImage, Nix).
Definition at line 440 of file library_manager.cpp.
References ENV_VAR::GetVersionedEnvVarName(), and tableFileName().
Referenced by BOOST_AUTO_TEST_CASE(), operator=(), and StockTableReferenceURI().
| std::optional< LIBRARY_TABLE * > LIBRARY_MANAGER::Table | ( | LIBRARY_TABLE_TYPE | aType, |
| LIBRARY_TABLE_SCOPE | aScope ) |
Retrieves a given table; creating a new empty project table if a valid project is loaded and the given table type doesn't exist in the project.
| aType | determines which type of table to return |
| aScope | determines whether to return a global or project table |
Definition at line 700 of file library_manager.cpp.
References BOTH, createEmptyTable(), GLOBAL, m_projectTables, m_tables, Pgm(), Prj(), PROJECT, traceLibraries, and UNINITIALIZED.
Referenced by DESIGN_BLOCK_PANE::AddDesignBlockLibrary(), PCB_BASE_EDIT_FRAME::AddLibrary(), SYMBOL_LIBRARY_MANAGER::addLibrary(), SYMBOL_EDIT_FRAME::AddLibraryFile(), SYMBOL_EDIT_FRAME::addLibTableEntry(), BOOST_AUTO_TEST_CASE(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), SYMBOL_EDIT_FRAME::DdAddLibrary(), EnsureRemoteLibraryEntry(), SCH_EDIT_FRAME::KiwayMailIn(), LoadGlobalTables(), PANEL_FP_LIB_TABLE::onReset(), PANEL_SYM_LIB_TABLE::onReset(), PANEL_DESIGN_BLOCK_LIB_TABLE::PANEL_DESIGN_BLOCK_LIB_TABLE(), PANEL_FP_LIB_TABLE::PANEL_FP_LIB_TABLE(), PANEL_SYM_LIB_TABLE::PANEL_SYM_LIB_TABLE(), SYMBOL_EDIT_FRAME::replaceLibTableEntry(), PANEL_DESIGN_BLOCK_LIB_TABLE::TransferDataFromWindow(), PANEL_FP_LIB_TABLE::TransferDataFromWindow(), PANEL_SYM_LIB_TABLE::TransferDataFromWindow(), and SYMBOL_LIB_TABLE_RESCUER::WriteRescueLibrary().
|
staticprivate |
Definition at line 250 of file library_manager.cpp.
References DESIGN_BLOCK, FILEEXT::DesignBlockLibraryTableFileName, FOOTPRINT, FILEEXT::FootprintLibraryTableFileName, SYMBOL, and FILEEXT::SymbolLibraryTableFileName.
Referenced by createEmptyTable(), DefaultGlobalTablePath(), InvalidGlobalTables(), loadTables(), StockTablePath(), and StockTableTokenizedURI().
|
static |
Definition at line 989 of file library_manager.cpp.
Referenced by LIBRARY_MANAGER_ADAPTER::FindLibraryByURI(), and FindRowByURI().
|
private |
Definition at line 445 of file library_manager.h.
Referenced by AbortAsyncLoads(), Adapter(), LoadGlobalTables(), LoadProjectTables(), ProjectChanged(), RegisterAdapter(), and RemoveAdapter().
|
mutableprivate |
Definition at line 447 of file library_manager.h.
Referenced by AbortAsyncLoads(), Adapter(), LoadGlobalTables(), LoadProjectTables(), ProjectChanged(), RegisterAdapter(), and RemoveAdapter().
|
private |
Map of full URI to table object for tables that are referenced by global or project tables.
Definition at line 440 of file library_manager.h.
Referenced by loadNestedTables(), and Rows().
|
private |
Definition at line 443 of file library_manager.h.
Referenced by createEmptyTable(), LoadProjectTables(), loadTables(), Rows(), and Table().
|
private |
Definition at line 451 of file library_manager.h.
Referenced by GetRow(), LoadProjectTables(), and loadTables().
|
mutableprivate |
Definition at line 452 of file library_manager.h.
Referenced by GetRow(), LoadProjectTables(), and loadTables().
|
private |
Definition at line 437 of file library_manager.h.
Referenced by createEmptyTable(), loadTables(), Rows(), and Table().