From fbb20d08cdd8e888e909130c64a2b1c2177a8baa Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 12 Oct 2020 00:29:06 +0100 Subject: [PATCH] Don't allow netclass assignment to auto-generated net-names. They can change the next time they're generated so it's just asking for heartache. Fixes https://gitlab.com/kicad/code/kicad/issues/5972 --- eeschema/connection_graph.h | 8 ++++++++ eeschema/schematic.cpp | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/eeschema/connection_graph.h b/eeschema/connection_graph.h index 460d9e3c6f..b49462b5c4 100644 --- a/eeschema/connection_graph.h +++ b/eeschema/connection_graph.h @@ -137,6 +137,14 @@ public: */ static PRIORITY GetDriverPriority( SCH_ITEM* aDriver ); + PRIORITY GetDriverPriority() + { + if( m_driver ) + return GetDriverPriority( m_driver ); + else + return PRIORITY::NONE; + } + CONNECTION_GRAPH* m_graph; bool m_dirty; diff --git a/eeschema/schematic.cpp b/eeschema/schematic.cpp index 485a7aab24..47f6e6a261 100644 --- a/eeschema/schematic.cpp +++ b/eeschema/schematic.cpp @@ -156,7 +156,12 @@ std::vector SCHEMATIC::GetNetClassAssignmentCandidates() // Key is a NET_NAME_CODE aka std::pair for( const NET_MAP::value_type& pair: m_connectionGraph->GetNetMap() ) - names.emplace_back( pair.first.first ); + { + CONNECTION_SUBGRAPH* subgraph = pair.second[0]; + + if( subgraph->GetDriverPriority() > CONNECTION_SUBGRAPH::PRIORITY::PIN ) + names.emplace_back( pair.first.first ); + } return names; }