32 std::vector<KI_ERROR>& aErrors )
46 if( status && status->error )
47 message.
SetTitle( wxString::Format(
_(
"Library '%s': %s" ), aNickname, status->error->message ) );
49 message.
SetTitle( wxString::Format(
_(
"Library '%s' could not be loaded." ), aNickname ) );
52 aErrors.emplace_back( std::move( message ) );
59 SCH_SCREENS& aScreens, std::vector<KI_ERROR>& aErrors )
67 if( !
loadLibrary( aAdapter, aCacheNickname, aErrors ) )
70 std::vector<wxString> cacheSymbols = aAdapter.
GetSymbolNames( aCacheNickname );
71 std::set<wxString> cacheSymbolSet( cacheSymbols.begin(), cacheSymbols.end() );
73 if( cacheSymbolSet.empty() )
76 std::vector<wxString> loadedLibs;
80 const wxString& libName = row->Nickname();
84 if( libName == aCacheNickname || row->Disabled() )
88 loadedLibs.push_back( libName );
101 if( !cacheSymbolSet.count( fullLibName.
wx_str() ) )
104 bool alreadyExists =
false;
106 for(
const wxString& libName : loadedLibs )
110 alreadyExists =
true;
Holds a structured error message.
KI_ERROR & SetSeverity(SEVERITY aSeverity)
KI_ERROR & SetTitle(const wxString &aTitle)
void AbortAsyncLoad()
Aborts any async load in progress; blocks until fully done aborting.
bool IsLibraryLoaded(const wxString &aNickname)
std::vector< LIBRARY_TABLE_ROW * > Rows(LIBRARY_TABLE_SCOPE aScope=LIBRARY_TABLE_SCOPE::BOTH, bool aIncludeInvalid=false) const
Like LIBRARY_MANAGER::Rows but filtered to the LIBRARY_TABLE_TYPE of this adapter.
std::optional< LIB_STATUS > LoadLibraryEntry(const wxString &aNickname)
Synchronously loads the named library to LOADED state.
A logical library item identifier and consists of various portions much like a URI.
int SetLibItemName(const UTF8 &aLibItemName)
Override the library item name portion of the LIB_ID to aLibItemName.
int SetLibNickname(const UTF8 &aLibNickname)
Override the logical library name portion of the LIB_ID to aLibNickname.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
void SetLibId(const LIB_ID &aName)
const LIB_ID & GetLibId() const override
An interface to the global shared library manager that is schematic-specific and linked to one projec...
LIB_SYMBOL * LoadSymbol(const wxString &aNickname, const wxString &aName)
Load a LIB_SYMBOL having aName from the library given by aNickname.
std::vector< wxString > GetSymbolNames(const wxString &aNickname, SYMBOL_TYPE aType=SYMBOL_TYPE::ALL_SYMBOLS)
An 8 bit string that is assuredly encoded in UTF8, and supplies special conversion support to and fro...
static bool loadLibrary(SYMBOL_LIBRARY_ADAPTER &aAdapter, const wxString &aNickname, std::vector< KI_ERROR > &aErrors)
int ReconcileLegacyCacheSymbols(SYMBOL_LIBRARY_ADAPTER &aAdapter, const wxString &aCacheNickname, SCH_SCREENS &aScreens, std::vector< KI_ERROR > &aErrors)
Point symbols that are only available in a legacy project cache library at that cache.