KiCad PCB EDA Suite
CONNECTION_SUBGRAPH Class Reference

A subgraph is a set of items that are electrically connected on a single sheet. More...

#include <connection_graph.h>

Public Types

enum  PRIORITY {
  PRIORITY::INVALID = -1, PRIORITY::NONE = 0, PRIORITY::PIN, PRIORITY::SHEET_PIN,
  PRIORITY::HIER_LABEL, PRIORITY::LOCAL_LABEL, PRIORITY::POWER_PIN, PRIORITY::GLOBAL
}
 

Public Member Functions

 CONNECTION_SUBGRAPH (CONNECTION_GRAPH *aGraph)
 
 ~CONNECTION_SUBGRAPH ()=default
 
bool ResolveDrivers (bool aCreateMarkers=false)
 Determines which potential driver should drive the subgraph. More...
 
wxString GetNetName () const
 Returns the fully-qualified net name for this subgraph (if one exists) More...
 
std::vector< SCH_ITEM * > GetBusLabels () const
 Returns all the bus labels attached to this subgraph (if any) More...
 
const wxString & GetNameForDriver (SCH_ITEM *aItem)
 Returns the candidate net name for a driver. More...
 
void Absorb (CONNECTION_SUBGRAPH *aOther)
 Combines another subgraph on the same sheet into this one. More...
 
void AddItem (SCH_ITEM *aItem)
 Adds a new item to the subgraph. More...
 
void UpdateItemConnections ()
 Updates all items to match the driver connection. More...
 

Static Public Member Functions

static PRIORITY GetDriverPriority (SCH_ITEM *aDriver)
 Returns the priority (higher is more important) of a candidate driver. More...
 

Public Attributes

CONNECTION_GRAPHm_graph
 
bool m_dirty
 
bool m_absorbed
 True if this subgraph has been absorbed into another. No pointers here are safe if so! More...
 
CONNECTION_SUBGRAPHm_absorbed_by
 If this subgraph is absorbed, points to the absorbing (and valid) subgraph. More...
 
long m_code
 
bool m_multiple_drivers
 True if this subgraph contains more than one driver that should be shorted together in the netlist. More...
 
bool m_strong_driver
 True if the driver is "strong": a label or power object. More...
 
bool m_local_driver
 True if the driver is a local (i.e. non-global) type. More...
 
SCH_ITEMm_no_connect
 No-connect item in graph, if any. More...
 
SCH_ITEMm_bus_entry
 Bus entry in graph, if any. More...
 
std::vector< SCH_ITEM * > m_items
 
std::vector< SCH_ITEM * > m_drivers
 
SCH_ITEMm_driver
 
SCH_SHEET_PATH m_sheet
 
SCH_CONNECTIONm_driver_connection
 Cache for driver connection. More...
 
std::unordered_map< std::shared_ptr< SCH_CONNECTION >, std::unordered_set< CONNECTION_SUBGRAPH * > > m_bus_neighbors
 If a subgraph is a bus, this map contains links between the bus members and any local sheet neighbors with the same connection name. More...
 
std::unordered_map< std::shared_ptr< SCH_CONNECTION >, std::unordered_set< CONNECTION_SUBGRAPH * > > m_bus_parents
 If this is a net, this vector contains links to any same-sheet buses that contain it. More...
 
std::vector< SCH_SHEET_PIN * > m_hier_pins
 
std::vector< SCH_HIERLABEL * > m_hier_ports
 
CONNECTION_SUBGRAPHm_hier_parent
 
std::unordered_map< SCH_ITEM *, wxString > m_driver_name_cache
 A cache of escaped netnames from schematic items. More...
 

Detailed Description

A subgraph is a set of items that are electrically connected on a single sheet.

For example, a label connected to a wire and so on. A net is composed of one or more subgraphs.

A set of items that appears to be physically connected may actually be more than one subgraph, because some items don't connect electrically.

For example, multiple bus wires can come together at a junction but have different labels on each branch. Each label+wire branch is its own subgraph.

Definition at line 60 of file connection_graph.h.

Member Enumeration Documentation

◆ PRIORITY

Enumerator
INVALID 
NONE 
PIN 
SHEET_PIN 
HIER_LABEL 
LOCAL_LABEL 
POWER_PIN 
GLOBAL 

