Eeschema Eagle Import: Set visibility of fields based on attribute display value.

This commit is contained in:
Russell Oliver 2017-08-20 13:38:47 +10:00 committed by Maciej Suminski
parent 00d1368099
commit cdb5a01091
1 changed files with 14 additions and 2 deletions

View File

@ -1131,6 +1131,12 @@ void SCH_EAGLE_PLUGIN::loadInstance( wxXmlNode* aInstanceNode )
}
bool spin = attr.rot ? attr.rot->spin : false;
if(attr.display == EATTR::Off)
{
field->SetVisible( false );
}
int rotation = einstance.rot ? einstance.rot->degrees : 0;
int reldegrees = ( absdegrees - rotation + 360.0);
reldegrees %= 360;
@ -1152,6 +1158,12 @@ void SCH_EAGLE_PLUGIN::loadInstance( wxXmlNode* aInstanceNode )
mirror = !mirror;
}
if(attr.display == EATTR::Off)
{
field->SetVisible( false );
}
int rotation = einstance.rot ? einstance.rot->degrees : 0;
int reldegrees = ( absdegrees - rotation + 360.0);
reldegrees %= 360;
@ -1163,8 +1175,8 @@ void SCH_EAGLE_PLUGIN::loadInstance( wxXmlNode* aInstanceNode )
}
if (smashed ){
component->GetField( VALUE )->SetVisible( valueAttributeFound );
component->GetField( REFERENCE )->SetVisible( nameAttributeFound );
if(!valueAttributeFound) component->GetField( VALUE )->SetVisible( false );
if(!nameAttributeFound) component->GetField( REFERENCE )->SetVisible( false );
}