From afaa2499dc2abd14e27ba6bdb8a1089b3c8818d3 Mon Sep 17 00:00:00 2001 From: Russell Oliver Date: Sat, 19 Aug 2017 15:41:48 +1000 Subject: [PATCH] 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. --- eeschema/lib_pin.cpp | 3 ++- eeschema/sch_eagle_plugin.cpp | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/eeschema/lib_pin.cpp b/eeschema/lib_pin.cpp index 1f99840924..32c2db648b 100644 --- a/eeschema/lib_pin.cpp +++ b/eeschema/lib_pin.cpp @@ -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) diff --git a/eeschema/sch_eagle_plugin.cpp b/eeschema/sch_eagle_plugin.cpp index cb0ee5fa2c..3f91794c08 100644 --- a/eeschema/sch_eagle_plugin.cpp +++ b/eeschema/sch_eagle_plugin.cpp @@ -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(); }