48 std::unique_ptr<SYMBOL_LIB> archLib = std::make_unique<SYMBOL_LIB>( SCH_LIB_TYPE::LT_EESCHEMA,
52 archLib->EnableBuffering();
69 if( archLib->FindSymbol( symbol->
GetLibId() ) )
77 tmp.Printf(
_(
"Failed to add symbol %s to library file '%s'." ),
86 tmp =
_(
"Unexpected exception occurred." );
91 std::unique_ptr<LIB_SYMBOL> flattenedSymbol = libSymbol->
Flatten();
97 archLib->AddSymbol( flattenedSymbol.get() );
101 tmp.Printf(
_(
"Symbol %s not found in any library or cache." ),
107 if( errorMsg.empty() )
110 errorMsg += wxS(
"\n" ) + tmp;
115 if( !errorMsg.empty() )
117 tmp.Printf(
_(
"Errors occurred creating symbol library %s." ), aFileName );
121 archLib->EnableBuffering(
false );
125 archLib->Save(
false );
129 errorMsg.Printf(
_(
"Failed to save symbol library file '%s'." ), aFileName );
133 catch( std::exception& error )
135 errorMsg.Printf(
_(
"Failed to save symbol library file '%s'." ), aFileName );
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
wxString GetUniStringLibId() const
const wxString GetUniStringLibItemName() const
Get strings for display messages in dialogs.
Define a library symbol object.
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
LIB_SYMBOL * GetLibSymbol(const LIB_ID &aLibId, bool aUseCacheLib=false, bool aShowErrorMsg=false)
Load symbol from symbol library table.
SCHEMATIC & Schematic() const
bool CreateArchiveLibrary(const wxString &aFileName)
Create a library aFileName that contains all symbols used in the current schematic.
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.
const LIB_ID & GetLibId() const override
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
This file is part of the common library.
Definition for symbol library class.
Definition of file extensions used in Kicad.