Eeschema: Eagle Plugin: Handle pin rotation.

This commit is contained in:
Russell Oliver 2017-06-18 22:25:36 +10:00 committed by Maciej Suminski
parent 739754cfd6
commit 04c7fbebdc
1 changed files with 48 additions and 8 deletions

View File

@ -732,7 +732,6 @@ LIB_POLYLINE* SCH_EAGLE_PLUGIN::loadSymbolPolyLine( LIB_PART* aPart, wxXmlNode*
LIB_PIN* SCH_EAGLE_PLUGIN::loadPin( LIB_PART* aPart, wxXmlNode* aPin ) LIB_PIN* SCH_EAGLE_PLUGIN::loadPin( LIB_PART* aPart, wxXmlNode* aPin )
{ {
std::unique_ptr<LIB_PIN> pin( new LIB_PIN( aPart ) ); std::unique_ptr<LIB_PIN> pin( new LIB_PIN( aPart ) );
auto epin = EPIN( aPin ); auto epin = EPIN( aPin );
@ -740,9 +739,50 @@ LIB_PIN* SCH_EAGLE_PLUGIN::loadPin( LIB_PART* aPart, wxXmlNode* aPin)
pin->SetPosition( wxPoint( epin.x * EUNIT_TO_MIL, -epin.y * EUNIT_TO_MIL ) ); pin->SetPosition( wxPoint( epin.x * EUNIT_TO_MIL, -epin.y * EUNIT_TO_MIL ) );
pin->SetName( epin.name ); pin->SetName( epin.name );
EROT rot = epin.rot.Get(); int roti = 0;
pin->SetOrientation( int(rot.degrees/90+2)%4 );
if( epin.rot )
{
roti = int(epin.rot->degrees);
}
switch( roti )
{
case 0:
pin->SetOrientation( 'R' );
break;
case 90:
pin->SetOrientation( 'D' );
break;
case 180:
pin->SetOrientation( 'L' );
break;
case 270:
pin->SetOrientation( 'U' );
break;
}
wxString length = epin.length.Get();
if( length =="short" )
{
pin->SetLength( 100 );
}
else if( length =="middle" )
{
pin->SetLength( 200 );
}
else if( length == "long" )
{
pin->SetLength( 300 );
}
else if( length == "point" )
{
pin->SetLength( 0 );
}
return pin.release(); return pin.release();
} }