![]() |
KiCad PCB EDA Suite
|
Class to handle modifications to the symbol libraries. More...
#include <symbol_library_manager.h>
Classes | |
class | LIB_BUFFER |
class | PART_BUFFER |
Store a working copy of a library. More... | |
Public Member Functions | |
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. More... | |
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_PART * > | 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 | UpdatePart (LIB_PART *aPart, const wxString &aLibrary) |
Update the part buffer with a new version of the part. More... | |
bool | UpdatePartAfterRename (LIB_PART *aPart, const wxString &oldAlias, const wxString &aLibrary) |
Update the part buffer with a new version of the part when the name has changed. More... | |
bool | RemovePart (const wxString &aName, const wxString &aLibrary) |
Remove the part from the part buffer. More... | |
LIB_PART * | GetAlias (const wxString &aAlias, const wxString &aLibrary) const |
Return either an alias of a working LIB_PART copy, or alias of the original part if there is no working copy. More... | |
LIB_PART * | GetBufferedPart (const wxString &aAlias, const wxString &aLibrary) |
Return the part copy from the buffer. More... | |
SCH_SCREEN * | GetScreen (const wxString &aAlias, const wxString &aLibrary) |
Return the screen used to edit a specific part. More... | |
bool | PartExists (const wxString &aAlias, const wxString &aLibrary) const |
Return true if part 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 | IsPartModified (const wxString &aAlias, const wxString &aLibrary) const |
Return true if part has unsaved modifications. More... | |
bool | ClearLibraryModified (const wxString &aLibrary) const |
Clear the modified flag for all parts in a library. More... | |
bool | ClearPartModified (const wxString &aAlias, const wxString &aLibrary) const |
Clear the modified flag for a part. More... | |
bool | IsLibraryReadOnly (const wxString &aLibrary) const |
Return true if the library is stored in a read-only file. More... | |
bool | FlushPart (const wxString &aAlias, const wxString &aLibrary) |
Save part 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 | RevertPart (const wxString &aAlias, const wxString &aLibrary) |
Revert unsaved changes for a particular part. More... | |
bool | RevertLibrary (const wxString &aLibrary) |
Revert unsaved changes for a particular library. More... | |
bool | RevertAll () |
Revert all pending changes. More... | |
wxString | GetUniqueLibraryName () const |
Return a library name that is not currently in use. More... | |
wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > & | GetAdapter () |
Return the adapter object that provides the stored data. 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 |
Private Member Functions | |
bool | addLibrary (const wxString &aFilePath, bool aCreate, SYMBOL_LIB_TABLE *aTable) |
Return the current Symbol Library Table. More... | |
SYMBOL_LIB_TABLE * | symTable () const |
SYMBOL_TREE_SYNCHRONIZING_ADAPTER * | getAdapter () |
Class to store a working copy of a LIB_PART object and editor context. More... | |
std::set< LIB_PART * > | getOriginalParts (const wxString &aLibrary) |
Return a set of LIB_PART 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 Private Member Functions | |
static wxString | getLibraryName (const wxString &aFilePath) |
< Extract library name basing on the file name. More... | |
Private Attributes | |
std::map< wxString, LIB_BUFFER > | m_libs |
SYMBOL_EDIT_FRAME & | m_frame |
Parent frame. More... | |
LIB_LOGGER | m_logger |
int | m_syncHash |
Symbol lib table hash value from last synchronization. More... | |
wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > | m_adapter |
Class to handle modifications to the symbol libraries.
Definition at line 101 of file symbol_library_manager.h.
SYMBOL_LIBRARY_MANAGER::SYMBOL_LIBRARY_MANAGER | ( | SYMBOL_EDIT_FRAME & | aFrame | ) |
Definition at line 43 of file symbol_library_manager.cpp.
References SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Create(), m_adapter, and m_frame.
|
inline |
Add an existing library.
The library is added to the library table as well.
Definition at line 155 of file symbol_library_manager.h.
References addLibrary().
Referenced by SYMBOL_EDIT_FRAME::AddLibraryFile(), and SYMBOL_EDIT_FRAME::ExportPart().
|
private |
Return the current Symbol Library Table.
Definition at line 700 of file symbol_library_manager.cpp.
References SYMBOL_LIB_TABLE::CreateSymbolLib(), getLibraryName(), SCH_IO_MGR::GuessPluginTypeFromLibPath(), LIB_TABLE::InsertRow(), LibraryExists(), m_frame, NormalizePath(), Pgm(), KIWAY_HOLDER::Prj(), LIB_TABLE::RemoveRow(), SCH_IO_MGR::ShowType(), and SYMBOL_EDIT_FRAME::SyncLibraries().
Referenced by AddLibrary(), and CreateLibrary().
bool SYMBOL_LIBRARY_MANAGER::ClearLibraryModified | ( | const wxString & | aLibrary | ) | const |
Clear the modified flag for all parts in a library.
Definition at line 289 of file symbol_library_manager.cpp.
References BASE_SCREEN::ClrModify(), and m_libs.
Referenced by SYMBOL_EDIT_FRAME::saveLibrary().
bool SYMBOL_LIBRARY_MANAGER::ClearPartModified | ( | const wxString & | aAlias, |
const wxString & | aLibrary | ||
) | const |
Clear the modified flag for a part.
Definition at line 308 of file symbol_library_manager.cpp.
References m_libs.
Referenced by SYMBOL_EDIT_FRAME::Revert(), and SYMBOL_EDIT_FRAME::saveCurrentPart().
|
inline |
Create an empty library and adds it to the library table.
The library file is created.
Definition at line 147 of file symbol_library_manager.h.
References addLibrary().
Referenced by SYMBOL_EDIT_FRAME::AddLibraryFile().
bool SYMBOL_LIBRARY_MANAGER::FlushPart | ( | const wxString & | aAlias, |
const wxString & | aLibrary | ||
) |
Save part changes to the library copy used by the schematic editor.
Not it is not necessarily saved to the file.
Definition at line 491 of file symbol_library_manager.cpp.
References m_libs, and symTable().
Referenced by SYMBOL_EDIT_FRAME::saveCurrentPart().
|
inline |
Return the adapter object that provides the stored data.
Definition at line 291 of file symbol_library_manager.h.
References m_adapter.
Referenced by SYMBOL_EDIT_FRAME::FreezeLibraryTree(), SYMBOL_TREE_PANE::SYMBOL_TREE_PANE(), SYMBOL_EDIT_FRAME::SyncLibraries(), and SYMBOL_EDIT_FRAME::ThawLibraryTree().
|
inlineprivate |
Class to store a working copy of a LIB_PART object and editor context.
Definition at line 315 of file symbol_library_manager.h.
References m_adapter.
Referenced by Sync().
LIB_PART * SYMBOL_LIBRARY_MANAGER::GetAlias | ( | const wxString & | aAlias, |
const wxString & | aLibrary | ||
) | const |
Return either an alias of a working LIB_PART copy, or alias of the original part if there is no working copy.
Definition at line 585 of file symbol_library_manager.cpp.
References _, SYMBOL_LIB_TABLE::LoadSymbol(), m_libs, symTable(), and IO_ERROR::What().
Referenced by SYMBOL_EDIT_FRAME::CreateNewPart(), SYMBOL_EDIT_FRAME::getTargetPart(), and DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow().
std::list< LIB_PART * > SYMBOL_LIBRARY_MANAGER::GetAliases | ( | const wxString & | aLibrary | ) | const |
Definition at line 340 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_PART * SYMBOL_LIBRARY_MANAGER::GetBufferedPart | ( | const wxString & | aAlias, |
const wxString & | aLibrary | ||
) |
Return the part copy from the buffer.
In case it does not exist yet, the copy is created. SYMBOL_LIBRARY_MANAGER retains the ownership.
Definition at line 374 of file symbol_library_manager.cpp.
References _, SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::CreateBuffer(), Format(), getLibraryBuffer(), LIB_PART::GetName(), LIB_PART::GetParent(), SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::GetPart(), LIB_PART::IsAlias(), LibraryExists(), SYMBOL_LIB_TABLE::LoadSymbol(), LIB_PART::SetParent(), symTable(), THROW_IO_ERROR, and IO_ERROR::What().
Referenced by SYMBOL_EDIT_FRAME::CopyPartToClipboard(), SYMBOL_EDIT_FRAME::DuplicatePart(), SYMBOL_EDIT_FRAME::isCurrentPart(), SYMBOL_EDIT_FRAME::LoadOneLibraryPartAux(), and SYMBOL_EDIT_FRAME::LoadPart().
int SYMBOL_LIBRARY_MANAGER::GetHash | ( | ) | const |
Definition at line 119 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 156 of file symbol_library_manager.cpp.
References _, SYMBOL_LIB_TABLE::FindRow(), symTable(), and IO_ERROR::What().
Referenced by GetLibraryHash(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue(), SYMBOL_EDIT_FRAME::IsSymbolFromLegacyLibrary(), SaveLibrary(), and SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync().
|
private |
Return an existing library buffer or creates one to using Symbol Library Table to get the original data.
The library buffers
Definition at line 770 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::CreateBuffer(), Format(), getOriginalParts(), LIB_PART::GetParent(), SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::GetPart(), m_libs, and LIB_PART::SetParent().
Referenced by GetBufferedPart(), GetRootSymbolNames(), HasDerivedSymbols(), RemovePart(), UpdatePart(), and UpdatePartAfterRename().
size_t SYMBOL_LIBRARY_MANAGER::GetLibraryCount | ( | ) | const |
Definition at line 687 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 130 of file symbol_library_manager.cpp.
References GetLibrary(), and m_libs.
Referenced by SYMBOL_TREE_SYNCHRONIZING_ADAPTER::updateLibrary().
|
staticprivate |
< Extract library name basing on the file name.
Helper function to add either existing or create new library
Definition at line 693 of file symbol_library_manager.cpp.
Referenced by addLibrary().
wxArrayString SYMBOL_LIBRARY_MANAGER::GetLibraryNames | ( | ) | const |
Return the array of library names.
Definition at line 145 of file symbol_library_manager.cpp.
References symTable().
Referenced by SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetLibrariesCount(), SYMBOL_EDIT_FRAME::IsContentModified(), SYMBOL_EDIT_FRAME::saveAllLibraries(), and SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync().
|
private |
Return a set of LIB_PART objects belonging to the original library.
Definition at line 745 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 669 of file symbol_library_manager.cpp.
References getLibraryBuffer(), and SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::GetRootSymbolNames().
Referenced by SYMBOL_EDIT_FRAME::CreateNewPart(), 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 part.
SYMBOL_LIBRARY_MANAGER retains the ownership.
Definition at line 432 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::GetBuffer(), LibraryExists(), and m_libs.
Referenced by SYMBOL_EDIT_FRAME::LoadOneLibraryPartAux().
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 649 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 678 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::DeletePartFromLibrary().
bool SYMBOL_LIBRARY_MANAGER::HasModifications | ( | ) | const |
Definition at line 107 of file symbol_library_manager.cpp.
References m_libs.
Referenced by SYMBOL_EDIT_FRAME::HasLibModifications(), and SYMBOL_EDIT_FRAME::setupUIConditions().
bool SYMBOL_LIBRARY_MANAGER::IsLibraryLoaded | ( | const wxString & | aLibrary | ) | const |
Return true if the library was successfully loaded.
Definition at line 332 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 268 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 324 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(), SYMBOL_EDIT_FRAME::SelectLibraryFromList(), and SYMBOL_EDIT_FRAME::updateTitle().
bool SYMBOL_LIBRARY_MANAGER::IsPartModified | ( | const wxString & | aAlias, |
const wxString & | aLibrary | ||
) | const |
Return true if part has unsaved modifications.
Definition at line 275 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::GetBuffer(), and m_libs.
Referenced by SYMBOL_EDIT_FRAME::DeletePartFromLibrary(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetAttr(), and SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue().
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 637 of file symbol_library_manager.cpp.
References LIB_TABLE::HasLibrary(), m_libs, and symTable().
Referenced by addLibrary(), SYMBOL_EDIT_FRAME::AddLibraryFile(), SYMBOL_EDIT_FRAME::CreateNewPart(), SYMBOL_EDIT_FRAME::DuplicatePart(), GetAliases(), GetBufferedPart(), getOriginalParts(), GetScreen(), GetUniqueLibraryName(), SYMBOL_EDIT_FRAME::ImportPart(), IsLibraryLoaded(), IsLibraryReadOnly(), SaveLibrary(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync(), and UpdatePart().
bool SYMBOL_LIBRARY_MANAGER::PartExists | ( | const wxString & | aAlias, |
const wxString & | aLibrary | ||
) | const |
Return true if part with a specific alias exists in library (either original one or buffered).
Definition at line 616 of file symbol_library_manager.cpp.
References SYMBOL_LIB_TABLE::LoadSymbol(), m_libs, and symTable().
Referenced by SYMBOL_EDIT_FRAME::CreateNewPart(), SYMBOL_EDIT_FRAME::ensureUniqueName(), SYMBOL_EDIT_FRAME::ImportPart(), SYMBOL_EDIT_FRAME::Revert(), SYMBOL_EDIT_FRAME::savePartAs(), DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow(), and SYMBOL_EDIT_FRAME::UpdateAfterSymbolProperties().
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 65 of file symbol_library_manager.cpp.
References _, SYMBOL_ASYNC_LOADER::Abort(), HTML_MESSAGE_BOX::AddHTML_Text(), SYMBOL_ASYNC_LOADER::Done(), SYMBOL_ASYNC_LOADER::GetErrors(), PROGRESS_REPORTER::IsCancelled(), SYMBOL_ASYNC_LOADER::Join(), PROGRESS_REPORTER::KeepRefreshing(), m_frame, HTML_MESSAGE_BOX::MessageSet(), SYMBOL_ASYNC_LOADER::Start(), and symTable().
bool SYMBOL_LIBRARY_MANAGER::RemovePart | ( | const wxString & | aName, |
const wxString & | aLibrary | ||
) |
Remove the part from the part buffer.
It is required to save the library to have the part removed in the schematic editor.
Definition at line 570 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::DeleteBuffer(), SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::GetBuffer(), getLibraryBuffer(), m_frame, and SYMBOL_EDIT_FRAME::SyncLibraries().
Referenced by SYMBOL_EDIT_FRAME::DeletePartFromLibrary().
bool SYMBOL_LIBRARY_MANAGER::RevertAll | ( | ) |
Revert all pending changes.
Definition at line 544 of file symbol_library_manager.cpp.
References GetHash(), m_libs, and RevertPart().
Referenced by SYMBOL_EDIT_FRAME::RevertAll().
bool SYMBOL_LIBRARY_MANAGER::RevertLibrary | ( | const wxString & | aLibrary | ) |
Revert unsaved changes for a particular library.
Definition at line 530 of file symbol_library_manager.cpp.
References m_frame, m_libs, and SYMBOL_EDIT_FRAME::SyncLibraries().
Referenced by SYMBOL_EDIT_FRAME::Revert().
LIB_ID SYMBOL_LIBRARY_MANAGER::RevertPart | ( | const wxString & | aAlias, |
const wxString & | aLibrary | ||
) |
Revert unsaved changes for a particular part.
Definition at line 505 of file symbol_library_manager.cpp.
References m_frame, m_libs, SYMBOL_EDIT_FRAME::SyncLibraries(), and UpdatePartAfterRename().
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 174 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::ClearDeletedBuffer(), Format(), SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::GetBuffers(), GetLibrary(), getOriginalParts(), LIB_PART::GetParent(), LibraryExists(), m_libs, SCH_LEGACY_PLUGIN::PropBuffering, SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer(), and LIB_PART::SetParent().
Referenced by SYMBOL_EDIT_FRAME::saveLibrary().
|
private |
Definition at line 739 of file symbol_library_manager.cpp.
References m_frame, and KIWAY_HOLDER::Prj().
Referenced by FlushPart(), GetAlias(), GetAliases(), GetBufferedPart(), GetHash(), GetLibrary(), GetLibraryCount(), GetLibraryNames(), getOriginalParts(), IsLibraryLoaded(), IsLibraryReadOnly(), LibraryExists(), PartExists(), Preload(), and Sync().
void 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 52 of file symbol_library_manager.cpp.
References LIB_LOGGER::Activate(), LIB_LOGGER::Deactivate(), getAdapter(), SYMBOL_LIB_TABLE::GetModifyHash(), m_logger, m_syncHash, symTable(), and SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync().
Referenced by SYMBOL_EDIT_FRAME::SyncLibraries().
bool SYMBOL_LIBRARY_MANAGER::UpdatePart | ( | LIB_PART * | aPart, |
const wxString & | aLibrary | ||
) |
Update the part buffer with a new version of the part.
The library buffer creates a copy of the part. It is required to save the library to use the updated part in the schematic editor.
Definition at line 445 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::CreateBuffer(), SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::GetBuffer(), LIB_PART::GetLibId(), LIB_ID::GetLibItemName(), getLibraryBuffer(), LIB_PART::GetName(), LibraryExists(), LIB_PART::SetLibId(), and BASE_SCREEN::SetModify().
Referenced by SYMBOL_EDIT_FRAME::CreateNewPart(), SYMBOL_EDIT_FRAME::DuplicatePart(), SYMBOL_EDIT_FRAME::ImportPart(), SYMBOL_EDIT_FRAME::savePartAs(), and SYMBOL_EDIT_FRAME::storeCurrentPart().
bool SYMBOL_LIBRARY_MANAGER::UpdatePartAfterRename | ( | LIB_PART * | aPart, |
const wxString & | oldAlias, | ||
const wxString & | aLibrary | ||
) |
Update the part buffer with a new version of the part when the name has changed.
The old library buffer will be deleted and a new one created with the new name.
Definition at line 476 of file symbol_library_manager.cpp.
References SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::GetBuffer(), getLibraryBuffer(), m_frame, SYMBOL_EDIT_FRAME::SyncLibraries(), and SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::UpdateBuffer().
Referenced by SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), RevertPart(), and SYMBOL_EDIT_FRAME::UpdateAfterSymbolProperties().
|
private |
Definition at line 475 of file symbol_library_manager.h.
Referenced by GetAdapter(), getAdapter(), and SYMBOL_LIBRARY_MANAGER().
|
private |
Parent frame.
Definition at line 471 of file symbol_library_manager.h.
Referenced by addLibrary(), Preload(), RemovePart(), RevertLibrary(), RevertPart(), SYMBOL_LIBRARY_MANAGER(), symTable(), and UpdatePartAfterRename().
|
private |
Definition at line 469 of file symbol_library_manager.h.
Referenced by ClearLibraryModified(), ClearPartModified(), FlushPart(), GetAlias(), GetAliases(), GetHash(), getLibraryBuffer(), GetLibraryHash(), GetScreen(), HasModifications(), IsLibraryModified(), IsPartModified(), LibraryExists(), PartExists(), RevertAll(), RevertLibrary(), RevertPart(), and SaveLibrary().
|
private |
Definition at line 472 of file symbol_library_manager.h.
Referenced by Sync().
|
private |
Symbol lib table hash value from last synchronization.
Definition at line 473 of file symbol_library_manager.h.
Referenced by Sync().