Definition at line 63 of file connection_graph.h.

64  {
65  INVALID = -1,
66  NONE = 0,
67  PIN,
68  SHEET_PIN,
69  HIER_LABEL,
70  LOCAL_LABEL,
71  POWER_PIN,
72  GLOBAL
73  };

Constructor & Destructor Documentation

◆ CONNECTION_SUBGRAPH()

CONNECTION_SUBGRAPH::CONNECTION_SUBGRAPH ( CONNECTION_GRAPH aGraph)
inlineexplicit

Definition at line 75 of file connection_graph.h.

75  :
76  m_graph( aGraph ),
77  m_dirty( false ),
78  m_absorbed( false ),
79  m_absorbed_by( nullptr ),
80  m_code( -1 ),
81  m_multiple_drivers( false ),
82  m_strong_driver( false ),
83  m_local_driver( false ),
84  m_no_connect( nullptr ),
85  m_bus_entry( nullptr ),
86  m_driver( nullptr ),
87  m_driver_connection( nullptr ),
88  m_hier_parent( nullptr )
89  {}
SCH_CONNECTION * m_driver_connection
Cache for driver connection.
SCH_ITEM * m_bus_entry
Bus entry in graph, if any.
bool m_absorbed
True if this subgraph has been absorbed into another. No pointers here are safe if so!
bool m_local_driver
True if the driver is a local (i.e. non-global) type.
bool m_multiple_drivers
True if this subgraph contains more than one driver that should be shorted together in the netlist.
CONNECTION_GRAPH * m_graph
bool m_strong_driver
True if the driver is "strong": a label or power object.
CONNECTION_SUBGRAPH * m_absorbed_by
If this subgraph is absorbed, points to the absorbing (and valid) subgraph.
CONNECTION_SUBGRAPH * m_hier_parent
SCH_ITEM * m_no_connect
No-connect item in graph, if any.

◆ ~CONNECTION_SUBGRAPH()

CONNECTION_SUBGRAPH::~CONNECTION_SUBGRAPH ( )
default

Member Function Documentation

◆ Absorb()

void CONNECTION_SUBGRAPH::Absorb ( CONNECTION_SUBGRAPH aOther)

Combines another subgraph on the same sheet into this one.

Definition at line 270 of file connection_graph.cpp.

271 {
272  wxASSERT( m_sheet == aOther->m_sheet );
273 
274  for( SCH_ITEM* item : aOther->m_items )
275  {
277  AddItem( item );
278  }
279 
280  m_bus_neighbors.insert( aOther->m_bus_neighbors.begin(), aOther->m_bus_neighbors.end() );
281  m_bus_parents.insert( aOther->m_bus_parents.begin(), aOther->m_bus_parents.end() );
282 
284 
285  aOther->m_absorbed = true;
286  aOther->m_dirty = false;
287  aOther->m_driver = nullptr;
288  aOther->m_driver_connection = nullptr;
289  aOther->m_absorbed_by = this;
290 }
SCH_SHEET_PATH m_sheet
SCH_CONNECTION * m_driver_connection
Cache for driver connection.
std::unordered_map< std::shared_ptr< SCH_CONNECTION >, std::unordered_set< CONNECTION_SUBGRAPH * > > m_bus_neighbors
If a subgraph is a bus, this map contains links between the bus members and any local sheet neighbors...
bool m_absorbed
True if this subgraph has been absorbed into another. No pointers here are safe if so!
std::unordered_map< std::shared_ptr< SCH_CONNECTION >, std::unordered_set< CONNECTION_SUBGRAPH * > > m_bus_parents
If this is a net, this vector contains links to any same-sheet buses that contain it.
bool m_multiple_drivers
True if this subgraph contains more than one driver that should be shorted together in the netlist.
void SetSubgraphCode(int aCode)
std::vector< SCH_ITEM * > m_items
void AddItem(SCH_ITEM *aItem)
Adds a new item to the subgraph.
SCH_CONNECTION * Connection(const SCH_SHEET_PATH &aPath) const
Retrieve the connection associated with this object in the given sheet.
Definition: sch_item.cpp:150
CONNECTION_SUBGRAPH * m_absorbed_by
If this subgraph is absorbed, points to the absorbing (and valid) subgraph.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194

