49 std::function<
void(
int,
int,
const wxString& )> aProgressCallback )
62 for(
const auto& lib :
m_libs )
64 if( lib.second.IsModified() )
76 for(
const auto& lib :
m_libs )
77 hash += lib.second.GetHash();
85 const auto libBufIt =
m_libs.find( aLibrary );
87 if( libBufIt !=
m_libs.end() )
88 return libBufIt->second.GetHash();
93 return row ? std::hash<std::string>{}( aLibrary.ToStdString() +
94 row->GetFullURI(
true ).ToStdString() ) : -1;
102 for(
const auto& libName :
symTable()->GetLogicalLibs() )
119 wxLogMessage(
_(
"Cannot find library \"%s\" in the Symbol Library Table (%s)" ),
120 aLibrary, e.
What() );
128 SCH_IO_MGR::SCH_FILE_T aFileType )
130 wxCHECK( aFileType != SCH_IO_MGR::SCH_FILE_T::SCH_LEGACY &&
LibraryExists( aLibrary ),
false );
131 wxFileName fn( aFileName );
132 wxCHECK( !fn.FileExists() || fn.IsFileWritable(), false );
139 auto it =
m_libs.find( aLibrary );
146 const auto& partBuffers = libBuf.
GetBuffers();
148 for(
const auto& partBuf : partBuffers )
150 if( !libBuf.
SaveBuffer( partBuf, &*pi,
true ) )
158 wxFileName original, destination( aFileName );
163 original = row->GetFullURI(
true );
164 original.Normalize();
167 destination.Normalize();
169 if( res && original == destination )
179 if( part->IsAlias() )
181 std::shared_ptr< LIB_PART > oldParent = part->
GetParent().lock();
183 wxCHECK_MSG( oldParent,
false,
187 LIB_PART* libParent = pi->LoadSymbol( aLibrary, oldParent->GetName(), &properties );
191 libParent =
new LIB_PART( *oldParent.get() );
192 pi->SaveSymbol( aLibrary, libParent, &properties );
197 pi->SaveSymbol( aLibrary, newSymbol, &properties );
199 else if( !pi->LoadSymbol( aLibrary, part->GetName(), &properties ) )
201 pi->SaveSymbol( aLibrary,
new LIB_PART( *part ), &properties );
208 pi->SaveLibrary( aFileName );
223 auto it =
m_libs.find( aLibrary );
224 return it !=
m_libs.end() ? it->second.IsModified() :
false;
230 auto libIt =
m_libs.find( aLibrary );
232 if( libIt ==
m_libs.end() )
237 return partBuf ? partBuf->IsModified() :
false;
243 auto libIt =
m_libs.find( aLibrary );
245 if( libIt ==
m_libs.end() )
248 for(
auto& partBuf : libIt->second.GetBuffers() )
262 auto libI =
m_libs.find( aLibrary );
264 if( libI ==
m_libs.end() )
267 auto partBuf = libI->second.GetBuffer( aAlias );
268 wxCHECK( partBuf,
false );
270 partBuf->GetScreen()->ClrModify();
293 std::list<LIB_PART*> ret;
296 auto libIt =
m_libs.find( aLibrary );
298 if( libIt !=
m_libs.end() )
300 for(
auto& partBuf : libIt->second.GetBuffers() )
302 ret.push_back( partBuf->GetPart() );
307 std::vector<LIB_PART*> aliases;
318 std::copy( aliases.begin(), aliases.end(), std::back_inserter( ret ) );
326 const wxString& aLibrary )
341 if( part ==
nullptr )
349 std::shared_ptr< LIB_PART > parent = part->
GetParent().lock();
350 wxCHECK_MSG( parent,
nullptr,
355 bufferedParent = libBuf.
GetPart( parent->GetName() );
357 if( !bufferedParent )
359 bufferedParent =
new LIB_PART( *parent.get() );
364 bufferedPart =
new LIB_PART( *part );
367 bufferedPart->
SetParent( bufferedParent );
373 wxLogMessage(
_(
"Error loading symbol \"%s\" from library \"%s\". (%s)" ),
374 aAlias, aLibrary, e.
What() );
375 bufferedPart =
nullptr;
386 wxCHECK( !aAlias.IsEmpty(), nullptr );
387 auto it =
m_libs.find( aLibrary );
388 wxCHECK( it !=
m_libs.end(), nullptr );
392 return partBuf ? partBuf->GetScreen() :
nullptr;
399 wxCHECK( aPart,
false );
405 LIB_PART* bufferedPart = const_cast< LIB_PART* >( partBuf->GetPart() );
407 wxCHECK( bufferedPart,
false );
409 *bufferedPart = *aPart;
410 partBuf->GetScreen()->SetModify();
428 const wxString& aLibrary )
431 auto partBuf = libBuf.
GetBuffer( aOldName );
433 wxCHECK( partBuf,
false );
444 auto it =
m_libs.find( aLibrary );
449 auto partBuf = it->second.GetBuffer( aAlias );
450 wxCHECK( partBuf,
false );
452 return it->second.SaveBuffer( partBuf,
symTable() );
458 auto it =
m_libs.find( aLibrary );
461 return LIB_ID( aLibrary, aAlias );
463 auto partBuf = it->second.GetBuffer( aAlias );
464 wxCHECK( partBuf,
LIB_ID( aLibrary, aAlias ) );
465 LIB_PART original( *partBuf->GetOriginal() );
467 if( original.GetName() != aAlias )
473 partBuf->SetPart(
new LIB_PART( original ) );
477 return LIB_ID( aLibrary, original.GetName() );
483 auto it =
m_libs.find( aLibrary );
503 for(
const auto& lib :
m_libs )
505 if( !lib.second.IsModified() )
508 for(
const auto& buffer : lib.second.GetBuffers() )
510 if( !buffer->IsModified() )
513 RevertPart( lib.first, buffer->GetOriginal()->GetName() );
524 auto partBuf = libBuf.
GetBuffer( aAlias );
525 wxCHECK( partBuf,
false );
537 const wxString& aLibrary )
const 540 auto libIt =
m_libs.find( aLibrary );
542 if( libIt !=
m_libs.end() )
544 LIB_PART* part = libIt->second.GetPart( aAlias );
559 wxLogMessage(
_(
"Cannot load symbol \"%s\" from library \"%s\" (%s)" ),
560 aAlias, aLibrary, e.
What() );
569 auto libBufIt =
m_libs.find( aLibrary );
572 if( libBufIt !=
m_libs.end() )
573 return !!libBufIt->second.GetBuffer( aAlias );
584 return alias !=
nullptr;
590 if( aLibrary.IsEmpty() )
593 if(
m_libs.count( aLibrary ) > 0 )
602 wxString
name =
"New_Library";
609 for(
unsigned int i = 0; i < std::numeric_limits<unsigned int>::max(); ++i )
616 return wxEmptyString;
621 wxArrayString& aRootSymbolNames )
630 const wxString& aLibraryName )
640 wxFileName fn( aFilePath );
648 wxCHECK( aTable,
false );
655 if( relPath.IsEmpty() )
665 wxCHECK( schFileType != SCH_IO_MGR::SCH_FILE_T::SCH_LEGACY,
false );
692 std::set<LIB_PART*> parts;
697 wxArrayString aliases;
700 for(
const auto& aliasName : aliases )
703 parts.insert( alias );
708 wxLogMessage(
_(
"Cannot enumerate library \"%s\" (%s)" ), aLibrary, e.
What() );
717 auto it =
m_libs.find( aLibrary );
730 if( part->IsAlias() )
732 std::shared_ptr< LIB_PART > oldParent = part->
GetParent().lock();
734 wxCHECK_MSG( oldParent, buf,
742 libParent =
new LIB_PART( *oldParent.get() );
750 else if( !buf.
GetPart( part->GetName() ) )
761 std::unique_ptr<SCH_SCREEN> aScreen ) :
762 m_screen(
std::move( aScreen ) ),
778 wxCHECK( m_part != aPart, );
784 if( m_original->GetLibId().GetLibNickname() != m_part->GetLibId().GetLibNickname() )
786 m_original->
SetLibId(
LIB_ID( m_part->GetLibId().GetLibNickname(),
787 m_original->GetLibId().GetLibItemName() ) );
794 wxCHECK( m_original != aPart, );
800 if( m_original->GetLibId().GetLibNickname() != m_part->GetLibId().GetLibNickname() )
802 m_original->
SetLibId(
LIB_ID( m_part->GetLibId().GetLibNickname(),
803 m_original->GetLibId().GetLibItemName() ) );
810 return m_screen && m_screen->IsModify();
816 auto buf = GetBuffer( aAlias );
823 wxCHECK( part,
nullptr );
832 wxASSERT( aCopy->
GetLib() == nullptr );
833 std::unique_ptr<SCH_SCREEN> screen( aScreen );
834 auto partBuf = std::make_shared<PART_BUFFER>( aCopy, std::move( screen ) );
835 m_parts.push_back( partBuf );
851 wxCHECK( aCopy && aPartBuf,
false );
853 LIB_PART* bufferedPart = aPartBuf->GetPart();
855 wxCHECK( bufferedPart,
false );
857 *bufferedPart = *aCopy;
866 auto partBufIt = std::find( m_parts.begin(), m_parts.end(), aPartBuf );
867 wxCHECK( partBufIt != m_parts.end(), false );
872 if( aPartBuf->GetPart()->IsRoot() &&
HasDerivedSymbols( aPartBuf->GetPart()->GetName() )
873 && removeChildSymbols( aPartBuf ) == 0 )
878 m_deleted.emplace_back( *partBufIt );
879 m_parts.erase( partBufIt );
889 wxCHECK( aPartBuf,
false );
890 LIB_PART* part = aPartBuf->GetPart();
891 LIB_PART* originalPart = aPartBuf->GetOriginal();
892 wxCHECK( part && originalPart,
false );
906 std::shared_ptr< LIB_PART > bufferedParent = part->
GetParent().lock();
908 wxCHECK( bufferedParent,
false );
910 LIB_PART* cachedParent = aLibTable->
LoadSymbol( m_libName, bufferedParent->GetName() );
914 cachedParent =
new LIB_PART( *bufferedParent.get() );
915 newCachedPart->
SetParent( cachedParent );
916 result = aLibTable->
SaveSymbol( m_libName, cachedParent );
918 result = aLibTable->
SaveSymbol( m_libName, newCachedPart );
922 aPartBuf->SetOriginal( originalParent );
923 originalPart =
new LIB_PART( *part );
924 originalPart->
SetParent( originalParent );
925 aPartBuf->SetOriginal( originalPart );
929 newCachedPart->
SetParent( cachedParent );
930 result = aLibTable->
SaveSymbol( m_libName, newCachedPart );
934 GetBuffer( bufferedParent->GetName() );
935 wxCHECK( originalBufferedParent,
false );
936 originalPart =
new LIB_PART( *part );
937 originalPart->
SetParent( originalBufferedParent->GetPart() );
938 aPartBuf->SetOriginal( originalPart );
943 wxArrayString derivedSymbols;
945 if( GetDerivedSymbolNames( part->
GetName(), derivedSymbols ) == 0 )
949 aPartBuf->SetOriginal(
new LIB_PART( *part ) );
955 aLibTable->
SaveSymbol( m_libName, parentSymbol );
957 for(
auto entry : derivedSymbols )
961 derivedSymbol->
SetParent( parentSymbol );
962 result = aLibTable->
SaveSymbol( m_libName, derivedSymbol );
976 wxCHECK( aPartBuf,
false );
977 LIB_PART* part = aPartBuf->GetPart();
978 LIB_PART* originalPart = aPartBuf->GetOriginal();
979 wxCHECK( part && originalPart,
false );
981 wxString errorMsg =
_(
"An error \"%s\" occurred saving symbol \"%s\" to library \"%s\"" );
996 std::shared_ptr< LIB_PART > bufferedParent = part->
GetParent().lock();
998 wxCHECK( bufferedParent,
false );
1004 cachedParent = aPlugin->
LoadSymbol( m_libName, bufferedParent->GetName() );
1013 cachedParent =
new LIB_PART( *bufferedParent.get() );
1014 newCachedPart->
SetParent( cachedParent );
1018 aPlugin->
SaveSymbol( m_libName, cachedParent, aBuffer ? &properties :
nullptr );
1022 wxLogError( errorMsg, ioe.
What(), cachedParent->
GetName() );
1028 aPlugin->
SaveSymbol( m_libName, newCachedPart, aBuffer ? &properties :
nullptr );
1032 wxLogError( errorMsg, ioe.
What(), newCachedPart->
GetName() );
1037 aPartBuf->SetOriginal( originalParent );
1038 originalPart =
new LIB_PART( *part );
1039 originalPart->
SetParent( originalParent );
1040 aPartBuf->SetOriginal( originalPart );
1044 newCachedPart->
SetParent( cachedParent );
1048 aPlugin->
SaveSymbol( m_libName, newCachedPart, aBuffer ? &properties :
nullptr );
1052 wxLogError( errorMsg, ioe.
What(), newCachedPart->
GetName() );
1057 GetBuffer( bufferedParent->GetName() );
1058 wxCHECK( originalBufferedParent,
false );
1059 originalPart =
new LIB_PART( *part );
1060 originalPart->
SetParent( originalBufferedParent->GetPart() );
1061 aPartBuf->SetOriginal( originalPart );
1066 wxArrayString derivedSymbols;
1068 if( GetDerivedSymbolNames( part->
GetName(), derivedSymbols ) == 0 )
1073 aBuffer ? &properties :
nullptr );
1077 wxLogError( errorMsg, ioe.
What(), part->
GetName() );
1081 aPartBuf->SetOriginal(
new LIB_PART( *part ) );
1090 aPlugin->
SaveSymbol( m_libName, parentSymbol, aBuffer ? &properties :
nullptr );
1094 wxLogError( errorMsg, ioe.
What(), part->
GetName() );
1098 aPartBuf->SetOriginal(
new LIB_PART( *part ) );
1101 for(
auto entry : derivedSymbols )
1105 derivedSymbol->
SetParent( parentSymbol );
1110 aBuffer ? &properties :
nullptr );
1114 wxLogError( errorMsg, ioe.
What(), derivedSymbol->
GetName() );
1129 for(
auto entry : m_parts )
1131 if( entry->GetPart()->GetName() == aAlias )
1141 for(
auto entry : m_parts )
1143 if( entry->GetPart()->IsAlias() )
1145 PART_SPTR parent = entry->GetPart()->GetParent().lock();
1148 wxCHECK( parent,
false );
1150 if( parent->GetName() == aParentName )
1161 for(
auto entry : m_parts )
1163 if( entry->GetPart()->IsAlias() )
1166 aRootSymbolNames.Add( entry->GetPart()->GetName() );
1172 wxArrayString& aList )
1174 wxCHECK( !aSymbolName.IsEmpty(), 0 );
1176 for(
auto entry : m_parts )
1178 if( entry->GetPart()->IsAlias() )
1180 PART_SPTR parent = entry->GetPart()->GetParent().lock();
1183 wxCHECK( parent,
false );
1185 if( parent->GetName() == aSymbolName )
1186 aList.Add( entry->GetPart()->GetName() );
1190 return aList.GetCount();
1196 wxCHECK( aPartBuf && aPartBuf->GetPart()->IsRoot(), 0 );
1199 std::deque< SYMBOL_LIBRARY_MANAGER::PART_BUFFER::PTR >::iterator it = m_parts.begin();
1201 while( it != m_parts.end() )
1204 if( (*it)->GetPart()->IsRoot() )
1210 PART_SPTR parent = (*it)->GetPart()->GetParent().lock();
1212 wxCHECK2( parent, ++it; continue );
1214 if( parent->GetName() == aPartBuf->GetPart()->GetName() )
1216 wxCHECK2( parent == aPartBuf->GetPart()->SharedPtr(), ++it; continue );
1218 m_deleted.emplace_back( *it );
1219 it = m_parts.erase( it );
static SCH_FILE_T GuessPluginTypeFromLibPath(const wxString &aLibPath)
Return a plugin type given a symbol library using the file extension of aLibPath.
bool ClearPartModified(const wxString &aAlias, const wxString &aLibrary) const
Clear the modified flag for a part.
SAVE_T SaveSymbol(const wxString &aNickname, const LIB_PART *aSymbol, bool aOverwrite=true)
Write aSymbol to an existing library given by aNickname.
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.
void EnumerateSymbolLib(const wxString &aNickname, wxArrayString &aAliasNames, bool aPowerSymbolsOnly=false)
Return a list of symbol alias names contained within the library given by aNickname.
const UTF8 & GetLibItemName() const
Hold a record identifying a symbol library accessed by the appropriate symbol library SCH_PLUGIN obje...
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 worki...
bool HasLibrary(const wxString &aNickname, bool aCheckEnabled=false) const
Test for the existence of aNickname in the library table.
LIB_ID GetLibId() const override
void GetRootSymbolNames(const wxString &aLibName, wxArrayString &aRootSymbolNames)
bool RemovePart(const wxString &aName, const wxString &aLibrary)
Remove the part from the part buffer.
static wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > Create(SYMBOL_EDIT_FRAME *aParent, SYMBOL_LIBRARY_MANAGER *aLibs)
wxString GetName() const override
void CreateSymbolLib(const wxString &aNickname)
bool InsertRow(LIB_TABLE_ROW *aRow, bool doReplace=false)
Adds aRow if it does not already exist or if doReplace is true.
bool ClearLibraryModified(const wxString &aLibrary) const
Clear the modified flag for all parts in a library.
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).
SYMBOL_LIBRARY_MANAGER(SYMBOL_EDIT_FRAME &aFrame)
static const wxString ShowType(SCH_FILE_T aFileType)
Return a brief name for a plugin, given aFileType enum.
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.
bool CreateBuffer(LIB_PART *aCopy, SCH_SCREEN *aScreen)
Update the buffered part with the contents of aCopy.
static wxString getLibraryName(const wxString &aFilePath)
< Extract library name basing on the file name.
virtual void DeleteSymbol(const wxString &aLibraryPath, const wxString &aSymbolName, const PROPERTIES *aProperties=NULL)
Delete the entire LIB_PART associated with aAliasName from the library aLibraryPath.
SYMBOL_LIB_TABLE * symTable() const
LIB_PART * LoadSymbol(const wxString &aNickname, const wxString &aName)
Load a LIB_PART having aName from the library given by aNickname.
std::shared_ptr< LIB_PART > PART_SPTR
shared pointer to LIB_PART
PART_BUFFER(LIB_PART *aPart=nullptr, std::unique_ptr< SCH_SCREEN > aScreen=nullptr)
A logical library item identifier and consists of various portions much like a URI.
SYMBOL_EDIT_FRAME & m_frame
Parent frame.
A name/value tuple with unique names and optional values.
bool IsSymbolLibWritable(const wxString &aNickname)
Return true if the library given by aNickname is writable.
bool HasModifications() const
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
bool UpdatePart(LIB_PART *aPart, const wxString &aLibrary)
Update the part buffer with a new version of the part.
bool RevertLibrary(const wxString &aLibrary)
Revert unsaved changes for a particular library.
virtual const wxString Problem() const
what was the problem?
LIB_BUFFER & getLibraryBuffer(const wxString &aLibrary)
Return an existing library buffer or creates one to using Symbol Library Table to get the original da...
LIB_PART * GetPart(const wxString &aAlias) const
Create a new buffer to store a part. LIB_BUFFER takes ownership of aCopy.
bool IsSymbolLibLoaded(const wxString &aNickname)
Return true if the library given by aNickname was successfully loaded.
bool addLibrary(const wxString &aFilePath, bool aCreate, SYMBOL_LIB_TABLE *aTable)
Return the current Symbol Library Table.
void Sync(const wxString &aForceRefresh, std::function< void(int, int, const wxString &)> aProgressCallback)
bool FlushPart(const wxString &aAlias, const wxString &aLibrary)
Save part changes to the library copy used by the schematic editor.
LIB_PART * GetBufferedPart(const wxString &aAlias, const wxString &aLibrary)
Return the part copy from the buffer.
Base class that schematic file and library loading and saving plugins should derive from.
wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > m_adapter
bool UpdateBuffer(PART_BUFFER::PTR aPartBuf, LIB_PART *aCopy)
bool RevertAll()
Revert all pending changes.
wxString GetUniqueLibraryName() const
Return a library name that is not currently in use.
virtual const wxString What() const
A composite of Problem() and Where()
SYMBOL_LIB_TABLE_ROW * GetLibrary(const wxString &aLibrary) const
Find a single library within the (aggregate) library table.
int GetLibraryHash(const wxString &aLibrary) const
Return a library hash value to determine if it has changed.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
void ClearDeletedBuffer()
Save stored modifications to Symbol Lib Table.
bool IsLibraryReadOnly(const wxString &aLibrary) const
Return true if the library is stored in a read-only file.
virtual LIB_PART * LoadSymbol(const wxString &aLibraryPath, const wxString &aPartName, const PROPERTIES *aProperties=NULL)
Load a LIB_PART object having aPartName from the aLibraryPath containing a library format that this S...
void SetParent(LIB_PART *aParent=nullptr)
void LoadSymbolLib(std::vector< LIB_PART * > &aAliasList, const wxString &aNickname, bool aPowerSymbolsOnly=false)
Define a library symbol object.
std::map< wxString, LIB_BUFFER > m_libs
bool DeleteBuffer(PART_BUFFER::PTR aPartBuf)
SYMBOL_TREE_SYNCHRONIZING_ADAPTER * getAdapter()
Class to store a working copy of a LIB_PART object and editor context.
bool HasDerivedSymbols(const wxString &aSymbolName, const wxString &aLibraryName)
Check if symbol aSymbolName in library aLibraryName is a root symbol that has derived symbols.
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.
const std::deque< PART_BUFFER::PTR > & GetBuffers() const
void GetRootSymbolNames(wxArrayString &aRootSymbolNames)
Fetch a list of root symbols names from the library buffer.
int removeChildSymbols(PART_BUFFER::PTR aPartBuf)
Remove all symbols derived from aParent from the library buffer.
void SetPart(LIB_PART *aPart)
int SetLibNickname(const UTF8 &aNickname)
Override the logical library name portion of the LIB_ID to aNickname.
bool RemoveRow(LIB_TABLE_ROW *aRow)
Removes a row from the table.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
wxArrayString GetLibraryNames() const
Return the array of library names.
Helper object to release a SCH_PLUGIN in the context of a potential thrown exception through its dest...
std::set< LIB_PART * > getOriginalParts(const wxString &aLibrary)
Return a set of LIB_PART objects belonging to the original library.
LIB_ID RevertPart(const wxString &aAlias, const wxString &aLibrary)
Revert unsaved changes for a particular part.
bool IsLibraryModified(const wxString &aLibrary) const
Return true if library has unsaved modifications.
bool LibraryExists(const wxString &aLibrary, bool aCheckEnabled=false) const
Return true if library exists.
void DeleteSymbol(const wxString &aNickname, const wxString &aSymbolName)
Deletes the aSymbolName from the library given by aNickname.
void SetOriginal(LIB_PART *aPart)
bool IsLibraryLoaded(const wxString &aLibrary) const
Return true if the library was successfully loaded.
size_t GetDerivedSymbolNames(const wxString &aSymbolName, wxArrayString &aList)
Fetch all of the symbols derived from a aSymbolName into aList.
int m_syncHash
Symbol lib table hash value from last synchronization.
static const char * PropBuffering
The property used internally by the plugin to enable cache buffering which prevents the library file ...
PART_BUFFER::PTR GetBuffer(const wxString &aAlias) const
Return all buffered parts.
virtual void SaveSymbol(const wxString &aLibraryPath, const LIB_PART *aSymbol, const PROPERTIES *aProperties=NULL)
Write aSymbol to an existing library located at aLibraryPath.
SCH_SCREEN * GetScreen(const wxString &aAlias, const wxString &aLibrary)
Return the screen used to edit a specific part.
SAVE_T
The set of return values from SaveSymbol() below.
std::list< LIB_PART * > GetAliases(const wxString &aLibrary) const
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 f...
Definition for part library class.
bool SaveBuffer(PART_BUFFER::PTR aPartBuf, SYMBOL_LIB_TABLE *aLibTable)
Save stored modifications using a plugin.
bool HasDerivedSymbols(const wxString &aParentName) const
Check to see any parts in the buffer are derived from a parent named aParentName.
void SyncLibraries(bool aShowProgress, const wxString &aForceRefresh=wxEmptyString)
Synchronize the library manager to the symbol library table, and then the symbol tree to the library ...
void SetLibId(const LIB_ID &aLibId)
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
#define THROW_IO_ERROR(msg)
std::shared_ptr< PART_BUFFER > PTR
wxString NormalizePath(const wxFileName &aFilePath, const ENV_VAR_MAP *aEnvVars, const wxString &aProjectPath)
Normalize a file path to an environmental variable, if possible.
The symbol library editor main window.
bool IsPartModified(const wxString &aAlias, const wxString &aLibrary) const
Return true if part has unsaved modifications.