KiCad PCB EDA Suite
Loading...
Searching...
No Matches
legacy_cache_reconcile.cpp File Reference
#include <libraries/legacy_cache_reconcile.h>
#include <set>
#include <lib_id.h>
#include <libraries/symbol_library_adapter.h>
#include <sch_screen.h>
#include <sch_symbol.h>
#include <widgets/kistatusbar.h>

Go to the source code of this file.

Functions

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.
 

Function Documentation

◆ loadLibrary()

◆ ReconcileLegacyCacheSymbols()

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.

When a legacy schematic is opened, any symbol whose library identifier names an entry of the project cache library is re-linked to the cache unless one of the other libraries in the library table still supplies it. Without this the symbol resolves to nothing and is drawn as a placeholder box.

Every library consulted is loaded synchronously. Testing whether the background preload happens to have reached a library would make the result depend on load timing, so the same project could be re-linked differently from one open to the next.

Parameters
aAdapteris the symbol library adapter of the project being opened.
aCacheNicknameis the library table nickname of the project cache library.
aScreensare the screens of the schematic being opened.
aErrorscollects one message per library that could not be loaded.
Returns
the number of symbols pointed at the cache library.

Definition at line 58 of file legacy_cache_reconcile.cpp.

References LIBRARY_MANAGER_ADAPTER::AbortAsyncLoad(), LIB_ID::Format(), SCH_SCREENS::GetFirst(), SCH_SYMBOL::GetLibId(), SCH_SCREENS::GetNext(), SYMBOL_LIBRARY_ADAPTER::GetSymbolNames(), loadLibrary(), SYMBOL_LIBRARY_ADAPTER::LoadSymbol(), LIBRARY_MANAGER_ADAPTER::Rows(), SCH_SYMBOL_T, SCH_SYMBOL::SetLibId(), LIB_ID::SetLibItemName(), LIB_ID::SetLibNickname(), and UTF8::wx_str().

Referenced by SCH_EDIT_FRAME::OpenProjectFiles().