References AddItem(), SCH_ITEM::Connection(), m_absorbed, m_absorbed_by, m_bus_neighbors, m_bus_parents, m_code, m_dirty, m_driver, m_driver_connection, m_items, m_multiple_drivers, m_sheet, and SCH_CONNECTION::SetSubgraphCode().

◆ AddItem()

void CONNECTION_SUBGRAPH::AddItem ( SCH_ITEM aItem)

Adds a new item to the subgraph.

Definition at line 293 of file connection_graph.cpp.

294 {
295  m_items.push_back( aItem );
296 
297  if( aItem->Connection( m_sheet )->IsDriver() )
298  m_drivers.push_back( aItem );
299 
300  if( aItem->Type() == SCH_SHEET_PIN_T )
301  m_hier_pins.push_back( static_cast<SCH_SHEET_PIN*>( aItem ) );
302  else if( aItem->Type() == SCH_HIER_LABEL_T )
303  m_hier_ports.push_back( static_cast<SCH_HIERLABEL*>( aItem ) );
304 }
SCH_SHEET_PATH m_sheet
std::vector< SCH_SHEET_PIN * > m_hier_pins
std::vector< SCH_ITEM * > m_items
std::vector< SCH_ITEM * > m_drivers
bool IsDriver() const
Checks if the SCH_ITEM this connection is attached to can drive connections Drivers can be labels,...
std::vector< SCH_HIERLABEL * > m_hier_ports
SCH_CONNECTION * Connection(const SCH_SHEET_PATH &aPath) const
Retrieve the connection associated with this object in the given sheet.
Definition: sch_item.cpp:150
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193

References SCH_ITEM::Connection(), SCH_CONNECTION::IsDriver(), m_drivers, m_hier_pins, m_hier_ports, m_items, m_sheet, SCH_HIER_LABEL_T, SCH_SHEET_PIN_T, and EDA_ITEM::Type().

Referenced by Absorb(), and CONNECTION_GRAPH::buildConnectionGraph().

◆ GetBusLabels()

std::vector< SCH_ITEM * > CONNECTION_SUBGRAPH::GetBusLabels ( ) const

Returns all the bus labels attached to this subgraph (if any)

Definition at line 209 of file connection_graph.cpp.

210 {
211  std::vector<SCH_ITEM*> labels;
212 
213  for( SCH_ITEM* item : m_drivers )
214  {
215  switch( item->Type() )
216  {
217  case SCH_LABEL_T:
218  case SCH_GLOBAL_LABEL_T:
219  {
220  SCH_CONNECTION* label_conn = item->Connection( m_sheet );
221 
222  // Only consider bus vectors
223  if( label_conn->Type() == CONNECTION_TYPE::BUS )
224  labels.push_back( item );
225 
226  break;
227  }
228 
229  default: break;
230  }
231  }
232 
233  return labels;
234 }
SCH_SHEET_PATH m_sheet
std::vector< SCH_ITEM * > m_drivers
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
CONNECTION_TYPE Type() const
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194
This item represents a bus vector.

References BUS, m_drivers, m_sheet, SCH_GLOBAL_LABEL_T, SCH_LABEL_T, and SCH_CONNECTION::Type().

◆ GetDriverPriority()

CONNECTION_SUBGRAPH::PRIORITY CONNECTION_SUBGRAPH::GetDriverPriority ( SCH_ITEM aDriver)
static

Returns the priority (higher is more important) of a candidate driver.

0: Invalid driver 1: Component pin 2: Hierarchical sheet pin 3: Hierarchical label 4: Local label 5: Power pin 6: Global label

Parameters
aDriveris the item to inspect
Returns
a PRIORITY

Definition at line 334 of file connection_graph.cpp.

