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>" );
66 wxCHECK_RET(
m_libs,
"Symbol library manager adapter pointer is not valid" );
80 wxLogError(
_(
"Error loading symbol %s from library '%s'." ) + wxS(
"\n%s" ),
120 m_html.Replace(
"__ALIASOF__", wxEmptyString );
124 wxString root_name =
_(
"Unknown" );
125 wxString root_desc = wxS(
"" );
127 std::shared_ptr< LIB_SYMBOL > parent =
m_symbol->GetParent().lock();
146 esc_desc.Replace( wxS(
"\n" ), wxS(
"<br>" ) );
151 m_html.Replace( wxS(
"__DESC__" ), wxString::Format(
DescFormat, esc_desc ) );
156 wxString keywords =
m_symbol->GetShownKeyWords();
158 if( keywords.empty() )
159 m_html.Replace( wxS(
"__KEY__" ), wxEmptyString );
172 switch( aField.
GetId() )
175 text =
m_symbol->GetDatasheetField().GetShownText(
false );
177 if(
text.IsEmpty() ||
text == wxT(
"~" ) )
179 fieldhtml.Replace( wxS(
"__VALUE__" ),
text );
186 if(
text.Length() > 75 )
187 text =
text.Left( 72 ) + wxT(
"..." );
191 fieldhtml.Replace( wxS(
"__VALUE__" ), datasheetlink );
198 return wxEmptyString;
213 if(
text.Length() > 75 )
214 text =
text.Left( 72 ) + wxT(
"..." );
218 fieldhtml.Replace( wxS(
"__VALUE__" ), link );
233 std::vector<SCH_FIELD*> fields;
242 std::shared_ptr<LIB_SYMBOL> parent =
m_symbol->GetParent().lock();
247 std::vector<SCH_FIELD*> parentFields;
249 parent->GetFields( parentFields );
251 for(
const SCH_FIELD* parentField : parentFields )
253 if(
m_symbol->GetField( parentField->GetCanonicalName() ) )
261 m_html.Replace( wxS(
"__FIELDS__" ), fieldtable );
266 m_html.Replace( wxS(
"__NAME__" ), wxEmptyString );
267 m_html.Replace( wxS(
"__ALIASOF__" ), wxEmptyString );
268 m_html.Replace( wxS(
"__DESC__" ), wxEmptyString );
269 m_html.Replace( wxS(
"__KEY__" ), wxEmptyString );
270 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 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 wxString &aVariantName=wxEmptyString) 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_LIB_TABLE.
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".