Eeschema, PlotInteractiveLayer(): do not print useless info in a PDF plot.

It makes this info more easily readable.
- Remove duplicate properties/fields
- Do not plot empty properties/fields
This commit is contained in:
jean-pierre charras 2023-07-05 11:08:25 +02:00
parent a80ac8286d
commit bc8cc826cc
1 changed files with 12 additions and 9 deletions

View File

@ -2266,18 +2266,21 @@ void SCH_SYMBOL::Plot( PLOTTER* aPlotter, bool aBackground ) const
for( const SCH_FIELD& field : GetFields() ) for( const SCH_FIELD& field : GetFields() )
{ {
wxString text_field = field.GetShownText( sheet, false);
if( text_field.IsEmpty() )
continue;
properties.emplace_back( wxString::Format( wxT( "!%s = %s" ), properties.emplace_back( wxString::Format( wxT( "!%s = %s" ),
field.GetName(), field.GetName(), text_field ) );
field.GetShownText( sheet, false) ) );
} }
properties.emplace_back( wxString::Format( wxT( "!%s = %s" ), if( !m_part->GetKeyWords().IsEmpty() )
_( "Description" ), {
m_part->GetDescription() ) );
properties.emplace_back( wxString::Format( wxT( "!%s = %s" ), properties.emplace_back( wxString::Format( wxT( "!%s = %s" ),
_( "Keywords" ), _( "Keywords" ),
m_part->GetKeyWords() ) ); m_part->GetKeyWords() ) );
}
aPlotter->HyperlinkMenu( GetBoundingBox(), properties ); aPlotter->HyperlinkMenu( GetBoundingBox(), properties );