33 "<hr><table border=0>"
37static const wxString
AliasOfFormat = wxS(
"<br><i>" ) +
_(
"Derived from" ) +
38 wxS(
" %s (%s)</i>" );
40static const wxString
KeywordsFormat = wxS(
"<br>" ) +
_(
"Keywords" ) + wxS(
": %s" );
43 " <td><b>__NAME__</b></td>"
46static const wxString
LinkFormat = wxS(
"<a href=\"__HREF__\">__TEXT__</a>" );
65 wxCHECK_RET(
m_sym_lib_table,
"Symbol library table pointer is not valid" );
76 wxLogError(
_(
"Error loading symbol %s from library '%s'." ) + wxS(
"\n%s" ),
111 m_html.Replace(
"__ALIASOF__", wxEmptyString );
115 wxString root_name =
_(
"Unknown" );
116 wxString root_desc = wxS(
"" );
118 std::shared_ptr< LIB_SYMBOL > parent =
m_symbol->GetParent().lock();
137 esc_desc.Replace( wxS(
"\n" ), wxS(
"<br>" ) );
142 m_html.Replace( wxS(
"__DESC__" ), wxString::Format(
DescFormat, esc_desc ) );
147 wxString keywords =
m_symbol->GetKeyWords();
149 if( keywords.empty() )
150 m_html.Replace( wxS(
"__KEY__" ), wxEmptyString );
163 switch( aField.
GetId() )
166 text =
m_symbol->GetDatasheetField().GetShownText(
false );
168 if(
text.IsEmpty() ||
text == wxT(
"~" ) )
170 fieldhtml.Replace( wxS(
"__VALUE__" ),
text );
177 if(
text.Length() > 75 )
178 text =
text.Left( 72 ) + wxT(
"..." );
182 fieldhtml.Replace( wxS(
"__VALUE__" ), datasheetlink );
189 return wxEmptyString;
204 if(
text.Length() > 75 )
205 text =
text.Left( 72 ) + wxT(
"..." );
209 fieldhtml.Replace( wxS(
"__VALUE__" ), link );
224 std::vector<SCH_FIELD*> fields;
233 std::shared_ptr<LIB_SYMBOL> parent =
m_symbol->GetParent().lock();
238 std::vector<SCH_FIELD*> parentFields;
240 parent->GetFields( parentFields );
242 for(
const SCH_FIELD* parentField : parentFields )
244 if(
m_symbol->GetField( parentField->GetCanonicalName() ) )
252 m_html.Replace( wxS(
"__FIELDS__" ), fieldtable );
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 IsHypertext() const override
Allow items to support hypertext actions when hovered/clicked.
wxString GetCanonicalName() const
Get a non-language-specific name for a field which can be used for storage, variable look-up,...
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const
static const wxString KeywordsFormat
static const wxString DescriptionFormat
static const wxString DescFormat
static const wxString LinkFormat
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 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".