34 "<hr><table border=0>"
38static const wxString
AliasOfFormat = wxS(
"<br><i>" ) +
_(
"Derived from" ) +
39 wxS(
" %s (%s)</i>" );
41static const wxString
KeywordsFormat = wxS(
"<br>" ) +
_(
"Keywords" ) + wxS(
": %s" );
44 " <td><b>__NAME__</b></td>"
47static const wxString
LinkFormat = wxS(
"<a href=\"__HREF__\">__TEXT__</a>" );
80 wxCHECK_RET(
m_libs,
"Symbol library manager adapter pointer is not valid" );
94 wxLogError(
_(
"Error loading symbol %s from library '%s'." ) + wxS(
"\n%s" ),
135 m_html.Replace(
"__ALIASOF__", wxEmptyString );
139 wxString root_name =
_(
"Unknown" );
140 wxString root_desc = wxS(
"" );
142 std::shared_ptr< LIB_SYMBOL > parent =
m_symbol->GetParent().lock();
161 esc_desc.Replace( wxS(
"\n" ), wxS(
"<br>" ) );
166 m_html.Replace( wxS(
"__DESC__" ), wxString::Format(
DescFormat, esc_desc ) );
173 if( keywords.empty() )
174 m_html.Replace( wxS(
"__KEY__" ), wxEmptyString );
187 switch( aField.
GetId() )
192 if(
text.IsEmpty() ||
text == wxT(
"~" ) )
194 fieldhtml.Replace( wxS(
"__VALUE__" ),
text );
201 if(
text.Length() > 75 )
202 text =
text.Left( 72 ) + wxT(
"..." );
206 fieldhtml.Replace( wxS(
"__VALUE__" ), datasheetlink );
213 return wxEmptyString;
228 if(
text.Length() > 75 )
229 text =
text.Left( 72 ) + wxT(
"..." );
233 fieldhtml.Replace( wxS(
"__VALUE__" ),
link );
248 std::vector<SCH_FIELD*> fields;
257 std::shared_ptr<LIB_SYMBOL> parent =
m_symbol->GetParent().lock();
262 std::vector<SCH_FIELD*> parentFields;
264 parent->GetFields( parentFields );
266 for(
const SCH_FIELD* parentField : parentFields )
268 if(
m_symbol->GetField( parentField->GetUntranslatedName() ) )
276 m_html.Replace( wxS(
"__FIELDS__" ), fieldtable );
281 m_html.Replace( wxS(
"__NAME__" ), wxEmptyString );
282 m_html.Replace( wxS(
"__ALIASOF__" ), wxEmptyString );
283 m_html.Replace( wxS(
"__DESC__" ), wxEmptyString );
284 m_html.Replace( wxS(
"__KEY__" ), wxEmptyString );
285 m_html.Replace( wxS(
"__FIELDS__" ), wxEmptyString );
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()
A logical library item identifier and consists of various portions much like a URI.
Define a library symbol object.
wxString GetName() const override
wxString GetDesc() override
wxString GetFullText(int unit=1) const
Return the text of a field.
bool HasHypertext() const override
Indicates that the item has at least one hypertext action.
wxString GetUntranslatedName() const
Get the untranslated field name for storage, variable look-up, etc.
wxString GetShownText(const SCH_SHEET_PATH *aPath, RESOLUTION_CONTEXT aContext, const wxString &aVariantName=wxEmptyString, int aDepth=0) const
An interface to the global shared library manager that is schematic-specific and linked to one projec...
wxString GenerateAliasInfo(SYMBOL_LIBRARY_ADAPTER *aLibs, LIB_ID const &aLibId, int aUnit)
Return an HTML page describing a LIB_ID in a SYMBOL_LIBRARY_ADAPTER.
static const wxString KeywordsFormat
static const wxString DescriptionFormat
static const wxString DescFormat
static const wxString LinkFormat
static const wxString AliasOfFormat
static const wxString FieldFormat
wxString EscapeHTML(const wxString &aString)
Return a new wxString escaped for embedding in HTML.
wxString UnescapeString(const wxString &aSource)
wxString LinkifyHTML(wxString aStr)
Wraps links in HTML tags.
@ DATASHEET
name of datasheet
@ REFERENCE
Field Reference of part, i.e. "IC21".
@ VALUE
Field Value of part, i.e. "3.3K".