Dangling symbol fixes.

No dangling symbol for text items with a NO-CONNECT.
DanglingStateChanged doesn't work with dangling flag aggregators
(which return true if any child is dangling).
Then again, we don't actually use any of the aggregators anyway
so I removed them.

Fixes: lp:1799589
* https://bugs.launchpad.net/kicad/+bug/1799589
This commit is contained in:
Jeff Young 2018-10-24 23:49:51 +01:00
parent 1f1bdc87bd
commit 1baa904034
5 changed files with 4 additions and 40 deletions

View File

@ -1656,17 +1656,6 @@ bool SCH_COMPONENT::IsDanglingStateChanged( std::vector<DANGLING_END_ITEM>& aIte
} }
bool SCH_COMPONENT::IsDangling() const
{
for( bool each : m_isDangling )
{
if( each )
return true;
}
return false;
}
wxPoint SCH_COMPONENT::GetPinPhysicalPosition( const LIB_PIN* Pin ) const wxPoint SCH_COMPONENT::GetPinPhysicalPosition( const LIB_PIN* Pin ) const
{ {
wxCHECK_MSG( Pin != NULL && Pin->Type() == LIB_PIN_T, wxPoint( 0, 0 ), wxCHECK_MSG( Pin != NULL && Pin->Type() == LIB_PIN_T, wxPoint( 0, 0 ),

View File

@ -575,15 +575,6 @@ public:
*/ */
bool IsDanglingStateChanged( std::vector<DANGLING_END_ITEM>& aItemList ) override; bool IsDanglingStateChanged( std::vector<DANGLING_END_ITEM>& aItemList ) override;
/**
* Return whether any pin in this symbol is dangling.
*
* @note This does not update the internal status. It only checks the existing status.
*
* @return true if any pins of this symbol are not connect otherwise false.
*/
bool IsDangling() const override;
wxPoint GetPinPhysicalPosition( const LIB_PIN* Pin ) const; wxPoint GetPinPhysicalPosition( const LIB_PIN* Pin ) const;
bool IsSelectStateChanged( const wxRect& aRect ) override; bool IsSelectStateChanged( const wxRect& aRect ) override;

View File

@ -808,27 +808,12 @@ void SCH_SHEET::GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList )
bool SCH_SHEET::IsDanglingStateChanged( std::vector< DANGLING_END_ITEM >& aItemList ) bool SCH_SHEET::IsDanglingStateChanged( std::vector< DANGLING_END_ITEM >& aItemList )
{ {
bool currentState = IsDangling(); bool changed = false;
for( SCH_SHEET_PIN& pinsheet : GetPins() ) for( SCH_SHEET_PIN& pinsheet : GetPins() )
{ changed |= pinsheet.IsDanglingStateChanged( aItemList );
pinsheet.IsDanglingStateChanged( aItemList );
}
return currentState != IsDangling(); return changed;
}
bool SCH_SHEET::IsDangling() const
{
// If any hierarchical label in the sheet is dangling, then the sheet is dangling.
for( size_t i = 0; i < GetPins().size(); i++ )
{
if( GetPins()[i].IsDangling() )
return true;
}
return false;
} }

View File

@ -518,8 +518,6 @@ public:
bool IsDanglingStateChanged( std::vector< DANGLING_END_ITEM >& aItemList ) override; bool IsDanglingStateChanged( std::vector< DANGLING_END_ITEM >& aItemList ) override;
bool IsDangling() const override;
bool IsSelectStateChanged( const wxRect& aRect ) override; bool IsSelectStateChanged( const wxRect& aRect ) override;
bool IsConnectable() const override { return true; } bool IsConnectable() const override { return true; }

View File

@ -374,6 +374,7 @@ bool SCH_TEXT::IsDanglingStateChanged( std::vector< DANGLING_END_ITEM >& aItemLi
case PIN_END: case PIN_END:
case LABEL_END: case LABEL_END:
case SHEET_LABEL_END: case SHEET_LABEL_END:
case NO_CONNECT_END:
if( GetTextPos() == item.GetPosition() ) if( GetTextPos() == item.GetPosition() )
m_isDangling = false; m_isDangling = false;