Don't connect bus entries and bus labels that happen to overlap

This commit is contained in:
Jon Evans 2019-03-23 14:21:25 -04:00 committed by Wayne Stambaugh
parent 65af2c8b6c
commit b15da3c656
2 changed files with 12 additions and 3 deletions

View File

@ -41,6 +41,7 @@
#include <general.h> #include <general.h>
#include <sch_bus_entry.h> #include <sch_bus_entry.h>
#include <sch_line.h> #include <sch_line.h>
#include <sch_text.h>
SCH_BUS_ENTRY_BASE::SCH_BUS_ENTRY_BASE( KICAD_T aType, const wxPoint& pos, char shape ) : 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; 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<const SCH_LABEL*>( aItem )->GetText() ) )
{
return false;
}
// Don't generate connections between two bus-wire entries // Don't generate connections between two bus-wire entries
if( aItem->Type() == SCH_BUS_WIRE_ENTRY_T ) if( aItem->Type() == SCH_BUS_WIRE_ENTRY_T )
return false; return false;

View File

@ -293,7 +293,7 @@ public:
* @param aLabel A wxString object containing the label to test. * @param aLabel A wxString object containing the label to test.
* @return true if text is a bus notation format otherwise false is returned. * @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]) * 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. * @param aLabel A wxString object containing the label to test.
* @return true if text is a bus notation format otherwise false is returned. * @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. * Test if \a aLabel has a bus group notation.
@ -309,7 +309,7 @@ public:
* @param aLabel A wxString object containing the label to test. * @param aLabel A wxString object containing the label to test.
* @return true if text is a bus group notation format * @return true if text is a bus group notation format
*/ */
bool IsBusGroupLabel( const wxString& aLabel ); static bool IsBusGroupLabel( const wxString& aLabel );
private: private: