Eeschema Eagle Import: Set Pinshape. - modifies lin_pin.cpp function InternalPinDecoSize to default back to number text size if pin name text is set to zero.

This commit is contained in:
Russell Oliver 2017-08-19 15:41:48 +10:00 committed by Maciej Suminski
parent 08907d4fe8
commit afaa2499dc
2 changed files with 24 additions and 1 deletions

View File

@ -130,7 +130,8 @@ static const wxString getPinOrientationName( unsigned aPinOrientationCode )
static int InternalPinDecoSize( const LIB_PIN &aPin )
{
return aPin.GetNameTextSize() / 2;
return aPin.GetNameTextSize() != 0 ? aPin.GetNameTextSize() / 2 : aPin.GetNumberTextSize() / 2;
}
/// Utility for getting the size of the 'external' pin decorators (as a radius)

View File

@ -1693,6 +1693,28 @@ LIB_PIN* SCH_EAGLE_PLUGIN::loadPin( std::unique_ptr< LIB_PART >& aPart, wxXmlNod
*/
}
if( epin->function)
{
wxString function = epin->function.Get();
if( function == "dot")
{
pin->SetShape(PINSHAPE_INVERTED);
}
else if( function == "dot")
{
pin->SetShape(PINSHAPE_CLOCK);
}
else if( function == "clk")
{
pin->SetShape(PINSHAPE_CLOCK);
}
else if( function == "dotclk")
{
pin->SetShape(PINSHAPE_INVERTED_CLOCK);
}
}
return pin.release();
}