335 {
336  if( !aDriver )
337  return PRIORITY::NONE;
338 
339  switch( aDriver->Type() )
340  {
343  case SCH_LABEL_T: return PRIORITY::LOCAL_LABEL;
345  case SCH_PIN_T:
346  {
347  auto sch_pin = static_cast<SCH_PIN*>( aDriver );
348 
349  if( sch_pin->IsPowerConnection() )
350  return PRIORITY::POWER_PIN;
351  else
352  return PRIORITY::PIN;
353  }
354 
355  default: return PRIORITY::NONE;
356  }
357 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193

References GLOBAL, HIER_LABEL, LOCAL_LABEL, NONE, PIN, POWER_PIN, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, SCH_PIN_T, SCH_SHEET_PIN_T, SHEET_PIN, and EDA_ITEM::Type().

Referenced by CONNECTION_GRAPH::buildConnectionGraph(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), CONNECTION_GRAPH::ercCheckNoConnects(), CONNECTION_GRAPH::propagateToNeighbors(), and ResolveDrivers().

◆ GetNameForDriver()

const wxString & CONNECTION_SUBGRAPH::GetNameForDriver ( SCH_ITEM aItem)

Returns the candidate net name for a driver.

Definition at line 237 of file connection_graph.cpp.

238 {
239  if( m_driver_name_cache.count( aItem ) )
240  return m_driver_name_cache.at( aItem );
241 
242  switch( aItem->Type() )
243  {
244  case SCH_PIN_T:
245  {
246  SCH_PIN* pin = static_cast<SCH_PIN*>( aItem );
248  break;
249  }
250 
251  case SCH_LABEL_T:
252  case SCH_GLOBAL_LABEL_T:
253  case SCH_HIER_LABEL_T:
254  case SCH_SHEET_PIN_T:
255  {
256  m_driver_name_cache[aItem] = EscapeString( static_cast<SCH_TEXT*>( aItem )->GetShownText(),
257  CTX_NETNAME );
258  break;
259  }
260 
261  default:
262  wxFAIL_MSG( "Unhandled item type in GetNameForDriver" );
263  break;
264  }
265 
266  return m_driver_name_cache.at( aItem );
267 }
SCH_SHEET_PATH m_sheet
wxString GetDefaultNetName(const SCH_SHEET_PATH &aPath)
Definition: sch_pin.cpp:220
wxString EscapeString(const wxString &aSource, ESCAPE_CONTEXT aContext)
These Escape/Unescape routines use HTML-entity-reference-style encoding to handle characters which ar...
Definition: string.cpp:77
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193
std::unordered_map< SCH_ITEM *, wxString > m_driver_name_cache
A cache of escaped netnames from schematic items.

References CTX_NETNAME, EscapeString(), SCH_PIN::GetDefaultNetName(), m_driver_name_cache, m_sheet, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, SCH_PIN_T, SCH_SHEET_PIN_T, and EDA_ITEM::Type().

Referenced by CONNECTION_GRAPH::getDefaultConnection(), and ResolveDrivers().

◆ GetNetName()

wxString CONNECTION_SUBGRAPH::GetNetName ( ) const

Returns the fully-qualified net name for this subgraph (if one exists)

Definition at line 191 of file connection_graph.cpp.

192 {
193  if( !m_driver || m_dirty )
194  return "";
195 
196  if( !m_driver->Connection( m_sheet ) )
197  {
198 #ifdef CONNECTIVITY_DEBUG
199  wxASSERT_MSG( false, "Tried to get the net name of an item with no connection" );
200 #endif
201 
202  return "";
203  }
204 
205  return m_driver->Connection( m_sheet )->Name();
206 }
SCH_SHEET_PATH m_sheet
wxString Name(bool aIgnoreSheet=false) const
SCH_CONNECTION * Connection(const SCH_SHEET_PATH &aPath) const
Retrieve the connection associated with this object in the given sheet.
Definition: sch_item.cpp:150

References SCH_ITEM::Connection(), m_dirty, m_driver, m_sheet, and SCH_CONNECTION::Name().

Referenced by CONNECTION_GRAPH::buildConnectionGraph().

◆ ResolveDrivers()

bool CONNECTION_SUBGRAPH::ResolveDrivers ( bool  aCreateMarkers = false)

Determines which potential driver should drive the subgraph.

If multiple possible drivers exist, picks one according to the priority. If multiple "winners" exist, returns false and sets m_driver to nullptr.

Parameters
aCreateMarkerscontrols whether ERC markers should be added for conflicts
Returns
true if m_driver was set, or false if a conflict occurred

Definition at line 53 of file connection_graph.cpp.

54 {
55  PRIORITY highest_priority = PRIORITY::INVALID;
56  std::vector<SCH_ITEM*> candidates;
57  std::vector<SCH_ITEM*> strong_drivers;
58 
59  m_driver = nullptr;
60 
61  // Hierarchical labels are lower priority than local labels here,
62  // because on the first pass we want local labels to drive subgraphs
63  // so that we can identify same-sheet neighbors and link them together.
64  // Hierarchical labels will end up overriding the final net name if
65  // a higher-level sheet has a different name during the hierarchical
66  // pass.
67 
68  for( SCH_ITEM* item : m_drivers )
69  {
70  PRIORITY item_priority = GetDriverPriority( item );
71 
72  if( item_priority == PRIORITY::PIN
73  && !static_cast<SCH_PIN*>( item )->GetParentComponent()->IsInNetlist() )
74  continue;
75 
76  if( item_priority >= PRIORITY::HIER_LABEL )
77  strong_drivers.push_back( item );
78 
79  if( item_priority > highest_priority )
80  {
81  candidates.clear();
82  candidates.push_back( item );
83  highest_priority = item_priority;
84  }
85  else if( !candidates.empty() && ( item_priority == highest_priority ) )
86  {
87  candidates.push_back( item );
88  }
89  }
90 
91  if( highest_priority >= PRIORITY::HIER_LABEL )
92  m_strong_driver = true;
93 
94  // Power pins are 5, global labels are 6
95  m_local_driver = ( highest_priority < PRIORITY::POWER_PIN );
96 
97  if( !candidates.empty() )
98  {
99  if( candidates.size() > 1 )
100  {
101  if( highest_priority == PRIORITY::SHEET_PIN )
102  {
103  // We have multiple options, and they are all hierarchical
104  // sheet pins. Let's prefer outputs over inputs.
105 
106  for( auto c : candidates )
107  {
108  auto p = static_cast<SCH_SHEET_PIN*>( c );
109 
110  if( p->GetShape() == PINSHEETLABEL_SHAPE::PS_OUTPUT )
111  {
112  m_driver = c;
113  break;
114  }
115  }
116  }
117  else
118  {
119  // For all other driver types, sort by name
120  std::sort( candidates.begin(), candidates.end(),
121  [&]( SCH_ITEM* a, SCH_ITEM* b ) -> bool
122  {
123  SCH_CONNECTION* ac = a->Connection( m_sheet );
124  SCH_CONNECTION* bc = b->Connection( m_sheet );
125 
126  // Ensure we don't pick the subset over the superset
127  if( ac->IsBus() && bc->IsBus() )
128  return bc->IsSubsetOf( ac );
129 
130  return GetNameForDriver( a ) < GetNameForDriver( b );
131  } );
132  }
133  }
134 
135  if( !m_driver )
136  m_driver = candidates[0];
137  }
138 
139  if( strong_drivers.size() > 1 )
140  m_multiple_drivers = true;
141 
142  // Drop weak drivers
143  if( m_strong_driver )
144  m_drivers = strong_drivers;
145 
146  // Cache driver connection
147  if( m_driver )
149  else
150  m_driver_connection = nullptr;
151 
152  if( aCreateMarkers && m_multiple_drivers )
153  {
154  // First check if all the candidates are actually the same
155  bool same = true;
156  wxString first = GetNameForDriver( candidates[0] );
157  SCH_ITEM* second_item = nullptr;
158 
159  for( unsigned i = 1; i < candidates.size(); i++ )
160  {
161  if( GetNameForDriver( candidates[i] ) != first )
162  {
163  second_item = candidates[i];
164  same = false;
165  break;
166  }
167  }
168 
169  if( !same )
170  {
171  wxPoint pos = candidates[0]->Type() == SCH_PIN_T ?
172  static_cast<SCH_PIN*>( candidates[0] )->GetTransformedPosition() :
173  candidates[0]->GetPosition();
174 
175  std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( ERCE_DRIVER_CONFLICT );
176  ercItem->SetItems( candidates[0], second_item );
177 
178  SCH_MARKER* marker = new SCH_MARKER( ercItem, pos );
179  m_sheet.LastScreen()->Append( marker );
180 
181  // If aCreateMarkers is true, then this is part of ERC check, so we
182  // should return false even if the driver was assigned
183  return false;
184  }
185  }
186 
187  return aCreateMarkers || ( m_driver != nullptr );
188 }
SCH_SHEET_PATH m_sheet
SCH_CONNECTION * m_driver_connection
Cache for driver connection.
static std::shared_ptr< ERC_ITEM > Create(int aErrorCode)
Constructs an ERC_ITEM for the given error code.
Definition: erc_item.cpp:149
static PRIORITY GetDriverPriority(SCH_ITEM *aDriver)
Returns the priority (higher is more important) of a candidate driver.
bool m_local_driver
True if the driver is a local (i.e. non-global) type.
bool m_multiple_drivers
True if this subgraph contains more than one driver that should be shorted together in the netlist.
const wxString & GetNameForDriver(SCH_ITEM *aItem)
Returns the candidate net name for a driver.
bool m_strong_driver
True if the driver is "strong": a label or power object.
std::vector< SCH_ITEM * > m_drivers
SCH_CONNECTION * Connection(const SCH_SHEET_PATH &aPath) const
Retrieve the connection associated with this object in the given sheet.
Definition: sch_item.cpp:150
SCH_SCREEN * LastScreen()
Function LastScreen.
void Append(SCH_ITEM *aItem)
Definition: sch_screen.cpp:131
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
bool IsBus() const
bool IsSubsetOf(SCH_CONNECTION *aOther) const
Returns true if this connection is contained within aOther (but not the same as aOther)
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194

References SCH_SCREEN::Append(), SCH_ITEM::Connection(), ERC_ITEM::Create(), ERCE_DRIVER_CONFLICT, GetDriverPriority(), GetNameForDriver(), HIER_LABEL, INVALID, SCH_CONNECTION::IsBus(), SCH_CONNECTION::IsSubsetOf(), SCH_SHEET_PATH::LastScreen(), m_driver, m_driver_connection, m_drivers, m_local_driver, m_multiple_drivers, m_sheet, m_strong_driver, PIN, POWER_PIN, PS_OUTPUT, SCH_PIN_T, and SHEET_PIN.

Referenced by CONNECTION_GRAPH::buildConnectionGraph().

◆ UpdateItemConnections()

void CONNECTION_SUBGRAPH::UpdateItemConnections ( )

Updates all items to match the driver connection.

Definition at line 307 of file connection_graph.cpp.

308 {
309  if( !m_driver_connection )
310  return;
311 
312  for( SCH_ITEM* item : m_items )
313  {
314  SCH_CONNECTION* item_conn = item->Connection( m_sheet );
315 
316  if( !item_conn )
317  item_conn = item->InitializeConnection( m_sheet, m_graph );
318 
319  if( ( m_driver_connection->IsBus() && item_conn->IsNet() ) ||
320  ( m_driver_connection->IsNet() && item_conn->IsBus() ) )
321  {
322  continue;
323  }
324 
325  if( item != m_driver )
326  {
327  item_conn->Clone( *m_driver_connection );
328  item_conn->ClearDirty();
329  }
330  }
331 }
SCH_SHEET_PATH m_sheet
SCH_CONNECTION * m_driver_connection
Cache for driver connection.
CONNECTION_GRAPH * m_graph
std::vector< SCH_ITEM * > m_items
void Clone(SCH_CONNECTION &aOther)
Copies connectivity information (but not parent) from another connection.
bool IsNet() const
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
bool IsBus() const
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194

References SCH_CONNECTION::ClearDirty(), SCH_CONNECTION::Clone(), SCH_CONNECTION::IsBus(), SCH_CONNECTION::IsNet(), m_driver, m_driver_connection, m_graph, m_items, and m_sheet.

Referenced by CONNECTION_GRAPH::propagateToNeighbors().

Member Data Documentation

◆ m_absorbed

bool CONNECTION_SUBGRAPH::m_absorbed

True if this subgraph has been absorbed into another. No pointers here are safe if so!

Definition at line 145 of file connection_graph.h.

Referenced by Absorb(), CONNECTION_GRAPH::buildConnectionGraph(), CONNECTION_GRAPH::GetSubgraphForItem(), and CONNECTION_GRAPH::propagateToNeighbors().

◆ m_absorbed_by

CONNECTION_SUBGRAPH* CONNECTION_SUBGRAPH::m_absorbed_by

If this subgraph is absorbed, points to the absorbing (and valid) subgraph.

Definition at line 148 of file connection_graph.h.

Referenced by Absorb(), CONNECTION_GRAPH::buildConnectionGraph(), CONNECTION_GRAPH::GetSubgraphForItem(), and CONNECTION_GRAPH::propagateToNeighbors().

◆ m_bus_entry

SCH_ITEM* CONNECTION_SUBGRAPH::m_bus_entry

Bus entry in graph, if any.

Definition at line 169 of file connection_graph.h.

◆ m_bus_neighbors

std::unordered_map< std::shared_ptr<SCH_CONNECTION>, std::unordered_set<CONNECTION_SUBGRAPH*> > CONNECTION_SUBGRAPH::m_bus_neighbors

If a subgraph is a bus, this map contains links between the bus members and any local sheet neighbors with the same connection name.

For example, if this subgraph is a bus D[7..0], and on the same sheet there is a net with label D7, this map will contain an entry for the D7 bus member, and the vector will contain a pointer to the D7 net subgraph.

Definition at line 191 of file connection_graph.h.

Referenced by Absorb().

◆ m_bus_parents

std::unordered_map< std::shared_ptr<SCH_CONNECTION>, std::unordered_set<CONNECTION_SUBGRAPH*> > CONNECTION_SUBGRAPH::m_bus_parents

If this is a net, this vector contains links to any same-sheet buses that contain it.

The string key is the name of the connection that forms the link (which isn't necessarily the same as the name of the connection driving this subgraph)

Definition at line 199 of file connection_graph.h.

Referenced by Absorb().

◆ m_code

long CONNECTION_SUBGRAPH::m_code

◆ m_dirty

bool CONNECTION_SUBGRAPH::m_dirty

Definition at line 142 of file connection_graph.h.

Referenced by Absorb(), GetNetName(), and CONNECTION_GRAPH::propagateToNeighbors().

◆ m_driver

◆ m_driver_connection

◆ m_driver_name_cache

std::unordered_map<SCH_ITEM*, wxString> CONNECTION_SUBGRAPH::m_driver_name_cache

A cache of escaped netnames from schematic items.

Definition at line 211 of file connection_graph.h.

Referenced by GetNameForDriver().

◆ m_drivers

std::vector<SCH_ITEM*> CONNECTION_SUBGRAPH::m_drivers

◆ m_graph

CONNECTION_GRAPH* CONNECTION_SUBGRAPH::m_graph

Definition at line 140 of file connection_graph.h.

Referenced by UpdateItemConnections().

◆ m_hier_parent

CONNECTION_SUBGRAPH* CONNECTION_SUBGRAPH::m_hier_parent

Definition at line 208 of file connection_graph.h.

Referenced by CONNECTION_GRAPH::ercCheckLabels().

◆ m_hier_pins

std::vector<SCH_SHEET_PIN*> CONNECTION_SUBGRAPH::m_hier_pins

Definition at line 202 of file connection_graph.h.

Referenced by AddItem(), and CONNECTION_GRAPH::propagateToNeighbors().

◆ m_hier_ports

std::vector<SCH_HIERLABEL*> CONNECTION_SUBGRAPH::m_hier_ports

Definition at line 205 of file connection_graph.h.

Referenced by AddItem(), and CONNECTION_GRAPH::propagateToNeighbors().

◆ m_items

◆ m_local_driver

bool CONNECTION_SUBGRAPH::m_local_driver

True if the driver is a local (i.e. non-global) type.

Definition at line 163 of file connection_graph.h.

Referenced by ResolveDrivers().

◆ m_multiple_drivers

bool CONNECTION_SUBGRAPH::m_multiple_drivers

True if this subgraph contains more than one driver that should be shorted together in the netlist.

For example, two labels or two power ports.

Definition at line 157 of file connection_graph.h.

Referenced by Absorb(), CONNECTION_GRAPH::ercCheckLabels(), CONNECTION_GRAPH::propagateToNeighbors(), and ResolveDrivers().

◆ m_no_connect

SCH_ITEM* CONNECTION_SUBGRAPH::m_no_connect

◆ m_sheet

◆ m_strong_driver

bool CONNECTION_SUBGRAPH::m_strong_driver

True if the driver is "strong": a label or power object.

Definition at line 160 of file connection_graph.h.

Referenced by CONNECTION_GRAPH::ercCheckLabels(), and ResolveDrivers().


The documentation for this class was generated from the following files: