KiCad PCB EDA Suite
|
Class to handle modifications to the symbol libraries. More...
#include <symbol_library_manager.h>
Classes | |
class | LIB_BUFFER |
class | SYMBOL_BUFFER |
Store a working copy of a library. More... | |
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. More... | |
int | GetHash () const |
bool | HasModifications () const |
int | GetLibraryHash (const wxString &aLibrary) const |
Return a library hash value to determine if it has changed. More... | |
wxArrayString | GetLibraryNames () const |
Return the array of library names. More... | |
SYMBOL_LIB_TABLE_ROW * | GetLibrary (const wxString &aLibrary) const |
Find a single library within the (aggregate) library table. More... | |
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. More... | |
bool | AddLibrary (const wxString &aFilePath, SYMBOL_LIB_TABLE *aTable) |
Add an existing library. More... | |
bool | UpdateSymbol (LIB_SYMBOL *aSymbol, const wxString &aLibrary) |
Update the symbol buffer with a new version of the symbol. More... | |
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. More... | |
bool | RemoveSymbol (const wxString &aName, const wxString &aLibrary) |
Remove the symbol from the symbol buffer. More... | |
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. More... | |
LIB_SYMBOL * | GetBufferedSymbol (const wxString &aAlias, const wxString &aLibrary) |
Return the symbol copy from the buffer. More... | |
SCH_SCREEN * | GetScreen (const wxString &aAlias, const wxString &aLibrary) |
Return the screen used to edit a specific symbol. More... | |
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). More... | |
bool | LibraryExists (const wxString &aLibrary, bool aCheckEnabled=false) const |
Return true if library exists. More... | |
bool | IsLibraryLoaded (const wxString &aLibrary) const |
Return true if the library was successfully loaded. More... | |
bool | IsLibraryModified (const wxString &aLibrary) const |
Return true if library has unsaved modifications. More... | |
bool | IsSymbolModified (const wxString &aAlias, const wxString &aLibrary) const |
Return true if symbol has unsaved modifications. More... | |
void | SetSymbolModified (const wxString &aAlias, const wxString &aLibrary) |
bool | ClearLibraryModified (const wxString &aLibrary) const |
Clear the modified flag for all symbols in a library. More... | |
bool | ClearSymbolModified (const wxString &aAlias, const wxString &aLibrary) const |
Clear the modified flag for a symbol. More... | |
bool | IsLibraryReadOnly (const wxString &aLibrary) const |
Return true if the library is stored in a read-only file. More... | |
bool | FlushSymbol (const wxString &aAlias, const wxString &aLibrary) |
Save symbol changes to the library copy used by the schematic editor. More... | |
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. More... | |
LIB_ID | RevertSymbol (const wxString &aAlias, const wxString &aLibrary) |
Revert unsaved changes for a symbolicular symbol. More... | |
bool | RevertLibrary (const wxString &aLibrary) |
Revert unsaved changes for a symbolicular library. More... | |
bool | RevertAll () |
Revert all pending changes. More... | |
wxString | GetUniqueLibraryName () const |
Return a library name that is not currently in use. More... | |
void | GetRootSymbolNames (const wxString &aLibName, wxArrayString &aRootSymbolNames) |
bool | HasDerivedSymbols (const wxString &aSymbolName, const wxString &aLibraryName) |
Check if symbol aSymbolName in library aLibraryName is a root symbol that has derived symbols. More... | |
size_t | GetLibraryCount () const |
Protected Member Functions | |
virtual void | OnDataChanged () const |
Extract library name basing on the file name. More... | |
bool | addLibrary (const wxString &aFilePath, bool aCreate, SYMBOL_LIB_TABLE *aTable) |
Return the current Symbol Library Table. More... | |
SYMBOL_LIB_TABLE * | symTable () const |
Class to store a working copy of a LIB_SYMBOL object and editor context. More... | |
std::set< LIB_SYMBOL * > | getOriginalSymbols (const wxString &aLibrary) |
Return a set of LIB_SYMBOL objects belonging to the original library. More... | |
LIB_BUFFER & | getLibraryBuffer (const wxString &aLibrary) |
Return an existing library buffer or creates one to using Symbol Library Table to get the original data. More... | |
Static Protected Member Functions | |
static wxString | getLibraryName (const wxString &aFilePath) |
Helper function to add either existing or create new library. More... | |
Protected Attributes | |
std::map< wxString, LIB_BUFFER > | m_libs |
SCH_BASE_FRAME & | m_frame |
Parent frame. More... | |
LIB_LOGGER * | m_logger |
Class to handle modifications to the symbol libraries.
Definition at line 52 of file symbol_library_manager.h.
SYMBOL_LIBRARY_MANAGER::SYMBOL_LIBRARY_MANAGER | ( | SCH_BASE_FRAME & | aFrame | ) |
Definition at line 47 of file symbol_library_manager.cpp.
References m_logger.
|
virtual |
Definition at line 54 of file symbol_library_manager.cpp.
References m_logger.
|
protected |
Return the current Symbol Library Table.
Definition at line 721 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 101 of file symbol_library_manager.h.
References addLibrary().
Referenced by SYMBOL_EDIT_FRAME::AddLibraryFile(), SYMBOL_EDIT_FRAME::DdAddLibrary(), and SYMBOL_EDIT_FRAME::ExportSymbol().
bool SYMBOL_LIBRARY_MANAGER::ClearLibraryModified | ( | const wxString & | aLibrary | ) | const |
Clear the modified flag for all symbols in a library.
Definition at line 308 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 327 of file symbol_library_manager.cpp.
References m_libs.
Referenced by SYMBOL_EDIT_FRAME::Revert(), and SYMBOL_EDIT_FRAME::saveCurrentSymbol().
|
inline |
Create an empty library and adds it to the library table.
The library file is created.
Definition at line 93 of file symbol_library_manager.h.
References addLibrary().
Referenced by SYMBOL_EDIT_FRAME::AddLibraryFile(), and SCH_EDITOR_CONTROL::ExportSymbolsToLibrary().
bool SYMBOL_LIBRARY_MANAGER::FlushSymbol | ( | const wxString & | aAlias, |
const wxString & | aLibrary | ||
) |
Save symbol changes to the library copy used by the schematic editor.
Not it is not necessarily saved to the file.
Definition at line 510 of file symbol_library_manager.cpp.
References m_libs, and symTable().
Referenced by SYMBOL_EDIT_FRAME::saveCurrentSymbol().
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 605 of file symbol_library_manager.cpp.
References _, SYMBOL_LIB_TABLE::LoadSymbol(), m_libs, symTable(), and IO_ERROR::What().
Referenced by SYMBOL_EDIT_FRAME::CreateNewSymbol(), 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 359 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 393 of file symbol_library_manager.cpp.
References _, SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::CreateBuffer(), Format(), getLibraryBuffer(), LIB_SYMBOL::GetName(), LIB_SYMBOL::GetParent(), SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::GetSymbol(), LIB_SYMBOL::IsAlias(), LibraryExists(), SYMBOL_LIB_TABLE::LoadSymbol(), 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::LoadOneLibrarySymbolAux(), SYMBOL_EDIT_FRAME::LoadSymbol(), and SYMBOL_EDITOR_CONTROL::RenameSymbol().
int SYMBOL_LIBRARY_MANAGER::GetHash | ( | ) | const |
Definition at line 106 of file symbol_library_manager.cpp.
References SYMBOL_LIB_TABLE::GetModifyHash(), m_libs, 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 149 of file symbol_library_manager.cpp.
References _, SYMBOL_LIB_TABLE::FindRow(), 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(), 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.
The library buffers
Definition at line 788 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::CreateBuffer(), Format(), getOriginalSymbols(), LIB_SYMBOL::GetParent(), SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::GetSymbol(), m_libs, and LIB_SYMBOL::SetParent().
Referenced by GetBufferedSymbol(), GetRootSymbolNames(), HasDerivedSymbols(), RemoveSymbol(), UpdateSymbol(), and UpdateSymbolAfterRename().
size_t SYMBOL_LIBRARY_MANAGER::GetLibraryCount | ( | ) | const |
Definition at line 708 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 117 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 714 of file symbol_library_manager.cpp.
Referenced by addLibrary().
wxArrayString SYMBOL_LIBRARY_MANAGER::GetLibraryNames | ( | ) | const |
Return the array of library names.
Definition at line 132 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 763 of file symbol_library_manager.cpp.
References _, SYMBOL_LIB_TABLE::EnumerateSymbolLib(), LibraryExists(), SYMBOL_LIB_TABLE::LoadSymbol(), symTable(), and IO_ERROR::What().
Referenced by getLibraryBuffer(), and SaveLibrary().
void SYMBOL_LIBRARY_MANAGER::GetRootSymbolNames | ( | const wxString & | aLibName, |
wxArrayString & | aRootSymbolNames | ||
) |
Definition at line 690 of file symbol_library_manager.cpp.
References getLibraryBuffer(), and SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::GetRootSymbolNames().
Referenced by SYMBOL_EDIT_FRAME::CreateNewSymbol(), and DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow().
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 451 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::GetBuffer(), LibraryExists(), and m_libs.
Referenced by SYMBOL_EDIT_FRAME::LoadOneLibrarySymbolAux().
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 670 of file symbol_library_manager.cpp.
References Format(), 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 699 of file symbol_library_manager.cpp.
References getLibraryBuffer(), and SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::HasDerivedSymbols().
Referenced by SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::DeleteBuffer(), and SYMBOL_EDIT_FRAME::DeleteSymbolFromLibrary().
bool SYMBOL_LIBRARY_MANAGER::HasModifications | ( | ) | const |
Definition at line 94 of file symbol_library_manager.cpp.
References m_libs.
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 351 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 270 of file symbol_library_manager.cpp.
References m_libs.
Referenced by SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetAttr(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue(), 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 343 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_EDIT_FRAME::IsContentModified(), SYMBOL_EDIT_FRAME::Save(), SYMBOL_EDIT_FRAME::saveAllLibraries(), SYMBOL_EDIT_FRAME::saveLibrary(), 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 277 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::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 658 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 249 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 60 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(), 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 590 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::DeleteBuffer(), SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::GetBuffer(), getLibraryBuffer(), and OnDataChanged().
Referenced by SYMBOL_EDIT_FRAME::DeleteSymbolFromLibrary().
bool SYMBOL_LIBRARY_MANAGER::RevertAll | ( | ) |
Revert all pending changes.
Definition at line 564 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 550 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 524 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 167 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::ClearDeletedBuffer(), FN_NORMALIZE_FLAGS, Format(), SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::GetBuffers(), LIB_TABLE_ROW::GetFullURI(), GetLibrary(), getOriginalSymbols(), LIB_SYMBOL::GetParent(), LibraryExists(), SCH_PLUGIN::LoadSymbol(), m_libs, SCH_LEGACY_PLUGIN::PropBuffering, res, SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer(), SCH_PLUGIN::SaveLibrary(), SCH_PLUGIN::SaveSymbol(), and LIB_SYMBOL::SetParent().
Referenced by SYMBOL_EDIT_FRAME::saveLibrary().
void SYMBOL_LIBRARY_MANAGER::SetSymbolModified | ( | const wxString & | aAlias, |
const wxString & | aLibrary | ||
) |
Definition at line 291 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::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 637 of file symbol_library_manager.cpp.
References SYMBOL_LIB_TABLE::LoadSymbol(), m_libs, and symTable().
Referenced by SYMBOL_EDIT_FRAME::CreateNewSymbol(), SYMBOL_EDIT_FRAME::ensureUniqueName(), SYMBOL_EDIT_FRAME::ImportSymbol(), SYMBOL_EDITOR_CONTROL::RenameSymbol(), SYMBOL_EDIT_FRAME::Revert(), SYMBOL_EDIT_FRAME::saveSymbolAs(), 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 757 of file symbol_library_manager.cpp.
References m_frame, and KIWAY_HOLDER::Prj().
Referenced by FlushSymbol(), GetAlias(), GetAliases(), GetBufferedSymbol(), GetHash(), GetLibrary(), GetLibraryCount(), GetLibraryNames(), getOriginalSymbols(), IsLibraryLoaded(), IsLibraryReadOnly(), LibraryExists(), Preload(), SymbolExists(), and LIB_SYMBOL_LIBRARY_MANAGER::Sync().
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 464 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::CreateBuffer(), SYMBOL_LIBRARY_MANAGER::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_EDIT_FRAME::DuplicateSymbol(), SYMBOL_EDIT_FRAME::ImportSymbol(), SYMBOL_EDIT_FRAME::saveSymbolAs(), 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 495 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::GetBuffer(), getLibraryBuffer(), OnDataChanged(), and SYMBOL_LIBRARY_MANAGER::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 412 of file symbol_library_manager.h.
Referenced by addLibrary(), LIB_SYMBOL_LIBRARY_MANAGER::OnDataChanged(), Preload(), and symTable().
|
protected |
Definition at line 410 of file symbol_library_manager.h.
Referenced by ClearLibraryModified(), ClearSymbolModified(), FlushSymbol(), GetAlias(), GetAliases(), GetHash(), getLibraryBuffer(), GetLibraryHash(), GetScreen(), HasModifications(), IsLibraryModified(), IsSymbolModified(), LibraryExists(), RevertAll(), RevertLibrary(), RevertSymbol(), SaveLibrary(), SetSymbolModified(), and SymbolExists().
|
protected |
Definition at line 413 of file symbol_library_manager.h.
Referenced by SYMBOL_LIBRARY_MANAGER(), LIB_SYMBOL_LIBRARY_MANAGER::Sync(), and ~SYMBOL_LIBRARY_MANAGER().