33 "<hr><table border=0>" 37 static const wxString
AliasOfFormat =
"<br><i>" +
_(
"Alias of" ) +
" %s (%s)</i>";
42 " <td><b>__NAME__</b></td>" 70 wxCHECK_RET(
m_sym_lib_table,
"Symbol library table pointer is not valid" );
81 wxLogError(
_(
"Error loading symbol %s from library '%s'." ) + wxS(
"\n%s" ),
117 m_html.Replace(
"__ALIASOF__", wxEmptyString );
121 wxString root_name =
_(
"Unknown" );
122 wxString root_desc =
"";
128 root_name = parent->GetName();
129 root_desc = parent->GetDescription();
151 if( keywords.empty() )
152 m_html.Replace(
"__KEY__", wxEmptyString );
166 switch( aField.
GetId() )
171 if(
text.IsEmpty() ||
text == wxT(
"~" ) )
173 fieldhtml.Replace(
"__VALUE__",
text );
180 if(
text.Length() > 75 )
181 text =
text.Left( 72 ) + wxT(
"..." );
185 fieldhtml.Replace(
"__VALUE__", datasheetlink );
192 return wxEmptyString;
205 std::vector<LIB_FIELD*> fields;
219 std::vector<LIB_FIELD*> parentFields;
221 parent->GetFields( parentFields );
223 for(
const LIB_FIELD* parentField : parentFields )
233 m_html.Replace(
"__FIELDS__", fieldtable );
242 return gen.GetHtml();
LIB_FIELD * FindField(const wxString &aFieldName)
Find a field within this symbol matching aFieldName and returns it or NULL if not found.
LIB_SYMBOL_REF & GetParent()
const UTF8 & GetLibItemName() const
wxString GetName() const override
static const wxString AliasOfFormat
Field object used in symbol libraries.
static const wxString DescriptionFormat
A logical library item identifier and consists of various portions much like a URI.
bool IsValid() const
Check if this LID_ID is valid.
Define a library symbol object.
void GetFields(std::vector< LIB_FIELD * > &aList)
Return a list of fields within this symbol.
#define gen(mvar, chg_bit, get, set, add, sub, changed)
wxString GetKeyWords() const
Field Value of part, i.e. "3.3K".
wxString GenerateAliasInfo(SYMBOL_LIB_TABLE *aSymLibTable, LIB_ID const &aLibId, int aUnit)
Return an HTML page describing a LIB_ID in a SYMBOL_LIB_TABLE.
static const wxString KeywordsFormat
static const wxString DescFormat
virtual const wxString What() const
A composite of Problem() and Where()
wxString GetCanonicalName() const
Get a non-language-specific name for a field which can be used for storage, variable look-up,...
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
wxString UnescapeString(const wxString &aSource)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
wxString EscapeHTML(const wxString &aString)
Return a new wxString escaped for embedding in HTML.
LIB_FIELD & GetDatasheetField()
Return reference to the datasheet field.
wxString GetFullText(int unit=1) const
Return the text of a field.
LIB_SYMBOL * LoadSymbol(const wxString &aNickname, const wxString &aName)
Load a LIB_SYMBOL having aName from the library given by aNickname.
bool IsRoot() const override
For symbols derived from other symbols, IsRoot() indicates no derivation.
static const wxString FieldFormat
wxString GetDescription() override
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
static const wxString DatasheetLinkFormat
virtual const wxString & GetText() const
Return the string associated with the text object.