![]() |
KiCad PCB EDA Suite
|
#include <symbol_lib_table.h>
Public Types | |
enum | SAVE_T { SAVE_OK, SAVE_SKIPPED } |
The set of return values from SaveSymbol() below. More... | |
Public Member Functions | |
KICAD_T | Type () override |
virtual void | Parse (LIB_TABLE_LEXER *aLexer) override |
Parse the #LIB_TABLE_LEXER s-expression library table format into the appropriate LIB_TABLE_ROW objects. More... | |
virtual void | Format (OUTPUTFORMATTER *aOutput, int aIndentLevel) const override |
Generate the table in s-expression format to aOutput with an indention level of aIndentLevel. More... | |
SYMBOL_LIB_TABLE (SYMBOL_LIB_TABLE *aFallBackTable=NULL) | |
Build a symbol library table by pre-pending this table fragment in front of aFallBackTable. More... | |
SYMBOL_LIB_TABLE_ROW * | FindRow (const wxString &aNickName, bool aCheckIfEnabled=false) |
Return an SYMBOL_LIB_TABLE_ROW if aNickName is found in this table or in any chained fallBack table fragment. More... | |
int | GetModifyHash () |
void | EnumerateSymbolLib (const wxString &aNickname, wxArrayString &aAliasNames, bool aPowerSymbolsOnly=false) |
Return a list of symbol alias names contained within the library given by aNickname. More... | |
void | LoadSymbolLib (std::vector< LIB_PART * > &aAliasList, const wxString &aNickname, bool aPowerSymbolsOnly=false) |
LIB_PART * | LoadSymbol (const wxString &aNickname, const wxString &aName) |
Load a LIB_PART having aName from the library given by aNickname. More... | |
LIB_PART * | LoadSymbol (const LIB_ID &aLibId) |
SAVE_T | SaveSymbol (const wxString &aNickname, const LIB_PART *aSymbol, bool aOverwrite=true) |
Write aSymbol to an existing library given by aNickname. More... | |
void | DeleteSymbol (const wxString &aNickname, const wxString &aSymbolName) |
Deletes the aSymbolName from the library given by aNickname. More... | |
bool | IsSymbolLibWritable (const wxString &aNickname) |
Return true if the library given by aNickname is writable. More... | |
bool | IsSymbolLibLoaded (const wxString &aNickname) |
Return true if the library given by aNickname was successfully loaded. More... | |
void | DeleteSymbolLib (const wxString &aNickname) |
void | CreateSymbolLib (const wxString &aNickname) |
LIB_PART * | LoadSymbolWithOptionalNickname (const LIB_ID &aId) |
Load a LIB_PART having aFootprintId with possibly an empty library nickname. More... | |
void | Clear () |
Delete all rows. More... | |
bool | operator== (const LIB_TABLE &r) const |
Compares this table against another. More... | |
bool | operator!= (const LIB_TABLE &r) const |
unsigned | GetCount () const |
Get the number of rows contained in the table. More... | |
LIB_TABLE_ROW & | At (unsigned aIndex) |
Get the 'n'th LIB_TABLE_ROW object. More... | |
const LIB_TABLE_ROW & | At (unsigned aIndex) const |
Get the 'n'th LIB_TABLE_ROW object. More... | |
bool | IsEmpty (bool aIncludeFallback=true) |
Return true if the table is empty. More... | |
const wxString | GetDescription (const wxString &aNickname) |
bool | HasLibrary (const wxString &aNickname, bool aCheckEnabled=false) const |
Test for the existence of aNickname in the library table. More... | |
std::vector< wxString > | GetLogicalLibs () |
Return the logical library names, all of them that are pertinent to a look up done on this LIB_TABLE. More... | |
wxString | GetFullURI (const wxString &aLibNickname, bool aExpandEnvVars=true) const |
Return the full URI of the library mapped to aLibNickname. More... | |
bool | InsertRow (LIB_TABLE_ROW *aRow, bool doReplace=false) |
Adds aRow if it does not already exist or if doReplace is true. More... | |
bool | RemoveRow (LIB_TABLE_ROW *aRow) |
Removes a row from the table. More... | |
const LIB_TABLE_ROW * | FindRowByURI (const wxString &aURI) |
void | Load (const wxString &aFileName) |
Load the library table using the path defined by aFileName aFallBackTable. More... | |
void | Save (const wxString &aFileName) const |
Write this library table to aFileName in s-expression form. More... | |
Static Public Member Functions | |
static bool | LoadGlobalTable (SYMBOL_LIB_TABLE &aTable) |
Load the global symbol library table into aTable. More... | |
static wxString | GetGlobalTableFileName () |
Fetch the global symbol library table file name. More... | |
static const wxString | GlobalPathEnvVariableName () |
Return the name of the environment variable used to hold the directory of locally installed "KiCad sponsored" system symbol libraries. More... | |
static SYMBOL_LIB_TABLE & | GetGlobalLibTable () |
static const wxString & | GetSymbolLibTableFileName () |
static PROPERTIES * | ParseOptions (const std::string &aOptionsList) |
Parses aOptionsList and places the result into a PROPERTIES object which is returned. More... | |
static UTF8 | FormatOptions (const PROPERTIES *aProperties) |
Returns a list of options from the aProperties parameter. More... | |
Static Public Attributes | |
static const char * | PropPowerSymsOnly = "pwr_sym_only" |
static const char * | PropNonPowerSymsOnly = "non_pwr_sym_only" |
Protected Types | |
typedef std::map< wxString, int > | INDEX |
this is a non-owning index into the LIB_TABLE_ROWS table More... | |
typedef INDEX::iterator | INDEX_ITER |
typedef INDEX::const_iterator | INDEX_CITER |
typedef INDEX::value_type | INDEX_VALUE |
Protected Member Functions | |
LIB_TABLE_ROW * | findRow (const wxString &aNickname, bool aCheckIfEnabled=false) const |
Return a LIB_TABLE_ROW if aNickname is found in this table or in any chained fallBack table fragment, else NULL. More... | |
void | reindex () |
void | ensureIndex () |
Protected Attributes | |
LIB_TABLE_ROWS | rows |
INDEX | nickIndex |
this particular key is the nickName within each row. More... | |
LIB_TABLE * | fallBack |
Static Private Attributes | |
static int | m_modifyHash = 1 |
helper for GetModifyHash() More... | |
Friends | |
class | SYMBOL_LIB_TABLE_GRID |
class | PANEL_SYM_LIB_TABLE |
Definition at line 109 of file symbol_lib_table.h.
|
protectedinherited |
this is a non-owning index into the LIB_TABLE_ROWS table
Definition at line 527 of file lib_table_base.h.
|
protectedinherited |
Definition at line 529 of file lib_table_base.h.
|
protectedinherited |
Definition at line 528 of file lib_table_base.h.
|
protectedinherited |
Definition at line 530 of file lib_table_base.h.
The set of return values from SaveSymbol() below.
Enumerator | |
---|---|
SAVE_OK | |
SAVE_SKIPPED |
Definition at line 190 of file symbol_lib_table.h.
SYMBOL_LIB_TABLE::SYMBOL_LIB_TABLE | ( | SYMBOL_LIB_TABLE * | aFallBackTable = NULL | ) |
Build a symbol library table by pre-pending this table fragment in front of aFallBackTable.
Loading of this table fragment is done by using Parse().
aFallBackTable | is another SYMBOL_LIB_TABLE which is searched only when a row is not found in this table. No ownership is taken of aFallBackTable. |
Definition at line 88 of file symbol_lib_table.cpp.
|
inlineinherited |
Get the 'n'th LIB_TABLE_ROW object.
aIndex | index of row (must exist: from 0 to GetCount() - 1) |
Definition at line 362 of file lib_table_base.h.
References LIB_TABLE::rows.
Referenced by SYMBOL_GRID_TRICKS::paste_text(), FP_GRID_TRICKS::paste_text(), and SCH::IFACE::SaveFileAs().
|
inlineinherited |
Get the 'n'th LIB_TABLE_ROW object.
aIndex | index of row (must exist: from 0 to GetCount() - 1) |
Definition at line 370 of file lib_table_base.h.
References LIB_TABLE::rows.
|
inlineinherited |
Delete all rows.
Definition at line 319 of file lib_table_base.h.
References LIB_TABLE::nickIndex, and LIB_TABLE::rows.
Referenced by PANEL_FP_LIB_TABLE::TransferDataFromWindow(), and PANEL_SYM_LIB_TABLE::TransferDataFromWindow().
void SYMBOL_LIB_TABLE::CreateSymbolLib | ( | const wxString & | aNickname | ) |
Definition at line 450 of file symbol_lib_table.cpp.
References FindRow(), LIB_TABLE_ROW::GetFullURI(), LIB_TABLE_ROW::GetProperties(), and SYMBOL_LIB_TABLE_ROW::plugin.
Referenced by SYMBOL_LIBRARY_MANAGER::addLibrary().
void SYMBOL_LIB_TABLE::DeleteSymbol | ( | const wxString & | aNickname, |
const wxString & | aSymbolName | ||
) |
Deletes the aSymbolName from the library given by aNickname.
aNickname | is a locator for the "library", it is a "name" in LIB_TABLE_ROW. |
aSymbolName | is the name of a symbol to delete from the specified library. |
IO_ERROR | if there is a problem finding the footprint or the library, or deleting it. |
Definition at line 418 of file symbol_lib_table.cpp.
References FindRow(), LIB_TABLE_ROW::GetFullURI(), LIB_TABLE_ROW::GetProperties(), and SYMBOL_LIB_TABLE_ROW::plugin.
Referenced by SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer().
void SYMBOL_LIB_TABLE::DeleteSymbolLib | ( | const wxString & | aNickname | ) |
Definition at line 442 of file symbol_lib_table.cpp.
References FindRow(), LIB_TABLE_ROW::GetFullURI(), LIB_TABLE_ROW::GetProperties(), and SYMBOL_LIB_TABLE_ROW::plugin.
|
inlineprotectedinherited |
Definition at line 510 of file lib_table_base.h.
References LIB_TABLE::nickIndex, and LIB_TABLE::reindex().
Referenced by LIB_TABLE::findRow(), LIB_TABLE::FindRowByURI(), and LIB_TABLE::InsertRow().
void SYMBOL_LIB_TABLE::EnumerateSymbolLib | ( | const wxString & | aNickname, |
wxArrayString & | aAliasNames, | ||
bool | aPowerSymbolsOnly = false |
||
) |
Return a list of symbol alias names contained within the library given by aNickname.
aNickname | is a locator for the "library", it is a "name" in LIB_TABLE_ROW. |
aAliasNames | is a reference to an array for the alias names. |
aPowerSymbolsOnly | is a flag to enumerate only power symbols. |
IO_ERROR | if the library cannot be found or loaded. |
Definition at line 282 of file symbol_lib_table.cpp.
References FindRow(), LIB_TABLE_ROW::GetFullURI(), LIB_TABLE_ROW::GetOptions(), LIB_TABLE_ROW::GetProperties(), SYMBOL_LIB_TABLE_ROW::plugin, PropPowerSymsOnly, LIB_TABLE_ROW::SetLoaded(), and LIB_TABLE_ROW::SetOptions().
Referenced by SYMBOL_LIBRARY_MANAGER::getOriginalParts().
SYMBOL_LIB_TABLE_ROW * SYMBOL_LIB_TABLE::FindRow | ( | const wxString & | aNickName, |
bool | aCheckIfEnabled = false |
||
) |
Return an SYMBOL_LIB_TABLE_ROW if aNickName is found in this table or in any chained fallBack table fragment.
The SCH_PLUGIN is loaded and attached to the "plugin" fieldf the SYMBOL_LIB_TABLE_ROW if not already loaded.
aNickName | is the name of the row to find. |
aCheckIfEnabled | is a flag to verify if the table entry is enabled or disabled. |
Definition at line 302 of file symbol_lib_table.cpp.
References LIB_TABLE::findRow(), SYMBOL_LIB_TABLE_ROW::plugin, SYMBOL_LIB_TABLE_ROW::setPlugin(), and SYMBOL_LIB_TABLE_ROW::type.
Referenced by CreateSymbolLib(), DeleteSymbol(), DeleteSymbolLib(), EnumerateSymbolLib(), SYMBOL_LIBRARY_MANAGER::GetLibrary(), GetModifyHash(), IsSymbolLibLoaded(), IsSymbolLibWritable(), SCH_EDIT_FRAME::LoadSheetFromFile(), LoadSymbol(), LoadSymbolLib(), SYMBOL_EDIT_FRAME::replaceLibTableEntry(), SaveSymbol(), and ERC_TESTER::TestLibSymbolIssues().
|
protectedinherited |
Return a LIB_TABLE_ROW if aNickname is found in this table or in any chained fallBack table fragment, else NULL.
aNickname | is the name of the library table entry to find. |
aCheckIfEnabled | is a flag to check if the library table entry is enabled. |
Definition at line 183 of file lib_table_base.cpp.
References LIB_TABLE::ensureIndex(), LIB_TABLE::fallBack, LIB_TABLE_ROW::GetIsEnabled(), LIB_TABLE::nickIndex, and LIB_TABLE::rows.
Referenced by FP_LIB_TABLE::FindRow(), FindRow(), LIB_TABLE::GetDescription(), LIB_TABLE::GetFullURI(), and LIB_TABLE::HasLibrary().
|
inherited |
Definition at line 226 of file lib_table_base.cpp.
References LIB_TABLE::ensureIndex(), LIB_TABLE::fallBack, and LIB_TABLE::rows.
Referenced by FOOTPRINT_EDIT_FRAME::KiwayMailIn(), and SYMBOL_EDIT_FRAME::KiwayMailIn().
|
overridevirtual |
Generate the table in s-expression format to aOutput with an indention level of aIndentLevel.
aOutput | is the OUTPUTFORMATTER to format the table into. |
aIndentLevel | is the indentation level (2 spaces) to indent. |
IO_ERROR | if an I/O error occurs during output. |
boost::interprocess::lock_except | if separate process attempt to access the table. |
Implements LIB_TABLE.
Definition at line 245 of file symbol_lib_table.cpp.
References OUTPUTFORMATTER::Print(), and LIB_TABLE::rows.
Referenced by DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), CADSTAR_SCH_ARCHIVE_PLUGIN::Load(), SCH_ALTIUM_PLUGIN::Load(), and SCH_EAGLE_PLUGIN::Load().
|
staticinherited |
Returns a list of options from the aProperties parameter.
The name=value pairs will be separated with the '|' character. The =value portion may not be present. You might expect something like "name1=value1|name2=value2|flag_me". Notice that flag_me does not have a value. This is ok.
aProperties | is the PROPERTIES to format or NULL. If NULL the returned string will be empty. |
Definition at line 407 of file lib_table_base.cpp.
References UTF8::begin(), UTF8::end(), name, OPT_SEP, and UTF8::size().
Referenced by DIALOG_FP_PLUGIN_OPTIONS::TransferDataFromWindow().
|
inlineinherited |
Get the number of rows contained in the table.
Definition at line 352 of file lib_table_base.h.
References LIB_TABLE::rows.
Referenced by BOOST_AUTO_TEST_CASE(), FP_TREE_SYNCHRONIZING_ADAPTER::GetLibrariesCount(), SYMBOL_GRID_TRICKS::paste_text(), FP_GRID_TRICKS::paste_text(), and SCH::IFACE::SaveFileAs().
|
inherited |
Definition at line 147 of file lib_table_base.cpp.
References LIB_TABLE::findRow(), and LIB_TABLE_ROW::GetDescr().
Referenced by SYMBOL_TREE_MODEL_ADAPTER::AddLibrary(), FOOTPRINT_EDIT_FRAME::SaveFootprintAs(), SYMBOL_EDIT_FRAME::savePartAs(), and PCB_BASE_FRAME::SelectLibrary().
|
inherited |
Return the full URI of the library mapped to aLibNickname.
Definition at line 170 of file lib_table_base.cpp.
References LIB_TABLE::findRow(), and LIB_TABLE_ROW::GetFullURI().
Referenced by CVPCB_MAINFRAME::DisplayStatus(), SCH_EDIT_FRAME::LoadSheetFromFile(), NETLIST_EXPORTER_XML::makeLibraries(), and FOOTPRINT_EDITOR_CONTROL::SaveAs().
|
static |
Definition at line 96 of file symbol_lib_table.cpp.
References g_symbolLibraryTable.
Referenced by SYMBOL_EDIT_FRAME::AddLibraryFile(), SYMBOL_EDIT_FRAME::addLibTableEntry(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), SYMBOL_EDIT_FRAME::ExportPart(), DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable(), InvokeSchEditSymbolLibTable(), SCH::IFACE::OnKifaceStart(), SYMBOL_EDIT_FRAME::replaceLibTableEntry(), SCH_BASE_FRAME::saveSymbolLibTables(), SYMBOL_EDIT_FRAME::selectSymLibTable(), SYMBOL_TREE_PANE::SYMBOL_TREE_PANE(), and DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::TransferDataFromWindow().
|
static |
Fetch the global symbol library table file name.
Definition at line 539 of file symbol_lib_table.cpp.
References SETTINGS_MANAGER::GetUserSettingsPath(), and global_tbl_name().
Referenced by SYMBOL_EDIT_FRAME::addLibTableEntry(), DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::GetGlobalTableFileName(), InvokeSchEditSymbolLibTable(), LoadGlobalTable(), SCH::IFACE::OnKifaceStart(), SYMBOL_EDIT_FRAME::replaceLibTableEntry(), SCH_BASE_FRAME::saveSymbolLibTables(), and DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::TransferDataFromWindow().
|
inherited |
Return the logical library names, all of them that are pertinent to a look up done on this LIB_TABLE.
Definition at line 262 of file lib_table_base.cpp.
References LIB_TABLE::fallBack, and LIB_TABLE::rows.
Referenced by FP_TREE_MODEL_ADAPTER::AddLibraries(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), FP_LIB_TABLE::FootprintLoadWithOptionalNickname(), FP_LIB_TABLE::GenerateTimestamp(), GetFootprintLibraries(), GetModifyHash(), guessNickname(), CVPCB_MAINFRAME::LoadFootprintFiles(), LoadSymbolWithOptionalNickname(), FOOTPRINT_VIEWER_FRAME::OnActivate(), SYMBOL_VIEWER_FRAME::OnSelectSymbol(), SCH_BASE_FRAME::PickSymbolFromLibTree(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), FOOTPRINT_EDIT_FRAME::SaveFootprintAs(), SYMBOL_EDIT_FRAME::savePartAs(), PCB_BASE_FRAME::SelectLibrary(), FOOTPRINT_LIST_IMPL::startWorkers(), and FP_TREE_SYNCHRONIZING_ADAPTER::Sync().
int SYMBOL_LIB_TABLE::GetModifyHash | ( | ) |
Definition at line 258 of file symbol_lib_table.cpp.
References FindRow(), LIB_TABLE::GetLogicalLibs(), m_modifyHash, and SYMBOL_LIB_TABLE_ROW::plugin.
Referenced by SYMBOL_LIBRARY_MANAGER::GetHash(), and SYMBOL_LIBRARY_MANAGER::Sync().
|
static |
Definition at line 550 of file symbol_lib_table.cpp.
References global_tbl_name().
Referenced by SYMBOL_EDIT_FRAME::addLibTableEntry(), DIALOG_SYMBOL_REMAP::backupProject(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), InvokeSchEditSymbolLibTable(), CADSTAR_SCH_ARCHIVE_PLUGIN::Load(), SCH_ALTIUM_PLUGIN::Load(), SCH_EAGLE_PLUGIN::Load(), SCH_EDIT_FRAME::LoadSheetFromFile(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), SYMBOL_EDIT_FRAME::replaceLibTableEntry(), SCH_BASE_FRAME::saveSymbolLibTables(), and SYMBOL_LIB_TABLE_RESCUER::WriteRescueLibrary().
|
static |
Return the name of the environment variable used to hold the directory of locally installed "KiCad sponsored" system symbol libraries.
These can be either legacy or sweet format. The only thing special about this particular environment variable is that it is set automatically by KiCad on program start up, if it is not set already in the environment.
Definition at line 489 of file symbol_lib_table.cpp.
Referenced by PANEL_SYM_LIB_TABLE::populateEnvironReadOnlyTable().
|
inherited |
Test for the existence of aNickname in the library table.
aCheckEnabled | if true will only return true for enabled libraries |
Definition at line 159 of file lib_table_base.cpp.
References LIB_TABLE::findRow().
Referenced by SYMBOL_EDIT_FRAME::addLibTableEntry(), CVPCB_MAINFRAME::DisplayStatus(), FOOTPRINT_EDIT_FRAME::KiwayMailIn(), SYMBOL_EDIT_FRAME::KiwayMailIn(), SYMBOL_LIBRARY_MANAGER::LibraryExists(), CADSTAR_SCH_ARCHIVE_PLUGIN::Load(), SCH_ALTIUM_PLUGIN::Load(), SCH_EAGLE_PLUGIN::Load(), SCH_EDIT_FRAME::LoadSheetFromFile(), NETLIST_EXPORTER_XML::makeLibraries(), SCH_BASE_FRAME::PickSymbolFromLibTree(), SYMBOL_VIEWER_FRAME::ShowModal(), FOOTPRINT_VIEWER_FRAME::ShowModal(), FP_TREE_SYNCHRONIZING_ADAPTER::Sync(), ERC_TESTER::TestLibSymbolIssues(), and SCH_SCREEN::UpdateSymbolLinks().
|
inherited |
Adds aRow if it does not already exist or if doReplace is true.
If doReplace is not true and the key for aRow already exists, the function fails and returns false.
The key for the table is the nickName, and all in this table must be unique.
aRow | is the new row to insert, or to forcibly add if doReplace is true. |
doReplace | if true, means insert regardless of whether aRow's key already exists. If false, then fail if the key already exists. |
Definition at line 302 of file lib_table_base.cpp.
References LIB_TABLE::ensureIndex(), LIB_TABLE_ROW::GetNickName(), LIB_TABLE::nickIndex, and LIB_TABLE::rows.
Referenced by PCB_BASE_EDIT_FRAME::AddLibrary(), SYMBOL_LIBRARY_MANAGER::addLibrary(), SYMBOL_EDIT_FRAME::addLibTableEntry(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), LIB_TABLE_TEST_FIXTURE::LIB_TABLE_TEST_FIXTURE(), CADSTAR_SCH_ARCHIVE_PLUGIN::Load(), SCH_ALTIUM_PLUGIN::Load(), SCH_EAGLE_PLUGIN::Load(), PCB_EDIT_FRAME::OpenProjectFiles(), FP_LIB_TABLE::Parse(), and Parse().
|
inherited |
Return true if the table is empty.
aIncludeFallback | is used to determine if the fallback table should be included in the test. |
Definition at line 138 of file lib_table_base.cpp.
References LIB_TABLE::fallBack, LIB_TABLE::IsEmpty(), and LIB_TABLE::rows.
Referenced by BOOST_AUTO_TEST_CASE(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), LIB_TABLE::IsEmpty(), PCB_EDIT_FRAME::LoadFootprints(), and SCH_EDIT_FRAME::LoadSheetFromFile().
bool SYMBOL_LIB_TABLE::IsSymbolLibLoaded | ( | const wxString & | aNickname | ) |
Return true if the library given by aNickname was successfully loaded.
aNickname | is the library nickname in the symbol library table. |
IO_ERROR | if no library at aNickname exists. |
Definition at line 434 of file symbol_lib_table.cpp.
References FindRow(), and LIB_TABLE_ROW::GetIsLoaded().
Referenced by SYMBOL_LIBRARY_MANAGER::IsLibraryLoaded().
bool SYMBOL_LIB_TABLE::IsSymbolLibWritable | ( | const wxString & | aNickname | ) |
Return true if the library given by aNickname is writable.
It is possible that some symbols libraries are read only because of where they are installed.
aNickname | is the library nickname in the symbol library table. |
IO_ERROR | if no library at aNickname exists. |
Definition at line 427 of file symbol_lib_table.cpp.
References FindRow(), LIB_TABLE_ROW::GetFullURI(), and SYMBOL_LIB_TABLE_ROW::plugin.
Referenced by SYMBOL_LIBRARY_MANAGER::IsLibraryReadOnly().
|
inherited |
Load the library table using the path defined by aFileName aFallBackTable.
aFileName | contains the full path to the s-expression file. |
IO_ERROR | if an error occurs attempting to load the footprint library table. |
Definition at line 325 of file lib_table_base.cpp.
References LIB_TABLE::Parse().
Referenced by FP_LIB_TABLE::LoadGlobalTable(), LoadGlobalTable(), SCH_EDIT_FRAME::LoadSheetFromFile(), PROJECT::PcbFootprintLibs(), SCH::IFACE::SaveFileAs(), DIALOG_GLOBAL_FP_LIB_TABLE_CONFIG::TransferDataFromWindow(), and DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::TransferDataFromWindow().
|
static |
Load the global symbol library table into aTable.
This probably should be move into the application object when KiCad is changed to a single process application. This is the least painful solution for the time being.
aTable | the SYMBOL_LIB_TABLE object to load. |
IO_ERROR | if an error occurs attempting to load the symbol library table. |
Definition at line 495 of file symbol_lib_table.cpp.
References _, SEARCH_STACK::AddPaths(), SEARCH_STACK::FindValidPath(), Format(), GetGlobalTableFileName(), global_tbl_name(), LIB_TABLE::Load(), Pgm(), LIB_TABLE::Save(), SystemDirsAppend(), and THROW_IO_ERROR.
Referenced by SCH::IFACE::OnKifaceStart(), and DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::TransferDataFromWindow().
LIB_PART * SYMBOL_LIB_TABLE::LoadSymbol | ( | const wxString & | aNickname, |
const wxString & | aName | ||
) |
Load a LIB_PART having aName from the library given by aNickname.
aNickname | is a locator for the "library", it is a "name" in LIB_TABLE_ROW |
aName | is the name of the LIB_PART to load. |
aFlatten | set to true to flatten derived parts. |
IO_ERROR | if the library cannot be found or read. No exception is thrown in the case where aNickname cannot be found. |
Definition at line 352 of file symbol_lib_table.cpp.
References FindRow(), LIB_TABLE_ROW::GetFullURI(), LIB_PART::GetLibId(), LIB_TABLE_ROW::GetNickName(), LIB_TABLE_ROW::GetProperties(), SYMBOL_LIB_TABLE_ROW::plugin, LIB_PART::SetLibId(), and LIB_ID::SetLibNickname().
Referenced by FOOTPRINT_INFO_GENERATOR::GenerateHtml(), SYMBOL_LIBRARY_MANAGER::GetAlias(), SYMBOL_LIBRARY_MANAGER::GetBufferedPart(), SYMBOL_LIBRARY_MANAGER::getOriginalParts(), SCH_EAGLE_PLUGIN::loadInstance(), LoadSymbol(), LoadSymbolWithOptionalNickname(), SYMBOL_LIBRARY_MANAGER::PartExists(), SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer(), SchGetLibPart(), and SCH_SCREEN::UpdateSymbolLinks().
Definition at line 182 of file symbol_lib_table.h.
References LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), and LoadSymbol().
void SYMBOL_LIB_TABLE::LoadSymbolLib | ( | std::vector< LIB_PART * > & | aAliasList, |
const wxString & | aNickname, | ||
bool | aPowerSymbolsOnly = false |
||
) |
Definition at line 320 of file symbol_lib_table.cpp.
References FindRow(), LIB_TABLE_ROW::GetFullURI(), LIB_TABLE_ROW::GetNickName(), LIB_TABLE_ROW::GetOptions(), LIB_TABLE_ROW::GetProperties(), SYMBOL_LIB_TABLE_ROW::plugin, PropPowerSymsOnly, LIB_ID::SetLibNickname(), LIB_TABLE_ROW::SetLoaded(), and LIB_TABLE_ROW::SetOptions().
Referenced by SYMBOL_TREE_MODEL_ADAPTER::AddLibrary(), and SYMBOL_LIBRARY_MANAGER::GetAliases().
Load a LIB_PART having aFootprintId with possibly an empty library nickname.
aId | the library nickname and name of the symbol to load. |
IO_ERROR | if the library cannot be found or read. No exception is thrown in the case where aId cannot be found. |
PARSE_ERROR | if aId is not parsed OK. |
Definition at line 458 of file symbol_lib_table.cpp.
References LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), LIB_TABLE::GetLogicalLibs(), LoadSymbol(), and name.
|
inlineinherited |
Definition at line 347 of file lib_table_base.h.
|
inlineinherited |
Compares this table against another.
This compares the row contents against each other. Any fallback tables are not checked.
Definition at line 331 of file lib_table_base.h.
References LIB_TABLE::rows.
|
overridevirtual |
Parse the #LIB_TABLE_LEXER s-expression library table format into the appropriate LIB_TABLE_ROW objects.
aLexer | is the lexer to parse. |
IO_ERROR | if an I/O error occurs during parsing. |
PARSER_ERROR | if the lexer format to parse is invalid. |
boost::bad_pointer | if an any attempt to add an invalid pointer to the boost::ptr_vector. |
boost::bad_index | if an index outside the row table bounds is accessed. |
Implements LIB_TABLE.
Definition at line 102 of file symbol_lib_table.cpp.
References _, Format(), LIB_TABLE::InsertRow(), and THROW_IO_ERROR.
Referenced by SYMBOL_GRID_TRICKS::paste_text().
|
staticinherited |
Parses aOptionsList and places the result into a PROPERTIES object which is returned.
If the options field is empty, then the returned PROPERTIES will be a NULL pointer.
Typically aOptionsList comes from the "options" field within a LIB_TABLE_ROW and the format is simply a comma separated list of name value pairs. e.g.: [name1[=value1][|name2[=value2]]] etc. When using the UI to create or edit a library table, this formatting is handled for you.
Definition at line 346 of file lib_table_base.cpp.
Referenced by LIB_TABLE_ROW::SetOptions(), and DIALOG_FP_PLUGIN_OPTIONS::TransferDataToWindow().
|
inlineprotectedinherited |
Definition at line 502 of file lib_table_base.h.
References LIB_TABLE::nickIndex, and LIB_TABLE::rows.
Referenced by LIB_TABLE::ensureIndex(), PANEL_FP_LIB_TABLE::TransferDataFromWindow(), and PANEL_SYM_LIB_TABLE::TransferDataFromWindow().
|
inlineinherited |
Removes a row from the table.
aRow | is the row to remove |
Definition at line 429 of file lib_table_base.h.
References LIB_TABLE::rows.
Referenced by SYMBOL_LIBRARY_MANAGER::addLibrary().
|
inherited |
Write this library table to aFileName in s-expression form.
aFileName | is the name of the file to write to. |
Definition at line 339 of file lib_table_base.cpp.
References LIB_TABLE::Format().
Referenced by PCB_BASE_EDIT_FRAME::AddLibrary(), SYMBOL_EDIT_FRAME::addLibTableEntry(), InvokePcbLibTableEditor(), InvokeSchEditSymbolLibTable(), FP_LIB_TABLE::LoadGlobalTable(), LoadGlobalTable(), PCB_EDIT_FRAME::OpenProjectFiles(), SYMBOL_EDIT_FRAME::replaceLibTableEntry(), SCH::IFACE::SaveFileAs(), SCH_BASE_FRAME::saveSymbolLibTables(), DIALOG_GLOBAL_FP_LIB_TABLE_CONFIG::TransferDataFromWindow(), and DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::TransferDataFromWindow().
SYMBOL_LIB_TABLE::SAVE_T SYMBOL_LIB_TABLE::SaveSymbol | ( | const wxString & | aNickname, |
const LIB_PART * | aSymbol, | ||
bool | aOverwrite = true |
||
) |
Write aSymbol to an existing library given by aNickname.
If a LIB_PART by the same name already exists or there are any conflicting alias names, the new LIB_PART will silently overwrite any existing aliases and/or part becaue libraries cannot have duplicate alias names. It is the responsibility of the caller to check the library for conflicts before saving.
aNickname | is a locator for the "library", it is a "name" in LIB_TABLE_ROW |
aSymbol | is what to store in the library. The library owns the symbol after this call. |
aOverwrite | when true means overwrite any existing symbol by the same name, else if false means skip the write and return SAVE_SKIPPED. |
IO_ERROR | if there is a problem saving the symbol. |
Definition at line 381 of file symbol_lib_table.cpp.
References FindRow(), LIB_TABLE_ROW::GetFullURI(), LIB_PART::GetLibId(), LIB_ID::GetLibItemName(), LIB_TABLE_ROW::GetProperties(), name, SYMBOL_LIB_TABLE_ROW::plugin, SAVE_OK, and SAVE_SKIPPED.
Referenced by SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer().
|
inlineoverridevirtual |
Implements PROJECT::_ELEM.
Definition at line 117 of file symbol_lib_table.h.
References SYMBOL_LIB_TABLE_T.
|
friend |
Definition at line 112 of file symbol_lib_table.h.
|
friend |
Definition at line 111 of file symbol_lib_table.h.
|
protectedinherited |
Definition at line 535 of file lib_table_base.h.
Referenced by LIB_TABLE::findRow(), LIB_TABLE::FindRowByURI(), LIB_TABLE::GetLogicalLibs(), and LIB_TABLE::IsEmpty().
|
staticprivate |
helper for GetModifyHash()
Definition at line 114 of file symbol_lib_table.h.
Referenced by GetModifyHash().
|
protectedinherited |
this particular key is the nickName within each row.
Definition at line 533 of file lib_table_base.h.
Referenced by LIB_TABLE::Clear(), LIB_TABLE::ensureIndex(), LIB_TABLE::findRow(), LIB_TABLE::InsertRow(), and LIB_TABLE::reindex().
|
static |
Definition at line 120 of file symbol_lib_table.h.
|
static |
Definition at line 119 of file symbol_lib_table.h.
Referenced by SCH_SEXPR_PLUGIN::EnumerateSymbolLib(), SCH_LEGACY_PLUGIN::EnumerateSymbolLib(), EnumerateSymbolLib(), and LoadSymbolLib().
|
protectedinherited |
Definition at line 524 of file lib_table_base.h.
Referenced by SYMBOL_LIB_TABLE_GRID::at(), FP_LIB_TABLE_GRID::at(), LIB_TABLE::At(), SYMBOL_LIB_TABLE_GRID::begin(), FP_LIB_TABLE_GRID::begin(), LIB_TABLE::Clear(), SYMBOL_LIB_TABLE_GRID::erase(), FP_LIB_TABLE_GRID::erase(), LIB_TABLE::findRow(), LIB_TABLE::FindRowByURI(), FP_LIB_TABLE::Format(), Format(), FP_LIB_TABLE_GRID::FP_LIB_TABLE_GRID(), LIB_TABLE::GetCount(), LIB_TABLE::GetLogicalLibs(), SYMBOL_LIB_TABLE_GRID::insert(), FP_LIB_TABLE_GRID::insert(), LIB_TABLE::InsertRow(), LIB_TABLE::IsEmpty(), PANEL_SYM_LIB_TABLE::moveDownHandler(), PANEL_FP_LIB_TABLE::moveDownHandler(), PANEL_SYM_LIB_TABLE::moveUpHandler(), PANEL_FP_LIB_TABLE::moveUpHandler(), FP_LIB_TABLE::operator==(), LIB_TABLE::operator==(), SYMBOL_GRID_TRICKS::paste_text(), FP_GRID_TRICKS::paste_text(), SYMBOL_LIB_TABLE_GRID::push_back(), FP_LIB_TABLE_GRID::push_back(), LIB_TABLE::reindex(), LIB_TABLE::RemoveRow(), SYMBOL_LIB_TABLE_GRID::size(), FP_LIB_TABLE_GRID::size(), SYMBOL_LIB_TABLE_GRID::SYMBOL_LIB_TABLE_GRID(), PANEL_FP_LIB_TABLE::TransferDataFromWindow(), and PANEL_SYM_LIB_TABLE::TransferDataFromWindow().