Eeschema Eagle Import: Fix power symbol import. - Set pins to power in to match current power supply symbols. - Change IsPowerConnection() to match POWER_IN pins from power symbols as well.

This commit is contained in:
Russell Oliver 2017-08-08 00:33:12 +10:00 committed by Maciej Suminski
parent d4201ef51f
commit aeb43b055c
2 changed files with 11 additions and 2 deletions

View File

@ -37,6 +37,7 @@ class SCH_COMPONENT;
#include "pin_shape.h"
#include "pin_type.h"
#include "class_libentry.h"
// Circle diameter drawn at the active end of pins:
#define TARGET_PIN_RADIUS 12
@ -362,7 +363,13 @@ public:
* Return whether this pin forms an implicit power connection: i.e., is hidden
* and of type POWER_IN.
*/
bool IsPowerConnection() const { return !IsVisible() && GetType() == PIN_POWER_IN; }
bool IsPowerConnection() const {
return (
( !IsVisible() && GetType() == PIN_POWER_IN )
||
( (LIB_PART*)GetParent()->IsPower() && GetType() == PIN_POWER_IN )
) ; }
int GetPenSize() const override;

View File

@ -1301,7 +1301,7 @@ bool SCH_EAGLE_PLUGIN::loadSymbol( wxXmlNode* aSymbolNode,
if(wxString(*ePin.direction).Lower()== "sup")
{
ispower = true;
pin->SetType(PIN_POWER_OUT);
pin->SetType(PIN_POWER_IN);
}
else if(wxString(*ePin.direction).Lower()== "pas")
{
@ -1373,6 +1373,8 @@ bool SCH_EAGLE_PLUGIN::loadSymbol( wxXmlNode* aSymbolNode,
{
pin->SetPartNumber( gateNumber );
pin->SetUnit( gateNumber );
wxString stringPinNum = wxString::Format(wxT("%i"),pincount);
pin->SetPinNumFromString(stringPinNum);
aPart->AddDrawItem( pin.release() );
}
}