From b15da3c6569c03628b8a05ad822d6204d7ef926a Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sat, 23 Mar 2019 14:21:25 -0400 Subject: [PATCH] Don't connect bus entries and bus labels that happen to overlap --- eeschema/sch_bus_entry.cpp | 9 +++++++++ eeschema/sch_connection.h | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/eeschema/sch_bus_entry.cpp b/eeschema/sch_bus_entry.cpp index c323da8e41..f529ac3573 100644 --- a/eeschema/sch_bus_entry.cpp +++ b/eeschema/sch_bus_entry.cpp @@ -41,6 +41,7 @@ #include #include #include +#include SCH_BUS_ENTRY_BASE::SCH_BUS_ENTRY_BASE( KICAD_T aType, const wxPoint& pos, char shape ) : @@ -445,6 +446,14 @@ bool SCH_BUS_WIRE_ENTRY::ConnectionPropagatesTo( const EDA_ITEM* aItem ) const return false; } + // Don't generate connections between bus entries and bus labels that happen + // to land at the same point on the bus wire as this bus entry + if( ( aItem->Type() == SCH_LABEL_T ) && + SCH_CONNECTION::IsBusLabel( static_cast( aItem )->GetText() ) ) + { + return false; + } + // Don't generate connections between two bus-wire entries if( aItem->Type() == SCH_BUS_WIRE_ENTRY_T ) return false; diff --git a/eeschema/sch_connection.h b/eeschema/sch_connection.h index 2b21df0cda..295dedd3a8 100644 --- a/eeschema/sch_connection.h +++ b/eeschema/sch_connection.h @@ -293,7 +293,7 @@ public: * @param aLabel A wxString object containing the label to test. * @return true if text is a bus notation format otherwise false is returned. */ - bool IsBusLabel( const wxString& aLabel ); + static bool IsBusLabel( const wxString& aLabel ); /** * Test if \a aLabel has a bus vector notation (simple bus, e.g. A[7..0]) @@ -301,7 +301,7 @@ public: * @param aLabel A wxString object containing the label to test. * @return true if text is a bus notation format otherwise false is returned. */ - bool IsBusVectorLabel( const wxString& aLabel ); + static bool IsBusVectorLabel( const wxString& aLabel ); /** * Test if \a aLabel has a bus group notation. @@ -309,7 +309,7 @@ public: * @param aLabel A wxString object containing the label to test. * @return true if text is a bus group notation format */ - bool IsBusGroupLabel( const wxString& aLabel ); + static bool IsBusGroupLabel( const wxString& aLabel ); private: