KiCad PCB EDA Suite
|
Symbol library management helper that is specific to the symbol library editor frame. More...
#include <lib_symbol_library_manager.h>
Public Member Functions | |
LIB_SYMBOL_LIBRARY_MANAGER (SYMBOL_EDIT_FRAME &aFrame) | |
void | Sync (const wxString &aForceRefresh, std::function< void(int, int, const wxString &)> aProgressCallback) |
Updates the SYMBOL_LIBRARY_MANAGER data to synchronize with Symbol Library Table. | |
wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > & | GetAdapter () |
Return the adapter object that provides the stored data. | |
void | Preload (PROGRESS_REPORTER &aReporter) |
Preloads all symbol libraries in the symbol library table using SYMBOL_ASYNC_LOADER. | |
int | GetHash () const |
bool | HasModifications () const |
int | GetLibraryHash (const wxString &aLibrary) const |
Return a library hash value to determine if it has changed. | |
wxArrayString | GetLibraryNames () const |
Return the array of library names. | |
SYMBOL_LIB_TABLE_ROW * | GetLibrary (const wxString &aLibrary) const |
Find a single library within the (aggregate) library table. | |
std::list< LIB_SYMBOL * > | GetAliases (const wxString &aLibrary) const |
bool | CreateLibrary (const wxString &aFilePath, SYMBOL_LIB_TABLE &aTable) |
Create an empty library and adds it to the library table. | |
bool | AddLibrary (const wxString &aFilePath, SYMBOL_LIB_TABLE &aTable) |
Add an existing library. | |
bool | UpdateSymbol (LIB_SYMBOL *aSymbol, const wxString &aLibrary) |
Update the symbol buffer with a new version of the symbol. | |
bool | UpdateSymbolAfterRename (LIB_SYMBOL *aSymbol, const wxString &oldAlias, const wxString &aLibrary) |
Update the symbol buffer with a new version of the symbol when the name has changed. | |
bool | UpdateLibraryBuffer (const wxString &aLibrary) |
Update the library buffer with a new version of the library. | |
bool | RemoveSymbol (const wxString &aName, const wxString &aLibrary) |
Remove the symbol from the symbol buffer. | |
LIB_SYMBOL * | GetAlias (const wxString &aAlias, const wxString &aLibrary) const |
Return either an alias of a working LIB_SYMBOL copy, or alias of the original symbol if there is no working copy. | |
LIB_SYMBOL * | GetBufferedSymbol (const wxString &aAlias, const wxString &aLibrary) |
Return the symbol copy from the buffer. | |
SCH_SCREEN * | GetScreen (const wxString &aAlias, const wxString &aLibrary) |
Return the screen used to edit a specific symbol. | |
bool | SymbolExists (const wxString &aAlias, const wxString &aLibrary) const |
Return true if symbol with a specific alias exists in library (either original one or buffered). | |
bool | LibraryExists (const wxString &aLibrary, bool aCheckEnabled=false) const |
Return true if library exists. | |
bool | IsLibraryLoaded (const wxString &aLibrary) const |
Return true if the library was successfully loaded. | |
bool | IsLibraryModified (const wxString &aLibrary) const |
Return true if library has unsaved modifications. | |
bool | IsSymbolModified (const wxString &aAlias, const wxString &aLibrary) const |
Return true if symbol has unsaved modifications. | |
void | SetSymbolModified (const wxString &aAlias, const wxString &aLibrary) |
bool | ClearLibraryModified (const wxString &aLibrary) const |
Clear the modified flag for all symbols in a library. | |
bool | ClearSymbolModified (const wxString &aAlias, const wxString &aLibrary) const |
Clear the modified flag for a symbol. | |
bool | IsLibraryReadOnly (const wxString &aLibrary) const |
Return true if the library is stored in a read-only file. | |
bool | SaveLibrary (const wxString &aLibrary, const wxString &aFileName, SCH_IO_MGR::SCH_FILE_T aFileType=SCH_IO_MGR::SCH_FILE_T::SCH_LEGACY) |
Save library to a file, including unsaved changes. | |
LIB_ID | RevertSymbol (const wxString &aAlias, const wxString &aLibrary) |
Revert unsaved changes for a symbolicular symbol. | |
bool | RevertLibrary (const wxString &aLibrary) |
Revert unsaved changes for a symbolicular library. | |
bool | RevertAll () |
Revert all pending changes. | |
wxString | GetUniqueLibraryName () const |
Return a library name that is not currently in use. | |
void | GetSymbolNames (const wxString &aLibName, wxArrayString &aSymbolNames, SYMBOL_NAME_FILTER aFilter=SYMBOL_NAME_FILTER::ALL) |
bool | HasDerivedSymbols (const wxString &aSymbolName, const wxString &aLibraryName) |
Check if symbol aSymbolName in library aLibraryName is a root symbol that has derived symbols. | |
size_t | GetLibraryCount () const |
Protected Member Functions | |
void | OnDataChanged () const override |
Extract library name basing on the file name. | |
bool | addLibrary (const wxString &aFilePath, bool aCreate, SYMBOL_LIB_TABLE &aTable) |
Return the current Symbol Library Table. | |
SYMBOL_LIB_TABLE * | symTable () const |
Class to store a working copy of a LIB_SYMBOL object and editor context. | |
std::set< LIB_SYMBOL * > | getOriginalSymbols (const wxString &aLibrary) |
Return a set of LIB_SYMBOL objects belonging to the original library. | |
LIB_BUFFER & | getLibraryBuffer (const wxString &aLibrary) |
Return an existing library buffer or creates one to using Symbol Library Table to get the original data. | |
Static Protected Member Functions | |
static wxString | getLibraryName (const wxString &aFilePath) |
Helper function to add either existing or create new library. | |
Protected Attributes | |
std::map< wxString, LIB_BUFFER > | m_libs |
The library buffers. | |
SCH_BASE_FRAME & | m_frame |
Parent frame. | |
LIB_LOGGER * | m_logger |
Private Member Functions | |
SYMBOL_TREE_SYNCHRONIZING_ADAPTER * | getAdapter () |
Private Attributes | |
wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > | m_adapter |
int | m_syncHash |
Symbol lib table hash value from last synchronization. | |
Symbol library management helper that is specific to the symbol library editor frame.
The base class handles library manipulation; this one also handles synchronizing the LIB_TREE.
Definition at line 32 of file lib_symbol_library_manager.h.
LIB_SYMBOL_LIBRARY_MANAGER::LIB_SYMBOL_LIBRARY_MANAGER | ( | SYMBOL_EDIT_FRAME & | aFrame | ) |
Definition at line 26 of file lib_symbol_library_manager.cpp.
References SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Create(), and m_adapter.
|
protectedinherited |
Return the current Symbol Library Table.
Definition at line 735 of file symbol_library_manager.cpp.
References SYMBOL_LIB_TABLE::CreateSymbolLib(), SYMBOL_LIBRARY_MANAGER::getLibraryName(), SCH_IO_MGR::GuessPluginTypeFromLibPath(), LIB_TABLE::InsertRow(), SYMBOL_LIBRARY_MANAGER::LibraryExists(), SYMBOL_LIBRARY_MANAGER::m_frame, NormalizePath(), SYMBOL_LIBRARY_MANAGER::OnDataChanged(), Pgm(), KIWAY_HOLDER::Prj(), LIB_TABLE::RemoveRow(), and SCH_IO_MGR::ShowType().
Referenced by SYMBOL_LIBRARY_MANAGER::AddLibrary(), and SYMBOL_LIBRARY_MANAGER::CreateLibrary().
|
inlineinherited |
Add an existing library.
The library is added to the library table as well.
Definition at line 230 of file symbol_library_manager.h.
References SYMBOL_LIBRARY_MANAGER::addLibrary().
Referenced by SYMBOL_EDIT_FRAME::AddLibraryFile(), and SYMBOL_EDIT_FRAME::DdAddLibrary().
|
inherited |
Clear the modified flag for all symbols in a library.
Definition at line 319 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::m_libs, and BASE_SCREEN::SetContentModified().
Referenced by SYMBOL_EDIT_FRAME::saveLibrary().
|
inherited |
Clear the modified flag for a symbol.
Definition at line 338 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::m_libs.
Referenced by SYMBOL_EDIT_FRAME::Revert().
|
inlineinherited |
Create an empty library and adds it to the library table.
The library file is created.
Definition at line 222 of file symbol_library_manager.h.
References SYMBOL_LIBRARY_MANAGER::addLibrary().
Referenced by SYMBOL_EDIT_FRAME::AddLibraryFile(), and SCH_EDITOR_CONTROL::ExportSymbolsToLibrary().
|
inline |
Return the adapter object that provides the stored data.
Definition at line 46 of file lib_symbol_library_manager.h.
References m_adapter.
Referenced by SYMBOL_EDIT_FRAME::canCloseWindow(), SYMBOL_EDIT_FRAME::FreezeLibraryTree(), SYMBOL_EDITOR_CONTROL::RenameSymbol(), SYMBOL_TREE_PANE::SYMBOL_TREE_PANE(), SYMBOL_EDIT_FRAME::SyncLibraries(), and SYMBOL_EDIT_FRAME::ThawLibraryTree().
|
inlineprivate |
Definition at line 52 of file lib_symbol_library_manager.h.
References m_adapter.
Referenced by Sync().
|
inherited |
Return either an alias of a working LIB_SYMBOL copy, or alias of the original symbol if there is no working copy.
Definition at line 617 of file symbol_library_manager.cpp.
References _, DisplayErrorMessage(), SYMBOL_LIB_TABLE::LoadSymbol(), SYMBOL_LIBRARY_MANAGER::m_frame, SYMBOL_LIBRARY_MANAGER::m_libs, SYMBOL_LIBRARY_MANAGER::symTable(), and IO_ERROR::What().
Referenced by CheckSavingIntoOwnInheritance(), SYMBOL_EDIT_FRAME::CreateNewSymbol(), SYMBOL_SAVE_AS_HANDLER::DoSave(), SYMBOL_EDIT_FRAME::getTargetSymbol(), and DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow().
|
inherited |
Definition at line 372 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::LibraryExists(), SYMBOL_LIB_TABLE::LoadSymbolLib(), SYMBOL_LIBRARY_MANAGER::m_libs, IO_ERROR::Problem(), and SYMBOL_LIBRARY_MANAGER::symTable().
Referenced by SYMBOL_TREE_SYNCHRONIZING_ADAPTER::updateLibrary().
|
inherited |
Return the symbol copy from the buffer.
In case it does not exist yet, the copy is created. SYMBOL_LIBRARY_MANAGER retains the ownership.
Definition at line 405 of file symbol_library_manager.cpp.
References _, LIB_BUFFER::CreateBuffer(), DisplayErrorMessage(), SYMBOL_LIBRARY_MANAGER::getLibraryBuffer(), LIB_SYMBOL::GetName(), LIB_SYMBOL::GetParent(), LIB_BUFFER::GetSymbol(), LIB_SYMBOL::IsAlias(), SYMBOL_LIBRARY_MANAGER::LibraryExists(), SYMBOL_LIB_TABLE::LoadSymbol(), SYMBOL_LIBRARY_MANAGER::m_frame, LIB_SYMBOL::SetParent(), SYMBOL_LIBRARY_MANAGER::symTable(), THROW_IO_ERROR, and IO_ERROR::What().
Referenced by SYMBOL_EDIT_FRAME::CopySymbolToClipboard(), SYMBOL_EDIT_FRAME::DuplicateSymbol(), SYMBOL_EDIT_FRAME::IsCurrentSymbol(), SYMBOL_EDIT_FRAME::KiwayMailIn(), SYMBOL_EDIT_FRAME::LoadOneLibrarySymbolAux(), SYMBOL_EDIT_FRAME::LoadSymbol(), and SYMBOL_EDITOR_CONTROL::RenameSymbol().
|
inherited |
Definition at line 107 of file symbol_library_manager.cpp.
References SYMBOL_LIB_TABLE::GetModifyHash(), SYMBOL_LIBRARY_MANAGER::m_libs, name, and SYMBOL_LIBRARY_MANAGER::symTable().
Referenced by SYMBOL_LIBRARY_MANAGER::RevertAll(), and SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync().
|
inherited |
Find a single library within the (aggregate) library table.
Definition at line 152 of file symbol_library_manager.cpp.
References _, DisplayErrorMessage(), SYMBOL_LIB_TABLE::FindRow(), SYMBOL_LIBRARY_MANAGER::m_frame, SYMBOL_LIBRARY_MANAGER::symTable(), and IO_ERROR::What().
Referenced by SCH_EDITOR_CONTROL::ExportSymbolsToLibrary(), SYMBOL_LIBRARY_MANAGER::GetLibraryHash(), SYMBOL_LIBRARY_MANAGER::GetLibraryNames(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue(), SYMBOL_EDIT_FRAME::IsSymbolFromLegacyLibrary(), SYMBOL_EDIT_FRAME::LoadSymbol(), SYMBOL_EDITOR_CONTROL::OpenDirectory(), SYMBOL_EDITOR_CONTROL::OpenWithTextEditor(), SYMBOL_LIBRARY_MANAGER::SaveLibrary(), and SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync().
|
protectedinherited |
Return an existing library buffer or creates one to using Symbol Library Table to get the original data.
Definition at line 808 of file symbol_library_manager.cpp.
References LIB_BUFFER::CreateBuffer(), SYMBOL_LIBRARY_MANAGER::getOriginalSymbols(), LIB_BUFFER::GetSymbol(), and SYMBOL_LIBRARY_MANAGER::m_libs.
Referenced by SYMBOL_LIBRARY_MANAGER::GetBufferedSymbol(), SYMBOL_LIBRARY_MANAGER::GetSymbolNames(), SYMBOL_LIBRARY_MANAGER::HasDerivedSymbols(), SYMBOL_LIBRARY_MANAGER::RemoveSymbol(), SYMBOL_LIBRARY_MANAGER::UpdateLibraryBuffer(), SYMBOL_LIBRARY_MANAGER::UpdateSymbol(), and SYMBOL_LIBRARY_MANAGER::UpdateSymbolAfterRename().
|
inherited |
Definition at line 722 of file symbol_library_manager.cpp.
References LIB_TABLE::GetLogicalLibs(), and SYMBOL_LIBRARY_MANAGER::symTable().
|
inherited |
Return a library hash value to determine if it has changed.
For buffered libraries, it returns a number corresponding to the number of modifications. For original libraries, hash is computed basing on the library URI. Returns -1 when the requested library does not exist.
Definition at line 118 of file symbol_library_manager.cpp.
References LIB_TABLE_ROW::GetFullURI(), SYMBOL_LIBRARY_MANAGER::GetLibrary(), and SYMBOL_LIBRARY_MANAGER::m_libs.
Referenced by SYMBOL_TREE_SYNCHRONIZING_ADAPTER::updateLibrary().
|
staticprotectedinherited |
Helper function to add either existing or create new library.
Definition at line 728 of file symbol_library_manager.cpp.
Referenced by SYMBOL_LIBRARY_MANAGER::addLibrary().
|
inherited |
Return the array of library names.
Definition at line 133 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::GetLibrary(), res, SYMBOL_LIB_TABLE_ROW::SchLibType(), and SYMBOL_LIBRARY_MANAGER::symTable().
Referenced by SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetLibrariesCount(), SYMBOL_EDIT_FRAME::IsContentModified(), SYMBOL_EDIT_FRAME::saveAllLibraries(), and SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync().
|
protectedinherited |
Return a set of LIB_SYMBOL objects belonging to the original library.
Definition at line 780 of file symbol_library_manager.cpp.
References _, DisplayErrorMessage(), SYMBOL_LIB_TABLE::EnumerateSymbolLib(), SYMBOL_LIBRARY_MANAGER::LibraryExists(), SYMBOL_LIB_TABLE::LoadSymbol(), SYMBOL_LIBRARY_MANAGER::m_frame, SYMBOL_LIBRARY_MANAGER::symTable(), and IO_ERROR::What().
Referenced by SYMBOL_LIBRARY_MANAGER::getLibraryBuffer(), and SYMBOL_LIBRARY_MANAGER::SaveLibrary().
|
inherited |
Return the screen used to edit a specific symbol.
SYMBOL_LIBRARY_MANAGER retains the ownership.
Definition at line 468 of file symbol_library_manager.cpp.
References LIB_BUFFER::GetBuffer(), SYMBOL_LIBRARY_MANAGER::LibraryExists(), and SYMBOL_LIBRARY_MANAGER::m_libs.
Referenced by SYMBOL_EDIT_FRAME::KiwayMailIn(), and SYMBOL_EDIT_FRAME::LoadOneLibrarySymbolAux().
|
inherited |
Definition at line 703 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::getLibraryBuffer(), and LIB_BUFFER::GetSymbolNames().
Referenced by SYMBOL_EDIT_FRAME::CreateNewSymbol(), and DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow().
|
inherited |
Return a library name that is not currently in use.
Used for generating names for new libraries.
Definition at line 683 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::LibraryExists(), and name.
Referenced by SYMBOL_EDIT_FRAME::AddLibraryFile().
|
inherited |
Check if symbol aSymbolName in library aLibraryName is a root symbol that has derived symbols.
Definition at line 713 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::getLibraryBuffer(), and LIB_BUFFER::HasDerivedSymbols().
Referenced by SYMBOL_EDIT_FRAME::DeleteSymbolFromLibrary().
|
inherited |
Definition at line 95 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::m_libs, and name.
Referenced by SYMBOL_EDIT_FRAME::HasLibModifications().
|
inherited |
Return true if the library was successfully loaded.
Definition at line 363 of file symbol_library_manager.cpp.
References SYMBOL_LIB_TABLE::IsSymbolLibLoaded(), SYMBOL_LIBRARY_MANAGER::LibraryExists(), and SYMBOL_LIBRARY_MANAGER::symTable().
Referenced by SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetAttr(), and SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue().
|
inherited |
Return true if library has unsaved modifications.
Definition at line 281 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::m_libs.
Referenced by SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetAttr(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue(), SYMBOL_EDITOR_CONTROL::Init(), SYMBOL_EDIT_FRAME::IsContentModified(), and SYMBOL_EDIT_FRAME::saveAllLibraries().
|
inherited |
Return true if the library is stored in a read-only file.
Definition at line 354 of file symbol_library_manager.cpp.
References SYMBOL_LIB_TABLE::IsSymbolLibWritable(), SYMBOL_LIBRARY_MANAGER::LibraryExists(), and SYMBOL_LIBRARY_MANAGER::symTable().
Referenced by SYMBOL_EDITOR_CONTROL::AddSymbol(), SYMBOL_EDITOR_CONTROL::CutCopyDelete(), SYMBOL_EDITOR_CONTROL::DuplicateSymbol(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue(), SYMBOL_EDIT_FRAME::IsContentModified(), SYMBOL_EDIT_FRAME::Save(), SYMBOL_EDIT_FRAME::saveAllLibraries(), SYMBOL_EDIT_FRAME::saveCurrentSymbol(), SYMBOL_EDIT_FRAME::saveLibrary(), SYMBOL_EDIT_FRAME::saveSymbolCopyAs(), SYMBOL_EDIT_FRAME::SetCurSymbol(), and SYMBOL_EDIT_FRAME::UpdateTitle().
|
inherited |
Return true if symbol has unsaved modifications.
Definition at line 288 of file symbol_library_manager.cpp.
References LIB_BUFFER::GetBuffer(), and SYMBOL_LIBRARY_MANAGER::m_libs.
Referenced by SYMBOL_EDIT_FRAME::DeleteSymbolFromLibrary(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetAttr(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue(), and SYMBOL_EDIT_FRAME::setupUIConditions().
|
inherited |
Return true if library exists.
If aCheckEnabled is set, then the library must also be enabled in the library table.
Definition at line 671 of file symbol_library_manager.cpp.
References LIB_TABLE::HasLibrary(), SYMBOL_LIBRARY_MANAGER::m_libs, and SYMBOL_LIBRARY_MANAGER::symTable().
Referenced by SYMBOL_LIBRARY_MANAGER::addLibrary(), SYMBOL_EDIT_FRAME::AddLibraryFile(), SYMBOL_EDIT_FRAME::CreateNewSymbol(), SYMBOL_EDIT_FRAME::DdAddLibrary(), SYMBOL_EDIT_FRAME::DuplicateSymbol(), SYMBOL_LIBRARY_MANAGER::GetAliases(), SYMBOL_LIBRARY_MANAGER::GetBufferedSymbol(), SYMBOL_LIBRARY_MANAGER::getOriginalSymbols(), SYMBOL_LIBRARY_MANAGER::GetScreen(), SYMBOL_LIBRARY_MANAGER::GetUniqueLibraryName(), SYMBOL_EDIT_FRAME::ImportSymbol(), SYMBOL_LIBRARY_MANAGER::IsLibraryLoaded(), SYMBOL_LIBRARY_MANAGER::IsLibraryReadOnly(), SYMBOL_EDITOR_CONTROL::RenameSymbol(), SYMBOL_LIBRARY_MANAGER::SaveLibrary(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync(), and SYMBOL_LIBRARY_MANAGER::UpdateSymbol().
|
overrideprotectedvirtual |
Extract library name basing on the file name.
Reimplemented from SYMBOL_LIBRARY_MANAGER.
Definition at line 48 of file lib_symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::m_frame.
|
inherited |
Preloads all symbol libraries in the symbol library table using SYMBOL_ASYNC_LOADER.
Call before the first call to Sync() to get better performance.
aReporter | is used to report progress of the load |
Definition at line 61 of file symbol_library_manager.cpp.
References _, HTML_MESSAGE_BOX::AddHTML_Text(), SYMBOL_ASYNC_LOADER::Done(), SYMBOL_ASYNC_LOADER::GetErrors(), SYMBOL_ASYNC_LOADER::Join(), PROGRESS_REPORTER::KeepRefreshing(), SYMBOL_LIBRARY_MANAGER::m_frame, HTML_MESSAGE_BOX::MessageSet(), DIALOG_SHIM::ShowModal(), SYMBOL_ASYNC_LOADER::Start(), and SYMBOL_LIBRARY_MANAGER::symTable().
|
inherited |
Remove the symbol from the symbol buffer.
It is required to save the library to have the symbol removed in the schematic editor.
Definition at line 602 of file symbol_library_manager.cpp.
References LIB_BUFFER::DeleteBuffer(), LIB_BUFFER::GetBuffer(), SYMBOL_LIBRARY_MANAGER::getLibraryBuffer(), and SYMBOL_LIBRARY_MANAGER::OnDataChanged().
Referenced by SYMBOL_EDIT_FRAME::DeleteSymbolFromLibrary().
|
inherited |
Revert all pending changes.
Definition at line 576 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::GetHash(), SYMBOL_LIBRARY_MANAGER::m_libs, and SYMBOL_LIBRARY_MANAGER::RevertSymbol().
Referenced by SYMBOL_EDIT_FRAME::RevertAll().
|
inherited |
Revert unsaved changes for a symbolicular library.
Definition at line 562 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::m_libs, and SYMBOL_LIBRARY_MANAGER::OnDataChanged().
Referenced by SYMBOL_EDIT_FRAME::Revert().
|
inherited |
Revert unsaved changes for a symbolicular symbol.
Definition at line 536 of file symbol_library_manager.cpp.
References LIB_SYMBOL::GetName(), SYMBOL_LIBRARY_MANAGER::m_libs, SYMBOL_LIBRARY_MANAGER::OnDataChanged(), and SYMBOL_LIBRARY_MANAGER::UpdateSymbolAfterRename().
Referenced by SYMBOL_EDIT_FRAME::Revert(), and SYMBOL_LIBRARY_MANAGER::RevertAll().
|
inherited |
Save library to a file, including unsaved changes.
aLibrary | is the library name. |
aFileName | is the target file name. |
Definition at line 172 of file symbol_library_manager.cpp.
References LIB_BUFFER::ClearDeletedBuffer(), FN_NORMALIZE_FLAGS, LIB_BUFFER::GetBuffers(), LIB_TABLE_ROW::GetFullURI(), SYMBOL_LIBRARY_MANAGER::GetLibrary(), SYMBOL_LIBRARY_MANAGER::getOriginalSymbols(), LIB_SYMBOL::GetParent(), SYMBOL_LIBRARY_MANAGER::LibraryExists(), SYMBOL_LIBRARY_MANAGER::m_libs, SCH_IO_KICAD_LEGACY::PropBuffering, res, LIB_BUFFER::SaveBuffer(), and LIB_SYMBOL::SetParent().
Referenced by SYMBOL_EDIT_FRAME::saveLibrary().
|
inherited |
Definition at line 303 of file symbol_library_manager.cpp.
References LIB_BUFFER::GetBuffer(), and SYMBOL_LIBRARY_MANAGER::m_libs.
Referenced by SYMBOL_EDITOR_CONTROL::RenameSymbol().
|
inherited |
Return true if symbol with a specific alias exists in library (either original one or buffered).
Definition at line 650 of file symbol_library_manager.cpp.
References SYMBOL_LIB_TABLE::LoadSymbol(), SYMBOL_LIBRARY_MANAGER::m_libs, and SYMBOL_LIBRARY_MANAGER::symTable().
Referenced by CheckForParentalChainConflicts(), CheckSavingIntoOwnInheritance(), SYMBOL_EDIT_FRAME::CreateNewSymbol(), SYMBOL_EDIT_FRAME::ensureUniqueName(), SYMBOL_EDIT_FRAME::ImportSymbol(), SYMBOL_EDITOR_CONTROL::RenameSymbol(), SYMBOL_SAVE_AS_HANDLER::resolveConflict(), SYMBOL_EDIT_FRAME::Revert(), DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow(), and SYMBOL_EDIT_FRAME::UpdateAfterSymbolProperties().
|
protectedinherited |
Class to store a working copy of a LIB_SYMBOL object and editor context.
Definition at line 774 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::m_frame, KIWAY_HOLDER::Prj(), and PROJECT_SCH::SchSymbolLibTable().
Referenced by SYMBOL_LIBRARY_MANAGER::GetAlias(), SYMBOL_LIBRARY_MANAGER::GetAliases(), SYMBOL_LIBRARY_MANAGER::GetBufferedSymbol(), SYMBOL_LIBRARY_MANAGER::GetHash(), SYMBOL_LIBRARY_MANAGER::GetLibrary(), SYMBOL_LIBRARY_MANAGER::GetLibraryCount(), SYMBOL_LIBRARY_MANAGER::GetLibraryNames(), SYMBOL_LIBRARY_MANAGER::getOriginalSymbols(), SYMBOL_LIBRARY_MANAGER::IsLibraryLoaded(), SYMBOL_LIBRARY_MANAGER::IsLibraryReadOnly(), SYMBOL_LIBRARY_MANAGER::LibraryExists(), SYMBOL_LIBRARY_MANAGER::Preload(), SYMBOL_LIBRARY_MANAGER::SymbolExists(), and Sync().
void LIB_SYMBOL_LIBRARY_MANAGER::Sync | ( | const wxString & | aForceRefresh, |
std::function< void(int, int, const wxString &)> | aProgressCallback | ||
) |
Updates the SYMBOL_LIBRARY_MANAGER data to synchronize with Symbol Library Table.
Definition at line 35 of file lib_symbol_library_manager.cpp.
References LIB_LOGGER::Activate(), LIB_LOGGER::Deactivate(), getAdapter(), SYMBOL_LIB_TABLE::GetModifyHash(), SYMBOL_LIBRARY_MANAGER::m_logger, m_syncHash, SYMBOL_LIBRARY_MANAGER::symTable(), and SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync().
Referenced by SYMBOL_EDIT_FRAME::SyncLibraries().
|
inherited |
Update the library buffer with a new version of the library.
Definition at line 853 of file symbol_library_manager.cpp.
References _, SYMBOL_LIBRARY_MANAGER::getLibraryBuffer(), and SYMBOL_LIBRARY_MANAGER::m_libs.
Referenced by SYMBOL_EDIT_FRAME::KiwayMailIn().
|
inherited |
Update the symbol buffer with a new version of the symbol.
The library buffer creates a copy of the symbol. It is required to save the library to use the updated symbol in the schematic editor.
Definition at line 484 of file symbol_library_manager.cpp.
References LIB_BUFFER::CreateBuffer(), LIB_BUFFER::GetBuffer(), LIB_SYMBOL::GetLibId(), LIB_ID::GetLibItemName(), SYMBOL_LIBRARY_MANAGER::getLibraryBuffer(), LIB_SYMBOL::GetName(), SYMBOL_LIBRARY_MANAGER::LibraryExists(), BASE_SCREEN::SetContentModified(), and LIB_SYMBOL::SetLibId().
Referenced by SYMBOL_EDIT_FRAME::CreateNewSymbol(), SYMBOL_SAVE_AS_HANDLER::DoSave(), SYMBOL_EDIT_FRAME::DuplicateSymbol(), SYMBOL_EDIT_FRAME::ImportSymbol(), and SYMBOL_EDIT_FRAME::storeCurrentSymbol().
|
inherited |
Update the symbol buffer with a new version of the symbol when the name has changed.
The old library buffer will be deleted and a new one created with the new name.
Definition at line 521 of file symbol_library_manager.cpp.
References LIB_BUFFER::GetBuffer(), SYMBOL_LIBRARY_MANAGER::getLibraryBuffer(), SYMBOL_LIBRARY_MANAGER::OnDataChanged(), and LIB_BUFFER::UpdateBuffer().
Referenced by SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), SYMBOL_EDITOR_CONTROL::RenameSymbol(), SYMBOL_LIBRARY_MANAGER::RevertSymbol(), and SYMBOL_EDIT_FRAME::UpdateAfterSymbolProperties().
|
private |
Definition at line 57 of file lib_symbol_library_manager.h.
Referenced by GetAdapter(), getAdapter(), and LIB_SYMBOL_LIBRARY_MANAGER().
|
protectedinherited |
Parent frame.
Definition at line 402 of file symbol_library_manager.h.
Referenced by SYMBOL_LIBRARY_MANAGER::addLibrary(), SYMBOL_LIBRARY_MANAGER::GetAlias(), SYMBOL_LIBRARY_MANAGER::GetBufferedSymbol(), SYMBOL_LIBRARY_MANAGER::GetLibrary(), SYMBOL_LIBRARY_MANAGER::getOriginalSymbols(), OnDataChanged(), SYMBOL_LIBRARY_MANAGER::Preload(), and SYMBOL_LIBRARY_MANAGER::symTable().
|
protectedinherited |
The library buffers.
Definition at line 401 of file symbol_library_manager.h.
Referenced by SYMBOL_LIBRARY_MANAGER::ClearLibraryModified(), SYMBOL_LIBRARY_MANAGER::ClearSymbolModified(), SYMBOL_LIBRARY_MANAGER::GetAlias(), SYMBOL_LIBRARY_MANAGER::GetAliases(), SYMBOL_LIBRARY_MANAGER::GetHash(), SYMBOL_LIBRARY_MANAGER::getLibraryBuffer(), SYMBOL_LIBRARY_MANAGER::GetLibraryHash(), SYMBOL_LIBRARY_MANAGER::GetScreen(), SYMBOL_LIBRARY_MANAGER::HasModifications(), SYMBOL_LIBRARY_MANAGER::IsLibraryModified(), SYMBOL_LIBRARY_MANAGER::IsSymbolModified(), SYMBOL_LIBRARY_MANAGER::LibraryExists(), SYMBOL_LIBRARY_MANAGER::RevertAll(), SYMBOL_LIBRARY_MANAGER::RevertLibrary(), SYMBOL_LIBRARY_MANAGER::RevertSymbol(), SYMBOL_LIBRARY_MANAGER::SaveLibrary(), SYMBOL_LIBRARY_MANAGER::SetSymbolModified(), SYMBOL_LIBRARY_MANAGER::SymbolExists(), and SYMBOL_LIBRARY_MANAGER::UpdateLibraryBuffer().
|
protectedinherited |
Definition at line 403 of file symbol_library_manager.h.
Referenced by SYMBOL_LIBRARY_MANAGER::SYMBOL_LIBRARY_MANAGER(), Sync(), and SYMBOL_LIBRARY_MANAGER::~SYMBOL_LIBRARY_MANAGER().
|
private |
Symbol lib table hash value from last synchronization.
Definition at line 59 of file lib_symbol_library_manager.h.
Referenced by Sync().