Eeschema: calculate not-connected pins correctly

Show the NC box only on pins connected via the same component,
indicating a stacked pin group.  Do not show NC box on pins for
different components with the same symbol.
This commit is contained in:
Seth Hillbrand 2017-12-07 12:23:02 -08:00 committed by Wayne Stambaugh
parent f0fecba9e1
commit 394749f1d6
2 changed files with 16 additions and 9 deletions

View File

@ -1481,7 +1481,7 @@ void SCH_COMPONENT::GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList )
if( pin->GetConvert() && m_convert && ( m_convert != pin->GetConvert() ) )
continue;
DANGLING_END_ITEM item( PIN_END, pin, GetPinPhysicalPosition( pin ) );
DANGLING_END_ITEM item( PIN_END, pin, GetPinPhysicalPosition( pin ), this );
aItemList.push_back( item );
}
}
@ -1512,14 +1512,7 @@ bool SCH_COMPONENT::IsPinDanglingStateChanged( std::vector<DANGLING_END_ITEM> &a
// internal connection. While technically connected, it is not particularly useful
// to display them that way, so skip any pins that are in the same symbol as this
// one.
//
// Do not make this exception for hidden pins, because those actually make internal
// connections to a power net.
const LIB_PIN* item_pin = dynamic_cast<const LIB_PIN*>( each_item.GetItem() );
if( item_pin
&& ( !item_pin->IsPowerConnection() || !IsInNetlist() )
&& std::find( aLibPins.begin(), aLibPins.end(), item_pin) != aLibPins.end() )
if( each_item.GetParent() == this )
continue;
switch( each_item.GetType() )

View File

@ -87,16 +87,30 @@ private:
/// The type of connection of #m_item.
DANGLING_END_T m_type;
/// A pointer to the parent object (in the case of pins)
const EDA_ITEM* m_parent;
public:
DANGLING_END_ITEM( DANGLING_END_T aType, const EDA_ITEM* aItem, const wxPoint& aPosition )
{
m_item = aItem;
m_type = aType;
m_pos = aPosition;
m_parent = aItem;
}
DANGLING_END_ITEM( DANGLING_END_T aType, const EDA_ITEM* aItem,
const wxPoint& aPosition, const EDA_ITEM* aParent )
{
m_item = aItem;
m_type = aType;
m_pos = aPosition;
m_parent = aParent;
}
wxPoint GetPosition() const { return m_pos; }
const EDA_ITEM* GetItem() const { return m_item; }
const EDA_ITEM* GetParent() const { return m_parent; }
DANGLING_END_T GetType() const { return m_type; }
};