Browse Source

Add new CONNECTIVITY_CANDIDATE flag

We reuse the CANDIDATE flag in various places across the codebase,
which is probably incorrect given the original intention for the
flag. Clearing it before use would be a performance hit for incremental
connectivity - and we can't rely on other users of the flag to clear
it for us. So we now use a new flag just for connectivity to avoid
other users trampling on connectivity updates.
pull/18/head
JamesJCode 5 months ago
parent
commit
019921cb48
  1. 8
      eeschema/connection_graph.cpp
  2. 3
      include/eda_item.h
  3. 2
      include/eda_item_flags.h

8
eeschema/connection_graph.cpp

@ -1450,10 +1450,10 @@ void CONNECTION_GRAPH::buildItemSubGraphs()
[&]( SCH_ITEM* aItem ) -> bool
{
SCH_CONNECTION* conn = aItem->GetOrInitConnection( sheet, this );
bool unique = !( aItem->GetFlags() & CANDIDATE );
bool unique = !( aItem->GetFlags() & CONNECTIVITY_CANDIDATE );
if( conn && !conn->SubgraphCode() )
aItem->SetFlags( CANDIDATE );
aItem->SetFlags( CONNECTIVITY_CANDIDATE );
return ( unique && conn && ( conn->SubgraphCode() == 0 ) );
};
@ -1480,7 +1480,7 @@ void CONNECTION_GRAPH::buildItemSubGraphs()
for( SCH_ITEM* citem : citemset )
{
if( citem->HasFlag( CANDIDATE ) )
if( citem->HasFlag( CONNECTIVITY_CANDIDATE ) )
continue;
if( get_items( citem ) )
@ -1490,7 +1490,7 @@ void CONNECTION_GRAPH::buildItemSubGraphs()
}
for( SCH_ITEM* connected_item : memberlist )
connected_item->ClearFlags( CANDIDATE );
connected_item->ClearFlags( CONNECTIVITY_CANDIDATE );
subgraph->m_dirty = true;
m_subgraphs.push_back( subgraph );

3
include/eda_item.h

@ -156,7 +156,8 @@ public:
EDA_ITEM_FLAGS GetTempFlags() const
{
constexpr int mask = ( CANDIDATE | SELECTED_BY_DRAG | IS_LINKED | SKIP_STRUCT | SELECTION_CANDIDATE );
constexpr int mask = ( CANDIDATE | SELECTED_BY_DRAG | IS_LINKED | SKIP_STRUCT | SELECTION_CANDIDATE
| CONNECTIVITY_CANDIDATE );
return m_flags & mask;
}

2
include/eda_item_flags.h

@ -60,7 +60,7 @@
#define ROUTER_TRANSIENT (1 << 22) ///< transient items that should NOT be cached
// 23 is unused
#define CONNECTIVITY_CANDIDATE ( 1 << 23 ) ///< flag indicating that the structure is connected for connectivity
#define HOLE_PROXY (1 << 24) ///< Indicates the BOARD_ITEM is a proxy for its hole
#define SHOW_ELEC_TYPE (1 << 25) ///< Show pin electrical type

Loading…
Cancel
Save