KiCad PCB EDA Suite
|
Class to handle modifications to the symbol libraries. More...
#include <symbol_library_manager.h>
Public Member Functions | |
SYMBOL_LIBRARY_MANAGER (SCH_BASE_FRAME &aFrame) | |
virtual | ~SYMBOL_LIBRARY_MANAGER () |
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 | |
virtual void | OnDataChanged () const |
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 |
Class to handle modifications to the symbol libraries.
Definition at line 181 of file symbol_library_manager.h.
SYMBOL_LIBRARY_MANAGER::SYMBOL_LIBRARY_MANAGER | ( | SCH_BASE_FRAME & | aFrame | ) |
Definition at line 48 of file symbol_library_manager.cpp.
References m_logger.
|
virtual |
Definition at line 55 of file symbol_library_manager.cpp.
References m_logger.
|
protected |
Return the current Symbol Library Table.
Definition at line 733 of file symbol_library_manager.cpp.
References SYMBOL_LIB_TABLE::CreateSymbolLib(), getLibraryName(), SCH_IO_MGR::GuessPluginTypeFromLibPath(), LIB_TABLE::InsertRow(), LibraryExists(), m_frame, NormalizePath(), OnDataChanged(), Pgm(), KIWAY_HOLDER::Prj(), LIB_TABLE::RemoveRow(), and SCH_IO_MGR::ShowType().
Referenced by AddLibrary(), and CreateLibrary().
|
inline |
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 addLibrary().
Referenced by SYMBOL_EDIT_FRAME::AddLibraryFile(), and SYMBOL_EDIT_FRAME::DdAddLibrary().
bool SYMBOL_LIBRARY_MANAGER::ClearLibraryModified | ( | const wxString & | aLibrary | ) | const |
Clear the modified flag for all symbols in a library.
Definition at line 317 of file symbol_library_manager.cpp.
References m_libs, and BASE_SCREEN::SetContentModified().
Referenced by SYMBOL_EDIT_FRAME::saveLibrary().
bool SYMBOL_LIBRARY_MANAGER::ClearSymbolModified | ( | const wxString & | aAlias, |
const wxString & | aLibrary | ||
) | const |
Clear the modified flag for a symbol.
Definition at line 336 of file symbol_library_manager.cpp.
References m_libs.
Referenced by SYMBOL_EDIT_FRAME::Revert().
|
inline |
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 addLibrary().
Referenced by SYMBOL_EDIT_FRAME::AddLibraryFile(), and SCH_EDITOR_CONTROL::ExportSymbolsToLibrary().
LIB_SYMBOL * SYMBOL_LIBRARY_MANAGER::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.
Definition at line 615 of file symbol_library_manager.cpp.
References _, DisplayErrorMessage(), SYMBOL_LIB_TABLE::LoadSymbol(), m_frame, m_libs, 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().
std::list< LIB_SYMBOL * > SYMBOL_LIBRARY_MANAGER::GetAliases | ( | const wxString & | aLibrary | ) | const |
Definition at line 370 of file symbol_library_manager.cpp.
References LibraryExists(), SYMBOL_LIB_TABLE::LoadSymbolLib(), m_libs, IO_ERROR::Problem(), and symTable().
Referenced by SYMBOL_TREE_SYNCHRONIZING_ADAPTER::updateLibrary().
LIB_SYMBOL * SYMBOL_LIBRARY_MANAGER::GetBufferedSymbol | ( | const wxString & | aAlias, |
const wxString & | aLibrary | ||
) |
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 403 of file symbol_library_manager.cpp.
References _, LIB_BUFFER::CreateBuffer(), DisplayErrorMessage(), getLibraryBuffer(), LIB_SYMBOL::GetName(), LIB_SYMBOL::GetParent(), LIB_BUFFER::GetSymbol(), LIB_SYMBOL::IsAlias(), LibraryExists(), SYMBOL_LIB_TABLE::LoadSymbol(), m_frame, LIB_SYMBOL::SetParent(), symTable(), THROW_IO_ERROR, and IO_ERROR::What().
Referenced by SYMBOL_EDIT_FRAME::CopySymbolToClipboard(), SYMBOL_EDIT_FRAME::CreateNewSymbol(), 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().
int SYMBOL_LIBRARY_MANAGER::GetHash | ( | ) | const |
Definition at line 107 of file symbol_library_manager.cpp.
References SYMBOL_LIB_TABLE::GetModifyHash(), m_libs, name, and symTable().
Referenced by RevertAll(), and SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync().
SYMBOL_LIB_TABLE_ROW * SYMBOL_LIBRARY_MANAGER::GetLibrary | ( | const wxString & | aLibrary | ) | const |
Find a single library within the (aggregate) library table.
Definition at line 150 of file symbol_library_manager.cpp.
References _, DisplayErrorMessage(), SYMBOL_LIB_TABLE::FindRow(), m_frame, symTable(), and IO_ERROR::What().
Referenced by SCH_EDITOR_CONTROL::ExportSymbolsToLibrary(), GetLibraryHash(), GetLibraryNames(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue(), SYMBOL_EDIT_FRAME::IsSymbolFromLegacyLibrary(), SYMBOL_EDIT_FRAME::LoadSymbol(), SYMBOL_EDITOR_CONTROL::OpenDirectory(), SYMBOL_EDITOR_CONTROL::OpenWithTextEditor(), SaveLibrary(), and SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync().
|
protected |
Return an existing library buffer or creates one to using Symbol Library Table to get the original data.
Definition at line 806 of file symbol_library_manager.cpp.
References LIB_BUFFER::CreateBuffer(), getOriginalSymbols(), LIB_BUFFER::GetSymbol(), and m_libs.
Referenced by GetBufferedSymbol(), GetSymbolNames(), HasDerivedSymbols(), RemoveSymbol(), UpdateLibraryBuffer(), UpdateSymbol(), and UpdateSymbolAfterRename().
size_t SYMBOL_LIBRARY_MANAGER::GetLibraryCount | ( | ) | const |
Definition at line 720 of file symbol_library_manager.cpp.
References LIB_TABLE::GetLogicalLibs(), and symTable().
int SYMBOL_LIBRARY_MANAGER::GetLibraryHash | ( | const wxString & | aLibrary | ) | const |
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(), GetLibrary(), and m_libs.
Referenced by SYMBOL_TREE_SYNCHRONIZING_ADAPTER::updateLibrary().
|
staticprotected |
Helper function to add either existing or create new library.
Definition at line 726 of file symbol_library_manager.cpp.
Referenced by addLibrary().
wxArrayString SYMBOL_LIBRARY_MANAGER::GetLibraryNames | ( | ) | const |
Return the array of library names.
Definition at line 133 of file symbol_library_manager.cpp.
References GetLibrary(), res, and symTable().
Referenced by SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetLibrariesCount(), SYMBOL_EDIT_FRAME::IsContentModified(), SYMBOL_EDIT_FRAME::saveAllLibraries(), and SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync().
|
protected |
Return a set of LIB_SYMBOL objects belonging to the original library.
Definition at line 778 of file symbol_library_manager.cpp.
References _, DisplayErrorMessage(), SYMBOL_LIB_TABLE::EnumerateSymbolLib(), LibraryExists(), SYMBOL_LIB_TABLE::LoadSymbol(), m_frame, symTable(), and IO_ERROR::What().
Referenced by getLibraryBuffer(), and SaveLibrary().
SCH_SCREEN * SYMBOL_LIBRARY_MANAGER::GetScreen | ( | const wxString & | aAlias, |
const wxString & | aLibrary | ||
) |
Return the screen used to edit a specific symbol.
SYMBOL_LIBRARY_MANAGER retains the ownership.
Definition at line 466 of file symbol_library_manager.cpp.
References LIB_BUFFER::GetBuffer(), LibraryExists(), and m_libs.
Referenced by SYMBOL_EDIT_FRAME::KiwayMailIn(), and SYMBOL_EDIT_FRAME::LoadOneLibrarySymbolAux().
void SYMBOL_LIBRARY_MANAGER::GetSymbolNames | ( | const wxString & | aLibName, |
wxArrayString & | aSymbolNames, | ||
SYMBOL_NAME_FILTER | aFilter = SYMBOL_NAME_FILTER::ALL |
||
) |
Definition at line 701 of file symbol_library_manager.cpp.
References getLibraryBuffer(), and LIB_BUFFER::GetSymbolNames().
Referenced by SYMBOL_EDIT_FRAME::CreateNewSymbol(), and DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow().
wxString SYMBOL_LIBRARY_MANAGER::GetUniqueLibraryName | ( | ) | const |
Return a library name that is not currently in use.
Used for generating names for new libraries.
Definition at line 681 of file symbol_library_manager.cpp.
References LibraryExists(), and name.
Referenced by SYMBOL_EDIT_FRAME::AddLibraryFile().
bool SYMBOL_LIBRARY_MANAGER::HasDerivedSymbols | ( | const wxString & | aSymbolName, |
const wxString & | aLibraryName | ||
) |
Check if symbol aSymbolName in library aLibraryName is a root symbol that has derived symbols.
Definition at line 711 of file symbol_library_manager.cpp.
References getLibraryBuffer(), and LIB_BUFFER::HasDerivedSymbols().
Referenced by SYMBOL_EDIT_FRAME::DeleteSymbolFromLibrary().
bool SYMBOL_LIBRARY_MANAGER::HasModifications | ( | ) | const |
Definition at line 95 of file symbol_library_manager.cpp.
Referenced by SYMBOL_EDIT_FRAME::HasLibModifications().
bool SYMBOL_LIBRARY_MANAGER::IsLibraryLoaded | ( | const wxString & | aLibrary | ) | const |
Return true if the library was successfully loaded.
Definition at line 361 of file symbol_library_manager.cpp.
References SYMBOL_LIB_TABLE::IsSymbolLibLoaded(), LibraryExists(), and symTable().
Referenced by SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetAttr(), and SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue().
bool SYMBOL_LIBRARY_MANAGER::IsLibraryModified | ( | const wxString & | aLibrary | ) | const |
Return true if library has unsaved modifications.
Definition at line 279 of file symbol_library_manager.cpp.
References 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().
bool SYMBOL_LIBRARY_MANAGER::IsLibraryReadOnly | ( | const wxString & | aLibrary | ) | const |
Return true if the library is stored in a read-only file.
Definition at line 352 of file symbol_library_manager.cpp.
References SYMBOL_LIB_TABLE::IsSymbolLibWritable(), LibraryExists(), and 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().
bool SYMBOL_LIBRARY_MANAGER::IsSymbolModified | ( | const wxString & | aAlias, |
const wxString & | aLibrary | ||
) | const |
Return true if symbol has unsaved modifications.
Definition at line 286 of file symbol_library_manager.cpp.
References LIB_BUFFER::GetBuffer(), and m_libs.
Referenced by SYMBOL_EDIT_FRAME::DeleteSymbolFromLibrary(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetAttr(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue(), and SYMBOL_EDIT_FRAME::setupUIConditions().
bool SYMBOL_LIBRARY_MANAGER::LibraryExists | ( | const wxString & | aLibrary, |
bool | aCheckEnabled = false |
||
) | const |
Return true if library exists.
If aCheckEnabled is set, then the library must also be enabled in the library table.
Definition at line 669 of file symbol_library_manager.cpp.
References LIB_TABLE::HasLibrary(), m_libs, and symTable().
Referenced by addLibrary(), SYMBOL_EDIT_FRAME::AddLibraryFile(), SYMBOL_EDIT_FRAME::CreateNewSymbol(), SYMBOL_EDIT_FRAME::DdAddLibrary(), SYMBOL_EDIT_FRAME::DuplicateSymbol(), GetAliases(), GetBufferedSymbol(), getOriginalSymbols(), GetScreen(), GetUniqueLibraryName(), SYMBOL_EDIT_FRAME::ImportSymbol(), IsLibraryLoaded(), IsLibraryReadOnly(), SYMBOL_EDITOR_CONTROL::RenameSymbol(), SaveLibrary(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync(), and UpdateSymbol().
|
inlineprotectedvirtual |
Extract library name basing on the file name.
Reimplemented in LIB_SYMBOL_LIBRARY_MANAGER.
Definition at line 376 of file symbol_library_manager.h.
Referenced by addLibrary(), RemoveSymbol(), RevertLibrary(), RevertSymbol(), and UpdateSymbolAfterRename().
void SYMBOL_LIBRARY_MANAGER::Preload | ( | PROGRESS_REPORTER & | aReporter | ) |
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(), m_frame, HTML_MESSAGE_BOX::MessageSet(), DIALOG_SHIM::ShowModal(), SYMBOL_ASYNC_LOADER::Start(), and symTable().
bool SYMBOL_LIBRARY_MANAGER::RemoveSymbol | ( | const wxString & | aName, |
const wxString & | aLibrary | ||
) |
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 600 of file symbol_library_manager.cpp.
References LIB_BUFFER::DeleteBuffer(), LIB_BUFFER::GetBuffer(), getLibraryBuffer(), and OnDataChanged().
Referenced by SYMBOL_EDIT_FRAME::DeleteSymbolFromLibrary().
bool SYMBOL_LIBRARY_MANAGER::RevertAll | ( | ) |
Revert all pending changes.
Definition at line 574 of file symbol_library_manager.cpp.
References GetHash(), m_libs, and RevertSymbol().
Referenced by SYMBOL_EDIT_FRAME::RevertAll().
bool SYMBOL_LIBRARY_MANAGER::RevertLibrary | ( | const wxString & | aLibrary | ) |
Revert unsaved changes for a symbolicular library.
Definition at line 560 of file symbol_library_manager.cpp.
References m_libs, and OnDataChanged().
Referenced by SYMBOL_EDIT_FRAME::Revert().
LIB_ID SYMBOL_LIBRARY_MANAGER::RevertSymbol | ( | const wxString & | aAlias, |
const wxString & | aLibrary | ||
) |
Revert unsaved changes for a symbolicular symbol.
Definition at line 534 of file symbol_library_manager.cpp.
References LIB_SYMBOL::GetName(), m_libs, OnDataChanged(), and UpdateSymbolAfterRename().
Referenced by SYMBOL_EDIT_FRAME::Revert(), and RevertAll().
bool SYMBOL_LIBRARY_MANAGER::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.
aLibrary | is the library name. |
aFileName | is the target file name. |
Definition at line 170 of file symbol_library_manager.cpp.
References LIB_BUFFER::ClearDeletedBuffer(), FN_NORMALIZE_FLAGS, LIB_BUFFER::GetBuffers(), LIB_TABLE_ROW::GetFullURI(), GetLibrary(), getOriginalSymbols(), LIB_SYMBOL::GetParent(), LibraryExists(), m_libs, SCH_IO_KICAD_LEGACY::PropBuffering, res, LIB_BUFFER::SaveBuffer(), and LIB_SYMBOL::SetParent().
Referenced by SYMBOL_EDIT_FRAME::saveLibrary().
void SYMBOL_LIBRARY_MANAGER::SetSymbolModified | ( | const wxString & | aAlias, |
const wxString & | aLibrary | ||
) |
Definition at line 301 of file symbol_library_manager.cpp.
References LIB_BUFFER::GetBuffer(), and m_libs.
Referenced by SYMBOL_EDITOR_CONTROL::RenameSymbol().
bool SYMBOL_LIBRARY_MANAGER::SymbolExists | ( | const wxString & | aAlias, |
const wxString & | aLibrary | ||
) | const |
Return true if symbol with a specific alias exists in library (either original one or buffered).
Definition at line 648 of file symbol_library_manager.cpp.
References SYMBOL_LIB_TABLE::LoadSymbol(), m_libs, and 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().
|
protected |
Class to store a working copy of a LIB_SYMBOL object and editor context.
Definition at line 772 of file symbol_library_manager.cpp.
References m_frame, KIWAY_HOLDER::Prj(), and PROJECT_SCH::SchSymbolLibTable().
Referenced by GetAlias(), GetAliases(), GetBufferedSymbol(), GetHash(), GetLibrary(), GetLibraryCount(), GetLibraryNames(), getOriginalSymbols(), IsLibraryLoaded(), IsLibraryReadOnly(), LibraryExists(), Preload(), SymbolExists(), and LIB_SYMBOL_LIBRARY_MANAGER::Sync().
bool SYMBOL_LIBRARY_MANAGER::UpdateLibraryBuffer | ( | const wxString & | aLibrary | ) |
Update the library buffer with a new version of the library.
Definition at line 851 of file symbol_library_manager.cpp.
References _, getLibraryBuffer(), and m_libs.
Referenced by SYMBOL_EDIT_FRAME::KiwayMailIn().
bool SYMBOL_LIBRARY_MANAGER::UpdateSymbol | ( | LIB_SYMBOL * | aSymbol, |
const wxString & | aLibrary | ||
) |
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 482 of file symbol_library_manager.cpp.
References LIB_BUFFER::CreateBuffer(), LIB_BUFFER::GetBuffer(), LIB_SYMBOL::GetLibId(), LIB_ID::GetLibItemName(), getLibraryBuffer(), LIB_SYMBOL::GetName(), 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().
bool SYMBOL_LIBRARY_MANAGER::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.
The old library buffer will be deleted and a new one created with the new name.
Definition at line 519 of file symbol_library_manager.cpp.
References LIB_BUFFER::GetBuffer(), getLibraryBuffer(), OnDataChanged(), and LIB_BUFFER::UpdateBuffer().
Referenced by SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), SYMBOL_EDITOR_CONTROL::RenameSymbol(), RevertSymbol(), and SYMBOL_EDIT_FRAME::UpdateAfterSymbolProperties().
|
protected |
Parent frame.
Definition at line 402 of file symbol_library_manager.h.
Referenced by addLibrary(), GetAlias(), GetBufferedSymbol(), GetLibrary(), getOriginalSymbols(), LIB_SYMBOL_LIBRARY_MANAGER::OnDataChanged(), Preload(), and symTable().
|
protected |
The library buffers.
Definition at line 401 of file symbol_library_manager.h.
Referenced by ClearLibraryModified(), ClearSymbolModified(), GetAlias(), GetAliases(), GetHash(), getLibraryBuffer(), GetLibraryHash(), GetScreen(), HasModifications(), IsLibraryModified(), IsSymbolModified(), LibraryExists(), RevertAll(), RevertLibrary(), RevertSymbol(), SaveLibrary(), SetSymbolModified(), SymbolExists(), and UpdateLibraryBuffer().
|
protected |
Definition at line 403 of file symbol_library_manager.h.
Referenced by SYMBOL_LIBRARY_MANAGER(), LIB_SYMBOL_LIBRARY_MANAGER::Sync(), and ~SYMBOL_LIBRARY_MANAGER().