|
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 <symbol_library_adapter.h>
Public Types | |
| enum class | SYMBOL_TYPE { ALL_SYMBOLS , POWER_ONLY } |
| enum | SAVE_T { SAVE_OK , SAVE_SKIPPED } |
| The set of return values from SaveSymbol() below. More... | |
Public Member Functions | |
| SYMBOL_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 (const wxString &aNickname) |
| Loads or reloads the given library, if it exists. | |
| 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< wxString > | GetAvailableExtraFields (const wxString &aNickname) |
| Returns a list of additional (non-mandatory) symbol fields present in the given library. | |
| bool | SupportsSubLibraries (const wxString &aNickname) const |
| std::vector< SUB_LIBRARY > | GetSubLibraries (const wxString &aNickname) const |
| bool | SupportsConfigurationDialog (const wxString &aNickname) const override |
| void | ShowConfigurationDialog (const wxString &aNickname, wxWindow *aParent) const override |
| std::vector< LIB_SYMBOL * > | GetSymbols (const wxString &aNickname, SYMBOL_TYPE aType=SYMBOL_TYPE::ALL_SYMBOLS) |
| std::vector< wxString > | GetSymbolNames (const wxString &aNickname, SYMBOL_TYPE aType=SYMBOL_TYPE::ALL_SYMBOLS) |
| LIB_SYMBOL * | LoadSymbol (const wxString &aNickname, const wxString &aName) |
| Load a LIB_SYMBOL having aName from the library given by aNickname. | |
| LIB_SYMBOL * | LoadSymbol (const LIB_ID &aLibId) |
| SAVE_T | SaveSymbol (const wxString &aNickname, const LIB_SYMBOL *aSymbol, bool aOverwrite=true) |
| Write aSymbol to an existing library given by aNickname. | |
| void | DeleteSymbol (const wxString &aNickname, const wxString &aSymbolName) |
| Deletes the aSymbolName from the library given by aNickname. | |
| bool | IsSymbolLibWritable (const wxString &aNickname) |
| Return true if the library given by aNickname is writable. | |
| std::optional< LIBRARY_ERROR > | LibraryError (const wxString &aNickname) const override |
| int | GetModifyHash () const |
| 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. | |
| 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) | |
| 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. | |
Static Public Member Functions | |
| static wxString | GlobalPathEnvVariableName () |
Static Public Attributes | |
| static const char * | PropPowerSymsOnly = "pwr_sym_only" |
| static const char * | PropNonPowerSymsOnly = "non_pwr_sym_only" |
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. | |
| 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 SCH_IO * | schplugin (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 |
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 49 of file symbol_library_adapter.h.
The set of return values from SaveSymbol() below.
| Enumerator | |
|---|---|
| SAVE_OK | |
| SAVE_SKIPPED | |
Definition at line 111 of file symbol_library_adapter.h.
|
strong |
| Enumerator | |
|---|---|
| ALL_SYMBOLS | |
| POWER_ONLY | |
Definition at line 81 of file symbol_library_adapter.h.
| SYMBOL_LIBRARY_ADAPTER::SYMBOL_LIBRARY_ADAPTER | ( | LIBRARY_MANAGER & | aManager | ) |
Definition at line 47 of file symbol_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 887 of file library_manager.cpp.
References BlockUntilLoaded(), m_abort, m_futures, m_loadTotal, and traceLibraries.
Referenced by globalLibsMutex(), GlobalTablesChanged(), and ProjectChanged().
|
overridevirtual |
Loads all available libraries for this adapter type in the background.
Implements LIBRARY_MANAGER_ADAPTER.
Definition at line 228 of file symbol_library_adapter.cpp.
References 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, SYMBOL, tp, and traceLibraries.
Referenced by BOOST_AUTO_TEST_CASE(), EESCHEMA_JOBS_HANDLER::JobSchErc(), 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 904 of file library_manager.cpp.
References m_loadCount, and m_loadTotal.
Referenced by AsyncLoad(), BOOST_AUTO_TEST_CASE(), PGM_BASE::PreloadDesignBlockLibraries(), PCB::IFACE::PreloadLibraries(), and SCH::IFACE::PreloadLibraries().
|
inherited |
Definition at line 914 of file library_manager.cpp.
References m_futures.
Referenced by abortLoad(), AsyncLoad(), BOOST_AUTO_TEST_CASE(), EESCHEMA_JOBS_HANDLER::JobSchErc(), PGM_BASE::PreloadDesignBlockLibraries(), PCB::IFACE::PreloadLibraries(), and SCH::IFACE::PreloadLibraries().
|
inherited |
Creates the library (i.e. saves to disk) for the given row if it exists.
Definition at line 972 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 98 of file symbol_library_adapter.cpp.
References _, SCH_IO_MGR::EnumFromStr(), LIBRARY_TABLE_ROW::Nickname(), plugin(), LIBRARY_TABLE_ROW::Scope(), traceLibraries, and LIBRARY_TABLE_ROW::Type().
|
inherited |
Deletes the given library from disk if it exists; returns true if deleted.
Definition at line 835 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().
| void SYMBOL_LIBRARY_ADAPTER::DeleteSymbol | ( | const wxString & | aNickname, |
| const wxString & | aSymbolName ) |
Deletes the aSymbolName from the library given by aNickname.
| aNickname | is a locator for the "library", it is a "name" in LIB_TABLE_ROW. |
| aSymbolName | is the name of a symbol 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 210 of file symbol_library_adapter.cpp.
|
protectedinherited |
Definition at line 1019 of file library_manager.cpp.
References globalLibs(), LOADED, and m_libraries.
|
protectedinherited |
Definition at line 1000 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 799 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 879 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 > SYMBOL_LIBRARY_ADAPTER::GetAvailableExtraFields | ( | const wxString & | aNickname | ) |
Returns a list of additional (non-mandatory) symbol fields present in the given library.
Definition at line 389 of file symbol_library_adapter.cpp.
References LIB_DATA::available_fields_cache, LIBRARY_MANAGER_ADAPTER::fetchIfLoaded(), SCH_IO::GetAvailableSymbolFields(), SCH_IO::GetModifyHash(), LIB_DATA::modify_hash, result, and schplugin().
|
inherited |
Definition at line 856 of file library_manager.cpp.
References fetchIfLoaded().
Referenced by PCB_BASE_FRAME::GetLibraryItemsForListDialog(), SCH_BASE_FRAME::GetLibraryItemsForListDialog(), and Type().
|
inherited |
Returns a list of library nicknames that are available (skips any that failed to load)
Definition at line 811 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(), FOOTPRINT_LIST_IMPL::ReadFootprintFiles(), SYMBOL_VIEWER_FRAME::ReCreateLibList(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), SAVE_AS_DIALOG::SAVE_AS_DIALOG(), and Type().
|
overridevirtual |
Returns the status of a loaded library, or nullopt if the library hasn't been loaded (yet)
Implements LIBRARY_MANAGER_ADAPTER.
Definition at line 377 of file symbol_library_adapter.cpp.
References GlobalLibraries, and LIBRARY_MANAGER_ADAPTER::m_libraries.
|
inherited |
Returns a list of all library nicknames and their status (even if they failed to load)
Definition at line 936 of file library_manager.cpp.
References _, GetLibraryStatus(), LOAD_ERROR, m_manager, result, and Type().
Referenced by BOOST_AUTO_TEST_CASE(), GetLibraryStatus(), and SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync().
| int SYMBOL_LIBRARY_ADAPTER::GetModifyHash | ( | ) | const |
Definition at line 470 of file symbol_library_adapter.cpp.
References LIBRARY_MANAGER_ADAPTER::fetchIfLoaded(), SCH_IO::GetModifyHash(), LIBRARY_MANAGER_ADAPTER::m_manager, result, LIB_DATA::row, schplugin(), and Type().
Referenced by SYMBOL_LIBRARY_MANAGER::GetHash(), and LIB_SYMBOL_LIBRARY_MANAGER::Sync().
|
inherited |
Like LIBRARY_MANAGER::GetRow but filtered to the LIBRARY_TABLE_TYPE of this adapter.
Definition at line 872 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().
| std::vector< SUB_LIBRARY > SYMBOL_LIBRARY_ADAPTER::GetSubLibraries | ( | const wxString & | aNickname | ) | const |
Definition at line 424 of file symbol_library_adapter.cpp.
References LIBRARY_MANAGER_ADAPTER::fetchIfLoaded(), SCH_IO::GetSubLibraryDescription(), SCH_IO::GetSubLibraryNames(), name, result, and schplugin().
Referenced by SYMBOL_VIEWER_FRAME::ReCreateLibList().
| std::vector< wxString > SYMBOL_LIBRARY_ADAPTER::GetSymbolNames | ( | const wxString & | aNickname, |
| SYMBOL_TYPE | aType = SYMBOL_TYPE::ALL_SYMBOLS ) |
Definition at line 158 of file symbol_library_adapter.cpp.
References SCH_IO::EnumerateSymbolLib(), LIBRARY_MANAGER_ADAPTER::fetchIfLoaded(), LIBRARY_TABLE_ROW::GetOptionsMap(), LIBRARY_MANAGER_ADAPTER::getUri(), name, POWER_ONLY, PropPowerSymsOnly, LIB_DATA::row, and schplugin().
Referenced by DIALOG_EDIT_SYMBOLS_LIBID::onClickOrphansButton(), and SYMBOL_VIEWER_FRAME::ReCreateLibList().
| std::vector< LIB_SYMBOL * > SYMBOL_LIBRARY_ADAPTER::GetSymbols | ( | const wxString & | aNickname, |
| SYMBOL_TYPE | aType = SYMBOL_TYPE::ALL_SYMBOLS ) |
Definition at line 121 of file symbol_library_adapter.cpp.
References SCH_IO::EnumerateSymbolLib(), LIBRARY_MANAGER_ADAPTER::fetchIfLoaded(), LIBRARY_TABLE_ROW::GetOptionsMap(), LIBRARY_MANAGER_ADAPTER::getUri(), LIBRARY_TABLE_ROW::Nickname(), POWER_ONLY, PropPowerSymsOnly, LIB_DATA::row, schplugin(), LIB_ID::SetLibNickname(), traceLibraries, and IO_ERROR::What().
Referenced by BOOST_AUTO_TEST_CASE(), SYMBOL_LIBRARY_MANAGER::EnumerateSymbols(), SYMBOL_LIBRARY_MANAGER::getOriginalSymbols(), SYMBOL_LIB_TABLE_RESCUER::OpenRescueLibrary(), and SYMBOL_VIEWER_FRAME::ReCreateSymbolList().
|
staticprotectedinherited |
Definition at line 994 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(), FOOTPRINT_LIBRARY_ADAPTER::LoadOne(), SYMBOL_LIBRARY_ADAPTER::LoadOne(), SYMBOL_LIBRARY_ADAPTER::LoadSymbol(), DESIGN_BLOCK_LIBRARY_ADAPTER::SaveDesignBlock(), and FOOTPRINT_LIBRARY_ADAPTER::SaveFootprint().
|
inlineoverrideprotectedvirtual |
Implements LIBRARY_MANAGER_ADAPTER.
Definition at line 162 of file symbol_library_adapter.h.
References GlobalLibraries.
|
inlineoverrideprotectedvirtual |
Implements LIBRARY_MANAGER_ADAPTER.
Definition at line 161 of file symbol_library_adapter.h.
References GlobalLibraries.
|
inlineoverrideprotectedvirtual |
Implements LIBRARY_MANAGER_ADAPTER.
Definition at line 163 of file symbol_library_adapter.h.
References GlobalLibraryMutex.
|
static |
Definition at line 53 of file symbol_library_adapter.cpp.
References ENV_VAR::GetVersionedEnvVarName().
|
inherited |
Retrieves the global library table for this adapter type.
Definition at line 786 of file library_manager.cpp.
References GLOBAL, m_manager, and Type().
Referenced by SCH_EDITOR_CONTROL::ExportSymbolsToLibrary(), and Type().
|
inherited |
Notify the adapter that the global library tables have changed.
Definition at line 760 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 825 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().
|
inherited |
Definition at line 921 of file library_manager.cpp.
References globalLibs(), and m_libraries.
Referenced by AsyncLoad(), SYMBOL_LIBRARY_MANAGER::IsLibraryLoaded(), DRC_TEST_PROVIDER_LIBRARY_PARITY::Run(), and ERC_TESTER::TestLibSymbolIssues().
| bool SYMBOL_LIBRARY_ADAPTER::IsSymbolLibWritable | ( | const wxString & | aNickname | ) |
Return true if the library given by aNickname is writable.
It is possible that some symbols libraries are read only because of where they are installed.
| aNickname | is the library nickname in the symbol library table. |
| IO_ERROR | if no library at aNickname exists. |
Definition at line 216 of file symbol_library_adapter.cpp.
References LIBRARY_MANAGER_ADAPTER::getUri(), GlobalLibraries, and LIBRARY_MANAGER_ADAPTER::m_libraries.
Referenced by SYMBOL_LIBRARY_MANAGER::IsLibraryReadOnly().
|
virtualinherited |
Return true if the given nickname exists and is not a read-only library.
Definition at line 960 of file library_manager.cpp.
References fetchIfLoaded(), getUri(), IO_BASE::IsLibraryWritable(), LIB_DATA::plugin, result, and LIB_DATA::row.
Referenced by GetLibraryStatus().
|
overridevirtual |
Reimplemented from LIBRARY_MANAGER_ADAPTER.
Definition at line 360 of file symbol_library_adapter.cpp.
References GlobalLibraries, and LIBRARY_MANAGER_ADAPTER::m_libraries.
|
protectedinherited |
Fetches a loaded library, triggering a load of that library if it isn't loaded yet.
Definition at line 1035 of file library_manager.cpp.
References _, createPlugin(), GLOBAL, globalLibs(), globalLibsMutex(), LOADING, m_libraries, m_libraries_mutex, m_manager, LIBRARY_TABLE_ROW::Nickname(), plugin(), PROJECT, result, traceLibraries, and Type().
Referenced by CreateLibrary(), DeleteLibrary(), globalLibsMutex(), FOOTPRINT_LIBRARY_ADAPTER::LoadOne(), and SYMBOL_LIBRARY_ADAPTER::LoadOne().
| std::optional< LIB_STATUS > SYMBOL_LIBRARY_ADAPTER::LoadOne | ( | const wxString & | aNickname | ) |
Loads or reloads the given library, if it exists.
Definition at line 67 of file symbol_library_adapter.cpp.
References SCH_IO::EnumerateSymbolLib(), LIB_STATUS::error, LIBRARY_TABLE_ROW::GetOptionsMap(), LIBRARY_MANAGER_ADAPTER::getUri(), LOAD_ERROR, LIB_STATUS::load_status, LOADED, LIBRARY_MANAGER_ADAPTER::loadIfNeeded(), LOADING, LIB_DATA::mutex, result, LIB_DATA::row, schplugin(), LIB_DATA::status, traceLibraries, and IO_ERROR::What().
Referenced by SYMBOL_EDIT_FRAME::AddLibraryFile(), SYMBOL_EDIT_FRAME::addLibTableEntry(), BOOST_AUTO_TEST_CASE(), SCH_EDIT_FRAME::KiwayMailIn(), SCH_IO_CADSTAR_ARCHIVE::LoadSchematicFile(), SCH_IO_EAGLE::LoadSchematicFile(), SCH_IO_EASYEDAPRO::LoadSchematicFile(), and SYMBOL_EDIT_FRAME::replaceLibTableEntry().
|
inline |
Definition at line 103 of file symbol_library_adapter.h.
References LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), and LoadSymbol().
| LIB_SYMBOL * SYMBOL_LIBRARY_ADAPTER::LoadSymbol | ( | const wxString & | aNickname, |
| const wxString & | aName ) |
Load a LIB_SYMBOL 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 LIB_SYMBOL to load. |
| 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 182 of file symbol_library_adapter.cpp.
References LIBRARY_MANAGER_ADAPTER::fetchIfLoaded(), LIBRARY_MANAGER_ADAPTER::getUri(), SCH_IO::LoadSymbol(), schplugin(), LIB_ID::SetLibNickname(), and traceLibraries.
Referenced by BOOST_AUTO_TEST_CASE(), SCH_INSPECTION_TOOL::DiffSymbol(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), SYMBOL_LIBRARY_MANAGER::GetBufferedSymbol(), SYMBOL_VIEWER_FRAME::GetSelectedSymbol(), SYMBOL_LIBRARY_MANAGER::GetSymbol(), SCH_IO_EAGLE::loadInstance(), SYMBOL_EDIT_FRAME::LoadSymbol(), LoadSymbol(), SYMBOL_EDIT_FRAME::LoadSymbolFromCurrentLib(), PANEL_SYMBOL_CHOOSER::populateFootprintSelector(), SchGetLibSymbol(), PANEL_SYMBOL_CHOOSER::showFootprintFor(), SYMBOL_LIBRARY_MANAGER::SymbolExists(), ERC_TESTER::TestLibSymbolIssues(), DIALOG_EDIT_SYMBOLS_LIBID::TransferDataFromWindow(), and SCH_SCREEN::UpdateSymbolLinks().
|
inherited |
Definition at line 743 of file library_manager.cpp.
References m_manager.
Implements LIBRARY_MANAGER_ADAPTER.
Definition at line 167 of file symbol_library_adapter.h.
References schplugin().
Referenced by createPlugin().
|
virtualinherited |
Notify the adapter that the active project has changed.
Definition at line 749 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 793 of file library_manager.cpp.
References m_manager, PROJECT, and Type().
Referenced by SCH_EDITOR_CONTROL::ExportSymbolsToLibrary(), SCH_IO_CADSTAR_ARCHIVE::LoadSchematicFile(), SCH_IO_EAGLE::LoadSchematicFile(), SCH_IO_EASYEDAPRO::LoadSchematicFile(), SCH_EDIT_FRAME::LoadSheetFromFile(), and Type().
|
inherited |
Like LIBRARY_MANAGER::Rows but filtered to the LIBRARY_TABLE_TYPE of this adapter.
Definition at line 865 of file library_manager.cpp.
References m_manager, and Type().
Referenced by CVPCB_MAINFRAME::LoadFootprintFiles(), and Type().
| SYMBOL_LIBRARY_ADAPTER::SAVE_T SYMBOL_LIBRARY_ADAPTER::SaveSymbol | ( | const wxString & | aNickname, |
| const LIB_SYMBOL * | aSymbol, | ||
| bool | aOverwrite = true ) |
Write aSymbol to an existing library given by aNickname.
If a LIB_SYMBOL by the same name already exists or there are any conflicting alias names, the new LIB_SYMBOL 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 |
| aSymbol | is what to store in the library. The library owns the symbol 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 symbol. |
Definition at line 203 of file symbol_library_adapter.cpp.
References SAVE_SKIPPED.
Helper to cast the ABC plugin in the LIB_DATA* to a concrete plugin.
Definition at line 59 of file symbol_library_adapter.cpp.
References LIB_DATA::plugin.
Referenced by GetAvailableExtraFields(), GetModifyHash(), GetSubLibraries(), GetSymbolNames(), GetSymbols(), LoadOne(), LoadSymbol(), plugin(), and SupportsSubLibraries().
|
overridevirtual |
Reimplemented from LIBRARY_MANAGER_ADAPTER.
Definition at line 457 of file symbol_library_adapter.cpp.
References LIBRARY_MANAGER_ADAPTER::fetchIfLoaded(), and DIALOG_SHIM::ShowModal().
|
overridevirtual |
Reimplemented from LIBRARY_MANAGER_ADAPTER.
Definition at line 448 of file symbol_library_adapter.cpp.
References LIBRARY_MANAGER_ADAPTER::fetchIfLoaded(), and result.
| bool SYMBOL_LIBRARY_ADAPTER::SupportsSubLibraries | ( | const wxString & | aNickname | ) | const |
Definition at line 412 of file symbol_library_adapter.cpp.
References LIBRARY_MANAGER_ADAPTER::fetchIfLoaded(), result, schplugin(), and SCH_IO::SupportsSubLibraries().
Referenced by SYMBOL_VIEWER_FRAME::ReCreateLibList(), and SYMBOL_VIEWER_FRAME::ReCreateSymbolList().
|
inlineoverridevirtual |
The type of library table this adapter works with.
Implements LIBRARY_MANAGER_ADAPTER.
Definition at line 58 of file symbol_library_adapter.h.
References SYMBOL.
Referenced by GetModifyHash().
|
staticprivate |
Definition at line 175 of file symbol_library_adapter.h.
Referenced by AsyncLoad(), GetLibraryStatus(), globalLibs(), globalLibs(), IsSymbolLibWritable(), and LibraryError().
|
staticprivate |
Definition at line 177 of file symbol_library_adapter.h.
Referenced by AsyncLoad(), and globalLibsMutex().
|
protectedinherited |
Definition at line 191 of file library_manager.h.
Referenced by abortLoad().
|
protectedinherited |
Definition at line 192 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 187 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(), FOOTPRINT_LIBRARY_ADAPTER::LibraryError(), SYMBOL_LIBRARY_ADAPTER::LibraryError(), loadIfNeeded(), and ProjectChanged().
|
protectedinherited |
Definition at line 189 of file library_manager.h.
Referenced by DESIGN_BLOCK_LIBRARY_ADAPTER::AsyncLoad(), FOOTPRINT_LIBRARY_ADAPTER::AsyncLoad(), SYMBOL_LIBRARY_ADAPTER::AsyncLoad(), loadIfNeeded(), and ProjectChanged().
|
protectedinherited |
Definition at line 194 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 195 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 181 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(), loadIfNeeded(), Manager(), ProjectTable(), and Rows().
|
static |
Definition at line 53 of file symbol_library_adapter.h.
|
static |
Definition at line 52 of file symbol_library_adapter.h.
Referenced by SCH_IO_ALTIUM::doEnumerateSymbolLib(), SCH_IO_DATABASE::EnumerateSymbolLib(), SCH_IO_HTTP_LIB::EnumerateSymbolLib(), SCH_IO_KICAD_LEGACY::EnumerateSymbolLib(), SCH_IO_KICAD_LEGACY::EnumerateSymbolLib(), SCH_IO_KICAD_SEXPR::EnumerateSymbolLib(), SCH_IO_KICAD_SEXPR::EnumerateSymbolLib(), GetSymbolNames(), and GetSymbols().