Browse Source

Ignore visibility and style attrs in instance data.

It appears that it's always null/0.  (At least in this
test-case.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19734
pull/18/head
Jeff Young 6 months ago
parent
commit
17158f21da
  1. 18
      eeschema/sch_io/easyedapro/sch_easyedapro_parser.cpp

18
eeschema/sch_io/easyedapro/sch_easyedapro_parser.cpp

@ -304,9 +304,12 @@ void SCH_EASYEDAPRO_PARSER::ApplyAttrToField( const std::map<wxString, nlohmann:
EDA_TEXT* text = static_cast<EDA_TEXT*>( field );
text->SetText( ResolveFieldVariables( aAttr.value, aDeviceAttributes ) );
text->SetVisible( aAttr.keyVisible || aAttr.valVisible );
field->SetNameShown( aAttr.keyVisible );
if( aIsSym )
{
text->SetVisible( aAttr.keyVisible || aAttr.valVisible );
field->SetNameShown( aAttr.keyVisible );
}
if( aAttr.position )
{
@ -314,7 +317,8 @@ void SCH_EASYEDAPRO_PARSER::ApplyAttrToField( const std::map<wxString, nlohmann:
: ScalePosSym( *aAttr.position ) );
}
ApplyFontStyle( fontStyles, text, aAttr.fontStyle );
if( aIsSym )
ApplyFontStyle( fontStyles, text, aAttr.fontStyle );
auto parent = aParent;
if( parent && parent->Type() == SCH_SYMBOL_T )
@ -1202,6 +1206,14 @@ void SCH_EASYEDAPRO_PARSER::ParseSchematic( SCHEMATIC* aSchematic, SCH_SHEET* aR
for( SCH_PIN* pin : schSym->GetAllLibPins() )
pin->SetName( globalNetAttr->value );
}
else if( auto nameAttr = get_opt( attributes, "Name" ) )
{
ApplyAttrToField( fontStyles, schSym->GetField( FIELD_T::VALUE ),
*nameAttr, false, true, compAttrs, schSym.get() );
for( SCH_PIN* pin : schSym->GetAllLibPins() )
pin->SetName( nameAttr->value );
}
else
{
SCH_FIELD* valueField = schSym->GetField( FIELD_T::VALUE );

Loading…
Cancel
Save