KiCad PCB EDA Suite
SCH_CONNECTION Class Reference

Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net). More...

#include <sch_connection.h>

Public Member Functions

 SCH_CONNECTION (SCH_ITEM *aParent=nullptr, SCH_SHEET_PATH aPath=SCH_SHEET_PATH())
 Buses can be defined in multiple ways. More...
 
 SCH_CONNECTION (CONNECTION_GRAPH *aGraph)
 
 ~SCH_CONNECTION ()
 
bool operator== (const SCH_CONNECTION &aOther) const
 Note: the equality operator for SCH_CONNECTION only tests the net properties, not the ownership / sheet location! More...
 
bool operator!= (const SCH_CONNECTION &aOther) const
 
void SetGraph (CONNECTION_GRAPH *aGraph)
 
void ConfigureFromLabel (const wxString &aLabel)
 Configures the connection given a label. More...
 
void Reset ()
 Clears connectivity information. More...
 
void Clone (SCH_CONNECTION &aOther)
 Copies connectivity information (but not parent) from another connection. More...
 
SCH_ITEMParent () const
 
SCH_ITEMDriver () const
 
SCH_SHEET_PATH Sheet () const
 
void SetDriver (SCH_ITEM *aItem)
 
void SetSheet (SCH_SHEET_PATH aSheet)
 
bool IsDriver () const
 Checks if the SCH_ITEM this connection is attached to can drive connections Drivers can be labels, sheet pins, or component pins. More...
 
bool IsBus () const
 
bool IsNet () const
 
bool IsDirty () const
 
void SetDirty ()
 
void ClearDirty ()
 
const wxString & Name (bool aIgnoreSheet=false) const
 
const wxString & RawName () const
 
wxString LocalName () const
 
wxString FullLocalName () const
 
void SetName (const wxString &aName)
 
wxString Prefix () const
 
wxString Suffix () const
 
void SetPrefix (const wxString &aPrefix)
 
void SetSuffix (const wxString &aSuffix)
 
CONNECTION_TYPE Type () const
 
void SetType (CONNECTION_TYPE aType)
 
int NetCode () const
 
void SetNetCode (int aCode)
 
int BusCode () const
 
void SetBusCode (int aCode)
 
int SubgraphCode () const
 
void SetSubgraphCode (int aCode)
 
long VectorStart () const
 
long VectorEnd () const
 
long VectorIndex () const
 
wxString VectorPrefix () const
 
std::vector< std::shared_ptr< SCH_CONNECTION > > & Members ()
 
const std::vector< std::shared_ptr< SCH_CONNECTION > > & Members () const
 
const std::vector< std::shared_ptr< SCH_CONNECTION > > AllMembers () const
 
bool IsSubsetOf (SCH_CONNECTION *aOther) const
 Returns true if this connection is contained within aOther (but not the same as aOther) More...
 
bool IsMemberOfBus (SCH_CONNECTION *aOther) const
 Returns true if this connection is a member of bus connection aOther. More...
 
void AppendInfoToMsgPanel (MSG_PANEL_ITEMS &aList) const
 Adds information about the connection object to aList. More...
 
void AppendDebugInfoToMsgPanel (MSG_PANEL_ITEMS &aList) const
 Adds extended debug information about the connection object to aList. More...
 

Static Public Member Functions

static wxString PrintBusForUI (const wxString &aString)
 
static bool ParseBusVector (const wxString &aBus, wxString *aName, std::vector< wxString > *aMemberList)
 Parses a bus vector (e.g. More...
 
static bool ParseBusGroup (wxString aGroup, wxString *name, std::vector< wxString > *aMemberList)
 Parses a bus group label into the name and a list of components. More...
 
static bool IsBusLabel (const wxString &aLabel)
 Test if aLabel has a bus notation. More...
 
static bool MightBeBusLabel (const wxString &aLabel)
 Test if aLabel looks like a bus notation. More...
 

Private Member Functions

void recacheName ()
 

Private Attributes

bool m_dirty
 
SCH_SHEET_PATH m_sheet
 The hierarchical sheet this connection is on. More...
 
SCH_ITEMm_parent
 The SCH_ITEM this connection is owned by. More...
 
SCH_ITEMm_driver
 The SCH_ITEM that drives this connection's net. More...
 
CONNECTION_TYPE m_type
 
wxString m_name
 Name of the connection. More...
 
wxString m_cached_name
 Full name, including prefix and suffix. More...
 
wxString m_cached_name_with_path
 Full name including sheet path (if not global) More...
 
wxString m_local_name
 For bus members, we want to keep track of the "local" name of a member, that is, the name it takes on from its parent bus name. More...
 
wxString m_prefix
 
wxString m_suffix
 Name suffix (used only for disambiguation) More...
 
int m_net_code
 
int m_bus_code
 
int m_subgraph_code
 Groups directly-connected items. More...
 
long m_vector_index
 Index of bus vector member nets. More...
 
long m_vector_start
 Highest member of a vector bus. More...
 
long m_vector_end
 Lowest member of a vector bus. More...
 
wxString m_vector_prefix
 
std::vector< std::shared_ptr< SCH_CONNECTION > > m_members
 For bus connections, store a list of member connections. More...
 
CONNECTION_GRAPHm_graph
 Pointer to the connection graph for the schematic this connection exists on. More...
 

Detailed Description

Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).

These are generated when netlisting, or when editing operations that can change the netlist are performed.

In hierarchical schematics, a single SCH_ITEM object can refer to multiple distinct parts of a design (in the case of a sub-sheet that is instanced more than once in a higher level sheet). Because of this, a single item may contain more than one SCH_CONNECTION – each is specific to a sheet.

Components contain connections for each of their pins (and for each sheet they exist on) but don't use their own connection object.

Definition at line 61 of file sch_connection.h.

Constructor & Destructor Documentation

◆ SCH_CONNECTION() [1/2]

SCH_CONNECTION::SCH_CONNECTION ( SCH_ITEM aParent = nullptr,
SCH_SHEET_PATH  aPath = SCH_SHEET_PATH() 
)

Buses can be defined in multiple ways.

A bus vector consists of a prefix and a numeric range of suffixes:

BUS_NAME[M..N]

For example, the bus A[3..0] will contain nets A3, A2, A1, and A0. The BUS_NAME is required. M and N must be integers but do not need to be in any particular order – A[0..3] produces the same result.

Like net names, bus names cannot contain whitespace.

A bus group is just a grouping of signals, separated by spaces, some of which may be bus vectors. Bus groups can have names, but do not need to.

MEMORY{A[15..0] D[7..0] RW CE OE}

In named bus groups, the net names are expanded as <BUS_NAME>.<NET_NAME> In the above example, the nets would be named like MEMORY.A15, MEMORY.D0, etc.

{USB_DP USB_DN}

In the above example, the bus is unnamed and so the underlying net names are just USB_DP and USB_DN.

Definition at line 61 of file sch_connection.cpp.

61  :
62  m_sheet( aPath ),
63  m_parent( aParent ),
64  m_graph( nullptr )
65 {
66  Reset();
67 }
void Reset()
Clears connectivity information.
CONNECTION_GRAPH * m_graph
Pointer to the connection graph for the schematic this connection exists on.
SCH_SHEET_PATH m_sheet
The hierarchical sheet this connection is on.
SCH_ITEM * m_parent
The SCH_ITEM this connection is owned by.

References Reset().

◆ SCH_CONNECTION() [2/2]

SCH_CONNECTION::SCH_CONNECTION ( CONNECTION_GRAPH aGraph)

Definition at line 70 of file sch_connection.cpp.

70  :
72  m_parent( nullptr ),
73  m_graph( aGraph )
74 {
75  Reset();
76 }
void Reset()
Clears connectivity information.
CONNECTION_GRAPH * m_graph
Pointer to the connection graph for the schematic this connection exists on.
SCH_SHEET_PATH.
SCH_SHEET_PATH m_sheet
The hierarchical sheet this connection is on.
SCH_ITEM * m_parent
The SCH_ITEM this connection is owned by.

References Reset().

◆ ~SCH_CONNECTION()

SCH_CONNECTION::~SCH_CONNECTION ( )
inline

Definition at line 68 of file sch_connection.h.

69  {}

Member Function Documentation

◆ AllMembers()

const std::vector< std::shared_ptr< SCH_CONNECTION > > SCH_CONNECTION::AllMembers ( ) const

Definition at line 646 of file sch_connection.cpp.

647 {
648  std::vector< std::shared_ptr< SCH_CONNECTION > > ret( m_members );
649 
650  for( const auto& member : m_members )
651  if( member->IsBus() )
652  ret.insert( ret.end(), member->Members().begin(), member->Members().end() );
653 
654  return ret;
655 }
std::vector< std::shared_ptr< SCH_CONNECTION > > m_members
For bus connections, store a list of member connections.

References m_members.

Referenced by SCH_EDIT_FRAME::SetCrossProbeConnection().

◆ AppendDebugInfoToMsgPanel()

void SCH_CONNECTION::AppendDebugInfoToMsgPanel ( MSG_PANEL_ITEMS aList) const

Adds extended debug information about the connection object to aList.

Definition at line 378 of file sch_connection.cpp.

379 {
380  if( !ADVANCED_CFG::GetCfg().m_realTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime )
381  return;
382 
383  // These messages are not flagged as translatable, because they are only debug messages
384  wxString msg;
385 
386  AppendInfoToMsgPanel( aList );
387 
388  if( IsBus() )
389  {
390  msg.Printf( "%d", m_bus_code );
391  aList.push_back( MSG_PANEL_ITEM( "Bus Code", msg, BROWN ) );
392  }
393 
394  msg.Printf( "%d", m_subgraph_code );
395  aList.push_back( MSG_PANEL_ITEM( "Subgraph Code", msg, BROWN ) );
396 
397  if( auto driver = Driver() )
398  {
399  msg.Printf( "%s at %p", driver->GetSelectMenuText( EDA_UNITS::MILLIMETRES ), driver );
400  aList.push_back( MSG_PANEL_ITEM( "Connection Source", msg, RED ) );
401  }
402 }
int m_subgraph_code
Groups directly-connected items.
SCH_ITEM * Driver() const
Definition: colors.h:60
static bool m_allowRealTime
void AppendInfoToMsgPanel(MSG_PANEL_ITEMS &aList) const
Adds information about the connection object to aList.
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers of advanced config.
EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:53
bool IsBus() const
Definition: colors.h:62

References AppendInfoToMsgPanel(), BROWN, Driver(), ADVANCED_CFG::GetCfg(), IsBus(), CONNECTION_GRAPH::m_allowRealTime, m_bus_code, m_subgraph_code, MILLIMETRES, and RED.

Referenced by LIB_PIN::GetMsgPanelInfo().

◆ AppendInfoToMsgPanel()

void SCH_CONNECTION::AppendInfoToMsgPanel ( MSG_PANEL_ITEMS aList) const

Adds information about the connection object to aList.

Definition at line 326 of file sch_connection.cpp.

327 {
328  if( !ADVANCED_CFG::GetCfg().m_realTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime )
329  return;
330 
331  wxString msg, group_name;
332  std::vector<wxString> group_members;
333 
334  aList.push_back( MSG_PANEL_ITEM( _( "Connection Name" ), UnescapeString( Name() ), BROWN ) );
335 
336  // NOTE(JE) Disabling this for now, because net codes are generated in the netlist exporter
337  // in order to avoid sort costs. It may make sense to just tear out net codes from the
338  // CONNECTION_GRAPH entirely in the future, as they are mostly only useful for netlist exports.
339 #if 0
340  if( !IsBus() )
341  {
342  msg.Printf( "%d", m_net_code );
343  aList.push_back( MSG_PANEL_ITEM( _( "Net Code" ), msg, BROWN ) );
344  }
345 #endif
346 
347  if( auto alias = m_graph->GetBusAlias( m_name ) )
348  {
349  msg.Printf( _( "Bus Alias %s Members" ), m_name );
350 
351  wxString members;
352 
353  for( const auto& member : alias->Members() )
354  members << member << " ";
355 
356  aList.push_back( MSG_PANEL_ITEM( msg, members, RED ) );
357  }
358  else if( ParseBusGroup( m_name, &group_name, &group_members ) )
359  {
360  for( const auto& group_member : group_members )
361  {
362  if( auto group_alias = m_graph->GetBusAlias( group_member ) )
363  {
364  msg.Printf( _( "Bus Alias %s Members" ), group_alias->GetName() );
365 
366  wxString members;
367 
368  for( const auto& member : group_alias->Members() )
369  members << member << " ";
370 
371  aList.push_back( MSG_PANEL_ITEM( msg, members, RED ) );
372  }
373  }
374  }
375 }
std::shared_ptr< BUS_ALIAS > GetBusAlias(const wxString &aName)
Returns a bus alias pointer for the given name if it exists (from cache)
wxString m_name
Name of the connection.
static bool ParseBusGroup(wxString aGroup, wxString *name, std::vector< wxString > *aMemberList)
Parses a bus group label into the name and a list of components.
CONNECTION_GRAPH * m_graph
Pointer to the connection graph for the schematic this connection exists on.
Definition: colors.h:60
const wxString & Name(bool aIgnoreSheet=false) const
static bool m_allowRealTime
#define _(s)
Definition: 3d_actions.cpp:33
wxString UnescapeString(const wxString &aSource)
Definition: string.cpp:131
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers of advanced config.
EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:53
bool IsBus() const
Definition: colors.h:62

References _, BROWN, CONNECTION_GRAPH::GetBusAlias(), ADVANCED_CFG::GetCfg(), IsBus(), CONNECTION_GRAPH::m_allowRealTime, m_graph, m_name, m_net_code, Name(), ParseBusGroup(), RED, and UnescapeString().

Referenced by AppendDebugInfoToMsgPanel().

◆ BusCode()

int SCH_CONNECTION::BusCode ( ) const
inline

Definition at line 211 of file sch_connection.h.

212  {
213  return m_bus_code;
214  }

References m_bus_code.

Referenced by Clone().

◆ ClearDirty()

void SCH_CONNECTION::ClearDirty ( )
inline

Definition at line 151 of file sch_connection.h.

152  {
153  m_dirty = false;
154  }

References m_dirty.

Referenced by CONNECTION_GRAPH::buildConnectionGraph(), and CONNECTION_SUBGRAPH::UpdateItemConnections().

◆ Clone()

void SCH_CONNECTION::Clone ( SCH_CONNECTION aOther)

Copies connectivity information (but not parent) from another connection.

Parameters
aOtheris the connection to clone

Definition at line 214 of file sch_connection.cpp.

215 {
216  m_graph = aOther.m_graph;
217  m_type = aOther.Type();
218  m_driver = aOther.Driver();
219  m_sheet = aOther.Sheet();
220  m_name = aOther.m_name;
221  // Note: m_local_name is not cloned
222  m_prefix = aOther.Prefix();
223  m_suffix = aOther.Suffix();
224  m_members = aOther.Members();
225  m_net_code = aOther.NetCode();
226  m_bus_code = aOther.BusCode();
227  m_vector_start = aOther.VectorStart();
228  m_vector_end = aOther.VectorEnd();
229  // Note: m_vector_index is not cloned
230  m_vector_prefix = aOther.VectorPrefix();
231 
232  // Note: subgraph code isn't cloned, it should remain with the original object
233 
234  recacheName();
235 }
wxString Prefix() const
std::vector< std::shared_ptr< SCH_CONNECTION > > m_members
For bus connections, store a list of member connections.
wxString m_name
Name of the connection.
SCH_ITEM * m_driver
The SCH_ITEM that drives this connection's net.
int BusCode() const
CONNECTION_TYPE m_type
int NetCode() const
wxString Suffix() const
long VectorEnd() const
SCH_ITEM * Driver() const
CONNECTION_GRAPH * m_graph
Pointer to the connection graph for the schematic this connection exists on.
SCH_SHEET_PATH m_sheet
The hierarchical sheet this connection is on.
wxString m_suffix
Name suffix (used only for disambiguation)
SCH_SHEET_PATH Sheet() const
long m_vector_start
Highest member of a vector bus.
wxString VectorPrefix() const
long VectorStart() const
std::vector< std::shared_ptr< SCH_CONNECTION > > & Members()
long m_vector_end
Lowest member of a vector bus.
wxString m_vector_prefix
CONNECTION_TYPE Type() const

References BusCode(), Driver(), m_bus_code, m_driver, m_graph, m_members, m_name, m_net_code, m_prefix, m_sheet, m_suffix, m_type, m_vector_end, m_vector_prefix, m_vector_start, Members(), NetCode(), Prefix(), recacheName(), Sheet(), Suffix(), Type(), VectorEnd(), VectorPrefix(), and VectorStart().

Referenced by CONNECTION_GRAPH::buildConnectionGraph(), CONNECTION_GRAPH::propagateToNeighbors(), and CONNECTION_SUBGRAPH::UpdateItemConnections().

◆ ConfigureFromLabel()

void SCH_CONNECTION::ConfigureFromLabel ( const wxString &  aLabel)

Configures the connection given a label.

For CONNECTION_NET, this just sets the name. For CONNECTION_BUS, this will deduce the correct BUS_TYPE and also generate a correct list of members.

Definition at line 122 of file sch_connection.cpp.

123 {
124  m_members.clear();
125 
126  m_name = aLabel;
127  m_local_name = aLabel;
128 
129  wxString prefix;
130  std::vector<wxString> members;
131 
132  wxString unescaped = UnescapeString( aLabel );
133 
134  if( ParseBusVector( unescaped, &prefix, &members ) )
135  {
137  m_vector_prefix = prefix;
138 
139  long i = 0;
140 
141  for( const wxString& vector_member : members )
142  {
143  auto member = std::make_shared<SCH_CONNECTION>( m_parent, m_sheet );
144  member->m_type = CONNECTION_TYPE::NET;
145  member->m_prefix = m_prefix;
146  member->m_local_name = vector_member;
147  member->m_vector_index = i++;
148  member->SetName( vector_member );
149  member->SetGraph( m_graph );
150  m_members.push_back( member );
151  }
152  }
153  else if( ParseBusGroup( unescaped, &prefix, &members ) )
154  {
156 
157  // Named bus groups generate a net prefix, unnamed ones don't
158  if( !prefix.IsEmpty() )
159  prefix += wxT( "." );
160 
161  for( const wxString& group_member : members )
162  {
163  // Handle alias inside bus group member list
164  if( auto alias = m_graph->GetBusAlias( group_member ) )
165  {
166  for( const wxString& alias_member : alias->Members() )
167  {
168  auto member = std::make_shared< SCH_CONNECTION >( m_parent, m_sheet );
169  member->SetPrefix( prefix );
170  member->ConfigureFromLabel( alias_member );
171  m_members.push_back( member );
172  }
173  }
174  else
175  {
176  auto member = std::make_shared< SCH_CONNECTION >( m_parent, m_sheet );
177  member->SetPrefix( prefix );
178  member->ConfigureFromLabel( group_member );
179  m_members.push_back( member );
180  }
181  }
182  }
183  else
184  {
186  }
187 
188  recacheName();
189 }
std::vector< std::shared_ptr< SCH_CONNECTION > > m_members
For bus connections, store a list of member connections.
std::shared_ptr< BUS_ALIAS > GetBusAlias(const wxString &aName)
Returns a bus alias pointer for the given name if it exists (from cache)
wxString m_name
Name of the connection.
This item represents a bus group.
static bool ParseBusVector(const wxString &aBus, wxString *aName, std::vector< wxString > *aMemberList)
Parses a bus vector (e.g.
CONNECTION_TYPE m_type
static bool ParseBusGroup(wxString aGroup, wxString *name, std::vector< wxString > *aMemberList)
Parses a bus group label into the name and a list of components.
CONNECTION_GRAPH * m_graph
Pointer to the connection graph for the schematic this connection exists on.
SCH_SHEET_PATH m_sheet
The hierarchical sheet this connection is on.
This item represents a net.
wxString m_local_name
For bus members, we want to keep track of the "local" name of a member, that is, the name it takes on...
wxString UnescapeString(const wxString &aSource)
Definition: string.cpp:131
wxString m_vector_prefix
SCH_ITEM * m_parent
The SCH_ITEM this connection is owned by.
This item represents a bus vector.

References BUS, BUS_GROUP, CONNECTION_GRAPH::GetBusAlias(), m_graph, m_local_name, m_members, m_name, m_parent, m_prefix, m_sheet, m_type, m_vector_prefix, NET, ParseBusGroup(), ParseBusVector(), recacheName(), and UnescapeString().

Referenced by CONNECTION_GRAPH::buildConnectionGraph(), CONNECTION_GRAPH::ercCheckBusToNetConflicts(), and DIALOG_MIGRATE_BUSES::getProposedLabels().

◆ Driver()

SCH_ITEM* SCH_CONNECTION::Driver ( ) const
inline

Definition at line 109 of file sch_connection.h.

110  {
111  return m_driver;
112  }
SCH_ITEM * m_driver
The SCH_ITEM that drives this connection's net.

References m_driver.

Referenced by AppendDebugInfoToMsgPanel(), Clone(), and SCH_EDITOR_CONTROL::UpdateNetHighlighting().

◆ FullLocalName()

wxString SCH_CONNECTION::FullLocalName ( ) const
inline

Definition at line 165 of file sch_connection.h.

166  {
167  return m_prefix + m_local_name + m_suffix;
168  }
wxString m_suffix
Name suffix (used only for disambiguation)
wxString m_local_name
For bus members, we want to keep track of the "local" name of a member, that is, the name it takes on...

References m_local_name, m_prefix, and m_suffix.

Referenced by IsSubsetOf().

◆ IsBus()

◆ IsBusLabel()

bool SCH_CONNECTION::IsBusLabel ( const wxString &  aLabel)
static

Test if aLabel has a bus notation.

Parameters
aLabelA wxString object containing the label to test.
Returns
true if text is a bus notation format otherwise false is returned.

Definition at line 405 of file sch_connection.cpp.

406 {
407  return ParseBusVector( aLabel, nullptr, nullptr ) || ParseBusGroup( aLabel, nullptr, nullptr );
408 }
static bool ParseBusVector(const wxString &aBus, wxString *aName, std::vector< wxString > *aMemberList)
Parses a bus vector (e.g.
static bool ParseBusGroup(wxString aGroup, wxString *name, std::vector< wxString > *aMemberList)
Parses a bus group label into the name and a list of components.

References ParseBusGroup(), and ParseBusVector().

Referenced by SCH_BUS_WIRE_ENTRY::ConnectionPropagatesTo(), NETLIST_OBJECT::ConvertBusToNetListItems(), SCH_TEXT::GetNetListItem(), and SCH_SHEET::GetNetListItem().

◆ IsDirty()

bool SCH_CONNECTION::IsDirty ( ) const
inline

Definition at line 141 of file sch_connection.h.

142  {
143  return m_dirty;
144  }

References m_dirty.

◆ IsDriver()

bool SCH_CONNECTION::IsDriver ( ) const

Checks if the SCH_ITEM this connection is attached to can drive connections Drivers can be labels, sheet pins, or component pins.

Returns
true if the attached items is a driver

Definition at line 238 of file sch_connection.cpp.

239 {
240  wxASSERT( Parent() );
241 
242  switch( Parent()->Type() )
243  {
244  case SCH_LABEL_T:
245  case SCH_GLOBAL_LABEL_T:
246  case SCH_HIER_LABEL_T:
247  case SCH_SHEET_PIN_T:
248  case SCH_SHEET_T:
249  case LIB_PIN_T:
250  return true;
251 
252  case SCH_PIN_T:
253  {
254  auto pin = static_cast<SCH_PIN*>( Parent() );
255 
256  // Only annotated components should drive nets
257  return ( pin->IsPowerConnection()
258  || pin->GetParentComponent()->IsAnnotated( &m_sheet ) );
259  }
260 
261  default:
262  return false;
263  }
264 }
SCH_SHEET_PATH m_sheet
The hierarchical sheet this connection is on.
SCH_ITEM * Parent() const
CONNECTION_TYPE Type() const

References LIB_PIN_T, m_sheet, Parent(), SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, SCH_PIN_T, SCH_SHEET_PIN_T, SCH_SHEET_T, and Type().

Referenced by CONNECTION_SUBGRAPH::AddItem().

◆ IsMemberOfBus()

bool SCH_CONNECTION::IsMemberOfBus ( SCH_CONNECTION aOther) const

Returns true if this connection is a member of bus connection aOther.

Will always return false if aOther is not a bus connection

Definition at line 755 of file sch_connection.cpp.

756 {
757  if( !aOther->IsBus() )
758  return false;
759 
760  auto me = Name( true );
761 
762  for( const auto& m : aOther->Members() )
763  if( m->Name( true ) == me )
764  return true;
765 
766  return false;
767 }
const wxString & Name(bool aIgnoreSheet=false) const
std::vector< std::shared_ptr< SCH_CONNECTION > > & Members()
bool IsBus() const

References IsBus(), Members(), and Name().

◆ IsNet()

bool SCH_CONNECTION::IsNet ( ) const
inline

◆ IsSubsetOf()

bool SCH_CONNECTION::IsSubsetOf ( SCH_CONNECTION aOther) const

Returns true if this connection is contained within aOther (but not the same as aOther)

Returns
true if this connection is a member of aOther

Definition at line 740 of file sch_connection.cpp.

741 {
742  if( !aOther->IsBus() )
743  return false;
744 
745  for( const auto& member : aOther->Members() )
746  {
747  if( member->FullLocalName() == FullLocalName() )
748  return true;
749  }
750 
751  return false;
752 }
wxString FullLocalName() const
std::vector< std::shared_ptr< SCH_CONNECTION > > & Members()
bool IsBus() const

References FullLocalName(), IsBus(), and Members().

Referenced by CONNECTION_SUBGRAPH::ResolveDrivers().

◆ LocalName()

wxString SCH_CONNECTION::LocalName ( ) const
inline

Definition at line 163 of file sch_connection.h.

163 { return m_local_name; }
wxString m_local_name
For bus members, we want to keep track of the "local" name of a member, that is, the name it takes on...

References m_local_name.

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

◆ Members() [1/2]

std::vector< std::shared_ptr< SCH_CONNECTION > >& SCH_CONNECTION::Members ( )
inline

◆ Members() [2/2]

const std::vector< std::shared_ptr< SCH_CONNECTION > >& SCH_CONNECTION::Members ( ) const
inline

Definition at line 256 of file sch_connection.h.

257  {
258  return m_members;
259  }
std::vector< std::shared_ptr< SCH_CONNECTION > > m_members
For bus connections, store a list of member connections.

References m_members.

◆ MightBeBusLabel()

bool SCH_CONNECTION::MightBeBusLabel ( const wxString &  aLabel)
static

Test if aLabel looks like a bus notation.

This check is much less expensive than IsBusLabel.

Parameters
aLabelA wxString object containing the label to test.
Returns
true if text might be a bus label

Definition at line 411 of file sch_connection.cpp.

412 {
413  // Weak heuristic for performance reasons. Stronger test will be used for connectivity
414  wxString label = UnescapeString( aLabel );
415 
416  return label.Contains( wxT( "[" ) ) || label.Contains( wxT( "{" ) );
417 }
wxString UnescapeString(const wxString &aSource)
Definition: string.cpp:131

References UnescapeString().

Referenced by SCH_SCREEN::IsTerminalPoint().

◆ Name()

◆ NetCode()

int SCH_CONNECTION::NetCode ( ) const
inline

Definition at line 201 of file sch_connection.h.

202  {
203  return m_net_code;
204  }

References m_net_code.

Referenced by Clone().

◆ operator!=()

bool SCH_CONNECTION::operator!= ( const SCH_CONNECTION aOther) const

Definition at line 116 of file sch_connection.cpp.

117 {
118  return !( aOther == *this );
119 }

◆ operator==()

bool SCH_CONNECTION::operator== ( const SCH_CONNECTION aOther) const

Note: the equality operator for SCH_CONNECTION only tests the net properties, not the ownership / sheet location!

Definition at line 79 of file sch_connection.cpp.

80 {
81  // NOTE: Not comparing m_dirty or net/bus/subgraph codes
82  if( ( aOther.m_driver == m_driver ) &&
83  ( aOther.m_type == m_type ) &&
84  ( aOther.m_name == m_name ) &&
85  ( aOther.m_sheet == m_sheet ) )
86  {
87  return true;
88  }
89 
90  return false;
91 }
wxString m_name
Name of the connection.
SCH_ITEM * m_driver
The SCH_ITEM that drives this connection's net.
CONNECTION_TYPE m_type
SCH_SHEET_PATH m_sheet
The hierarchical sheet this connection is on.

References m_driver, m_name, m_sheet, and m_type.

◆ Parent()

SCH_ITEM* SCH_CONNECTION::Parent ( ) const
inline

Definition at line 104 of file sch_connection.h.

105  {
106  return m_parent;
107  }
SCH_ITEM * m_parent
The SCH_ITEM this connection is owned by.

References m_parent.

Referenced by IsDriver(), recacheName(), and SCH_EDITOR_CONTROL::UpdateNetHighlighting().

◆ ParseBusGroup()

bool SCH_CONNECTION::ParseBusGroup ( wxString  aGroup,
wxString *  name,
std::vector< wxString > *  aMemberList 
)
static

Parses a bus group label into the name and a list of components.

Parameters
aGroupis the input label, e.g. "USB{DP DM}"
nameis the output group name, e.g. "USB"
aMemberListis a list of member strings, e.g. "DP", "DM"
Returns
true if aGroup was successfully parsed

Definition at line 561 of file sch_connection.cpp.

563 {
564  size_t groupLen = aGroup.length();
565  size_t i = 0;
566  wxString prefix;
567  wxString suffix;
568  wxString tmp;
569  int braceNesting = 0;
570 
571  prefix.reserve( groupLen );
572 
573  // Parse prefix
574  //
575  for( ; i < groupLen; ++i )
576  {
577  if( aGroup[i] == '{' )
578  {
579  if( i > 0 && isSuperSub( aGroup[i-1] ) )
580  braceNesting++;
581  else
582  break;
583  }
584  else if( aGroup[i] == '}' )
585  {
586  braceNesting--;
587  }
588 
589  if( aGroup[i] == ' ' || aGroup[i] == '[' || aGroup[i] == ']' )
590  return false;
591 
592  prefix += aGroup[i];
593  }
594 
595  if( braceNesting != 0 )
596  return false;
597 
598  if( aName )
599  *aName = prefix;
600 
601  // Parse members
602  //
603  i++; // '{' character
604 
605  if( i >= groupLen )
606  return false;
607 
608  for( ; i < groupLen; ++i )
609  {
610  if( aGroup[i] == '{' )
611  {
612  if( i > 0 && isSuperSub( aGroup[i-1] ) )
613  braceNesting++;
614  else
615  return false;
616  }
617  else if( aGroup[i] == '}' )
618  {
619  if( braceNesting )
620  braceNesting--;
621  else
622  {
623  if( aMemberList )
624  aMemberList->push_back( tmp );
625 
626  return true;
627  }
628  }
629 
630  if( aGroup[i] == ' ' )
631  {
632  if( aMemberList )
633  aMemberList->push_back( tmp );
634 
635  tmp.Clear();
636  continue;
637  }
638 
639  tmp += aGroup[i];
640  }
641 
642  return false;
643 }
static bool isSuperSub(wxChar c)

References isSuperSub().

Referenced by AppendInfoToMsgPanel(), ConfigureFromLabel(), NETLIST_OBJECT::ConvertBusToNetListItems(), IsBusLabel(), and SCH_NETNAME_VALIDATOR::IsValid().

◆ ParseBusVector()

bool SCH_CONNECTION::ParseBusVector ( const wxString &  aBus,
wxString *  aName,
std::vector< wxString > *  aMemberList 
)
static

Parses a bus vector (e.g.

A[7..0]) into name, begin, and end. Ensures that begin and end are positive and that end > begin.

Parameters
aBusis a bus vector label string
aNameout is the bus name, e.g. "A"
aMemberListis a list of member strings, e.g. "A7", "A6", and so on
Returns
true if aBus was successfully parsed

Definition at line 426 of file sch_connection.cpp.

428 {
429  auto isDigit = []( wxChar c )
430  {
431  static wxString digits( wxT( "0123456789" ) );
432  return digits.Contains( c );
433  };
434 
435  size_t busLen = aBus.length();
436  size_t i = 0;
437  wxString prefix;
438  wxString suffix;
439  wxString tmp;
440  long begin = 0;
441  long end = 0;
442  int braceNesting = 0;
443 
444  prefix.reserve( busLen );
445 
446  // Parse prefix
447  //
448  for( ; i < busLen; ++i )
449  {
450  if( aBus[i] == '{' )
451  {
452  if( i > 0 && isSuperSub( aBus[i-1] ) )
453  braceNesting++;
454  else
455  return false;
456  }
457  else if( aBus[i] == '}' )
458  {
459  braceNesting--;
460  }
461 
462  if( aBus[i] == ' ' || aBus[i] == ']' )
463  return false;
464 
465  if( aBus[i] == '[' )
466  break;
467 
468  prefix += aBus[i];
469  }
470 
471  // Parse start number
472  //
473  i++; // '[' character
474 
475  if( i >= busLen )
476  return false;
477 
478  for( ; i < busLen; ++i )
479  {
480  if( aBus[i] == '.' && i + 1 < busLen && aBus[i+1] == '.' )
481  {
482  tmp.ToLong( &begin );
483  i += 2;
484  break;
485  }
486 
487  if( !isDigit( aBus[i] ) )
488  return false;
489 
490  tmp += aBus[i];
491  }
492 
493  // Parse end number
494  //
495  tmp = wxEmptyString;
496 
497  if( i >= busLen )
498  return false;
499 
500  for( ; i < busLen; ++i )
501  {
502  if( aBus[i] == ']' )
503  {
504  tmp.ToLong( &end );
505  ++i;
506  break;
507  }
508 
509  if( !isDigit( aBus[i] ) )
510  return false;
511 
512  tmp += aBus[i];
513  }
514 
515  // Parse suffix
516  //
517  for( ; i < busLen; ++i )
518  {
519  if( aBus[i] == '}' )
520  {
521  braceNesting--;
522  suffix += aBus[i];
523  }
524  else if( aBus[i] == '~' )
525  {
526  suffix += aBus[i];
527  }
528  else
529  {
530  return false;
531  }
532  }
533 
534  if( braceNesting != 0 )
535  return false;
536 
537  if( begin == end )
538  return false;
539  else if( begin > end )
540  std::swap( begin, end );
541 
542  if( aName )
543  *aName = prefix;
544 
545  if( aMemberList )
546  {
547  for( long idx = begin; idx <= end; ++idx )
548  {
549  wxString str = prefix;
550  str << idx;
551  str << suffix;
552 
553  aMemberList->emplace_back( str );
554  }
555  }
556 
557  return true;
558 }
bool isDigit(char cc)
Definition: dsnlexer.cpp:466
static bool isSuperSub(wxChar c)

References isDigit(), and isSuperSub().

Referenced by ConfigureFromLabel(), NETLIST_OBJECT::ConvertBusToNetListItems(), IsBusLabel(), SCH_NETNAME_VALIDATOR::IsValid(), and SCH_EAGLE_PLUGIN::translateEagleBusName().

◆ Prefix()

wxString SCH_CONNECTION::Prefix ( ) const
inline

Definition at line 176 of file sch_connection.h.

177  {
178  return m_prefix;
179  }

References m_prefix.

Referenced by Clone().

◆ PrintBusForUI()

wxString SCH_CONNECTION::PrintBusForUI ( const wxString &  aString)
static

Definition at line 658 of file sch_connection.cpp.

659 {
660  size_t groupLen = aGroup.length();
661  size_t i = 0;
662  wxString ret;
663  int braceNesting = 0;
664  int tildeNesting = 0;
665 
666  // Parse prefix
667  //
668  for( ; i < groupLen; ++i )
669  {
670  if( isSuperSub( aGroup[i] ) && i + 1 < groupLen && aGroup[i+1] == '{' )
671  {
672  braceNesting++;
673  i++;
674  continue;
675  }
676  else if( aGroup[i] == '~' )
677  {
678  if( tildeNesting )
679  {
680  tildeNesting = 0;
681  continue;
682  }
683  else
684  {
685  tildeNesting++;
686  }
687  }
688  else if( aGroup[i] == '}' )
689  {
690  braceNesting--;
691  continue;
692  }
693 
694  ret += aGroup[i];
695 
696  if( aGroup[i] == '{' )
697  break;
698  }
699 
700  // Parse members
701  //
702  i++; // '{' character
703 
704  for( ; i < groupLen; ++i )
705  {
706  if( isSuperSub( aGroup[i] ) && i + 1 < groupLen && aGroup[i+1] == '{' )
707  {
708  braceNesting++;
709  i++;
710  continue;
711  }
712  else if( aGroup[i] == '~' )
713  {
714  if( tildeNesting )
715  {
716  tildeNesting = 0;
717  continue;
718  }
719  else
720  {
721  tildeNesting++;
722  }
723  }
724  else if( aGroup[i] == '}' )
725  {
726  braceNesting--;
727  continue;
728  }
729 
730  ret += aGroup[i];
731 
732  if( aGroup[i] == '}' )
733  break;
734  }
735 
736  return ret;
737 }
static bool isSuperSub(wxChar c)

References isSuperSub().

Referenced by BUS_UNFOLD_MENU::update().

◆ RawName()

const wxString& SCH_CONNECTION::RawName ( ) const
inline

Definition at line 158 of file sch_connection.h.

159  {
160  return m_name;
161  }
wxString m_name
Name of the connection.

References m_name.

◆ recacheName()

void SCH_CONNECTION::recacheName ( )
private

Definition at line 274 of file sch_connection.cpp.

275 {
276  m_cached_name = m_name.IsEmpty() ? "<NO NET>" : m_prefix + m_name + m_suffix;
277 
278  bool prepend_path = true;
279 
280  if( !Parent() || m_type == CONNECTION_TYPE::NONE )
281  prepend_path = false;
282 
283  if( m_driver )
284  {
285  switch( m_driver->Type() )
286  {
287  case SCH_GLOBAL_LABEL_T:
288  case SCH_PIN_T:
289  // Pins are either power connections or belong to a uniquely-annotated
290  // component, so they don't need a path if they are driving the subgraph
291  prepend_path = false;
292  break;
293 
294  default:
295  break;
296  }
297  }
298 
301 }
wxString m_cached_name
Full name, including prefix and suffix.
wxString m_name
Name of the connection.
SCH_ITEM * m_driver
The SCH_ITEM that drives this connection's net.
wxString m_cached_name_with_path
Full name including sheet path (if not global)
CONNECTION_TYPE m_type
No connection to this item.
SCH_SHEET_PATH m_sheet
The hierarchical sheet this connection is on.
wxString m_suffix
Name suffix (used only for disambiguation)
SCH_ITEM * Parent() const
wxString PathHumanReadable() const
Function PathHumanReadable returns the sheet path in a human readable form, i.e.
KICAD_T Type() const
Function Type()
Definition: base_struct.h:197

References m_cached_name, m_cached_name_with_path, m_driver, m_name, m_prefix, m_sheet, m_suffix, m_type, NONE, Parent(), SCH_SHEET_PATH::PathHumanReadable(), SCH_GLOBAL_LABEL_T, SCH_PIN_T, and EDA_ITEM::Type().

Referenced by Clone(), ConfigureFromLabel(), SetDriver(), SetName(), SetPrefix(), SetSheet(), SetSuffix(), and SetType().

◆ Reset()

void SCH_CONNECTION::Reset ( )

Clears connectivity information.

Definition at line 192 of file sch_connection.cpp.

193 {
195  m_name.Empty();
196  m_local_name.Empty();
197  m_cached_name.Empty();
198  m_cached_name_with_path.Empty();
199  m_prefix.Empty();
200  m_suffix .Empty();
201  m_driver = nullptr;
202  m_members.clear();
203  m_dirty = true;
204  m_net_code = 0;
205  m_bus_code = 0;
206  m_subgraph_code = 0;
207  m_vector_start = 0;
208  m_vector_end = 0;
209  m_vector_index = 0;
210  m_vector_prefix.Empty();
211 }
int m_subgraph_code
Groups directly-connected items.
wxString m_cached_name
Full name, including prefix and suffix.
std::vector< std::shared_ptr< SCH_CONNECTION > > m_members
For bus connections, store a list of member connections.
wxString m_name
Name of the connection.
SCH_ITEM * m_driver
The SCH_ITEM that drives this connection's net.
wxString m_cached_name_with_path
Full name including sheet path (if not global)
CONNECTION_TYPE m_type
No connection to this item.
wxString m_suffix
Name suffix (used only for disambiguation)
wxString m_local_name
For bus members, we want to keep track of the "local" name of a member, that is, the name it takes on...
long m_vector_start
Highest member of a vector bus.
long m_vector_index
Index of bus vector member nets.
long m_vector_end
Lowest member of a vector bus.
wxString m_vector_prefix

References m_bus_code, m_cached_name, m_cached_name_with_path, m_dirty, m_driver, m_local_name, m_members, m_name, m_net_code, m_prefix, m_subgraph_code, m_suffix, m_type, m_vector_end, m_vector_index, m_vector_prefix, m_vector_start, and NONE.

Referenced by SCH_ITEM::InitializeConnection(), and SCH_CONNECTION().

◆ SetBusCode()

void SCH_CONNECTION::SetBusCode ( int  aCode)
inline

Definition at line 216 of file sch_connection.h.

217  {
218  m_bus_code = aCode;
219  }

References m_bus_code.

Referenced by CONNECTION_GRAPH::buildConnectionGraph().

◆ SetDirty()

void SCH_CONNECTION::SetDirty ( )
inline

Definition at line 146 of file sch_connection.h.

147  {
148  m_dirty = true;
149  }

References m_dirty.

◆ SetDriver()

void SCH_CONNECTION::SetDriver ( SCH_ITEM aItem)

Definition at line 94 of file sch_connection.cpp.

95 {
96  m_driver = aItem;
97 
98  recacheName();
99 
100  for( const auto& member : m_members )
101  member->SetDriver( aItem );
102 }
std::vector< std::shared_ptr< SCH_CONNECTION > > m_members
For bus connections, store a list of member connections.
SCH_ITEM * m_driver
The SCH_ITEM that drives this connection's net.

References m_driver, m_members, and recacheName().

Referenced by CONNECTION_GRAPH::buildConnectionGraph().

◆ SetGraph()

void SCH_CONNECTION::SetGraph ( CONNECTION_GRAPH aGraph)
inline

Definition at line 79 of file sch_connection.h.

80  {
81  m_graph = aGraph;
82  }
CONNECTION_GRAPH * m_graph
Pointer to the connection graph for the schematic this connection exists on.

References m_graph.

Referenced by CONNECTION_GRAPH::buildConnectionGraph(), and CONNECTION_SUBGRAPH::UpdateItemConnections().

◆ SetName()

void SCH_CONNECTION::SetName ( const wxString &  aName)
inline

Definition at line 170 of file sch_connection.h.

171  {
172  m_name = aName;
173  recacheName();
174  }
wxString m_name
Name of the connection.

References m_name, and recacheName().

Referenced by CONNECTION_GRAPH::buildConnectionGraph().

◆ SetNetCode()

void SCH_CONNECTION::SetNetCode ( int  aCode)
inline

Definition at line 206 of file sch_connection.h.

207  {
208  m_net_code = aCode;
209  }

References m_net_code.

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

◆ SetPrefix()

void SCH_CONNECTION::SetPrefix ( const wxString &  aPrefix)

Definition at line 304 of file sch_connection.cpp.

305 {
306  m_prefix = aPrefix;
307 
308  recacheName();
309 
310  for( const auto& m : Members() )
311  m->SetPrefix( aPrefix );
312 }
std::vector< std::shared_ptr< SCH_CONNECTION > > & Members()

References m_prefix, Members(), and recacheName().

◆ SetSheet()

void SCH_CONNECTION::SetSheet ( SCH_SHEET_PATH  aSheet)

Definition at line 105 of file sch_connection.cpp.

106 {
107  m_sheet = aSheet;
108 
109  recacheName();
110 
111  for( const auto& member : m_members )
112  member->SetSheet( aSheet );
113 }
std::vector< std::shared_ptr< SCH_CONNECTION > > m_members
For bus connections, store a list of member connections.
SCH_SHEET_PATH m_sheet
The hierarchical sheet this connection is on.

References m_members, m_sheet, and recacheName().

Referenced by SCH_ITEM::InitializeConnection().

◆ SetSubgraphCode()

void SCH_CONNECTION::SetSubgraphCode ( int  aCode)
inline

Definition at line 226 of file sch_connection.h.

227  {
228  m_subgraph_code = aCode;
229  }
int m_subgraph_code
Groups directly-connected items.

References m_subgraph_code.

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

◆ SetSuffix()

void SCH_CONNECTION::SetSuffix ( const wxString &  aSuffix)

Definition at line 315 of file sch_connection.cpp.

316 {
317  m_suffix = aSuffix;
318 
319  recacheName();
320 
321  for( const auto& m : Members() )
322  m->SetSuffix( aSuffix );
323 }
wxString m_suffix
Name suffix (used only for disambiguation)
std::vector< std::shared_ptr< SCH_CONNECTION > > & Members()

References m_suffix, Members(), and recacheName().

Referenced by CONNECTION_GRAPH::buildConnectionGraph().

◆ SetType()

void SCH_CONNECTION::SetType ( CONNECTION_TYPE  aType)
inline

Definition at line 195 of file sch_connection.h.

196  {
197  m_type = aType;
198  recacheName();
199  }
CONNECTION_TYPE m_type

References m_type, and recacheName().

Referenced by CONNECTION_GRAPH::buildConnectionGraph().

◆ Sheet()

SCH_SHEET_PATH SCH_CONNECTION::Sheet ( ) const
inline

Definition at line 114 of file sch_connection.h.

115  {
116  return m_sheet;
117  }
SCH_SHEET_PATH m_sheet
The hierarchical sheet this connection is on.

References m_sheet.

Referenced by Clone().

◆ SubgraphCode()

int SCH_CONNECTION::SubgraphCode ( ) const
inline

Definition at line 221 of file sch_connection.h.

222  {
223  return m_subgraph_code;
224  }
int m_subgraph_code
Groups directly-connected items.

References m_subgraph_code.

Referenced by CONNECTION_GRAPH::buildConnectionGraph().

◆ Suffix()

wxString SCH_CONNECTION::Suffix ( ) const
inline

Definition at line 181 of file sch_connection.h.

182  {
183  return m_suffix;
184  }
wxString m_suffix
Name suffix (used only for disambiguation)

References m_suffix.

Referenced by Clone().

◆ Type()

CONNECTION_TYPE SCH_CONNECTION::Type ( ) const
inline

Definition at line 190 of file sch_connection.h.

191  {
192  return m_type;
193  }
CONNECTION_TYPE m_type

References m_type.

Referenced by Clone(), CONNECTION_SUBGRAPH::GetBusLabels(), IsDriver(), and CONNECTION_GRAPH::matchBusMember().

◆ VectorEnd()

long SCH_CONNECTION::VectorEnd ( ) const
inline

Definition at line 236 of file sch_connection.h.

237  {
238  return m_vector_end;
239  }
long m_vector_end
Lowest member of a vector bus.

References m_vector_end.

Referenced by Clone(), and NETLIST_OBJECT::ConvertBusToNetListItems().

◆ VectorIndex()

long SCH_CONNECTION::VectorIndex ( ) const
inline

Definition at line 241 of file sch_connection.h.

242  {
243  return m_vector_index;
244  }
long m_vector_index
Index of bus vector member nets.

References m_vector_index.

Referenced by CONNECTION_GRAPH::matchBusMember().

◆ VectorPrefix()

wxString SCH_CONNECTION::VectorPrefix ( ) const
inline

Definition at line 246 of file sch_connection.h.

247  {
248  return m_vector_prefix;
249  }
wxString m_vector_prefix

References m_vector_prefix.

Referenced by Clone().

◆ VectorStart()

long SCH_CONNECTION::VectorStart ( ) const
inline

Definition at line 231 of file sch_connection.h.

232  {
233  return m_vector_start;
234  }
long m_vector_start
Highest member of a vector bus.

References m_vector_start.

Referenced by Clone(), and NETLIST_OBJECT::ConvertBusToNetListItems().

Member Data Documentation

◆ m_bus_code

int SCH_CONNECTION::m_bus_code
private

Definition at line 363 of file sch_connection.h.

Referenced by AppendDebugInfoToMsgPanel(), BusCode(), Clone(), Reset(), and SetBusCode().

◆ m_cached_name

wxString SCH_CONNECTION::m_cached_name
private

Full name, including prefix and suffix.

Definition at line 343 of file sch_connection.h.

Referenced by Name(), recacheName(), and Reset().

◆ m_cached_name_with_path

wxString SCH_CONNECTION::m_cached_name_with_path
private

Full name including sheet path (if not global)

Definition at line 345 of file sch_connection.h.

Referenced by Name(), recacheName(), and Reset().

◆ m_dirty

bool SCH_CONNECTION::m_dirty
private

Definition at line 331 of file sch_connection.h.

Referenced by ClearDirty(), IsDirty(), Reset(), and SetDirty().

◆ m_driver

SCH_ITEM* SCH_CONNECTION::m_driver
private

The SCH_ITEM that drives this connection's net.

Definition at line 337 of file sch_connection.h.

Referenced by Clone(), Driver(), operator==(), recacheName(), Reset(), and SetDriver().

◆ m_graph

CONNECTION_GRAPH* SCH_CONNECTION::m_graph
private

Pointer to the connection graph for the schematic this connection exists on.

Needed for bus alias lookups.

Definition at line 388 of file sch_connection.h.

Referenced by AppendInfoToMsgPanel(), Clone(), ConfigureFromLabel(), and SetGraph().

◆ m_local_name

wxString SCH_CONNECTION::m_local_name
private

For bus members, we want to keep track of the "local" name of a member, that is, the name it takes on from its parent bus name.

This is because we always want to use the local name for bus unfolding, matching within buses, etc. The actual resolved name of this bus member might change, for example if it's connected elsewhere to some other item with higher priority.Prefix if connection is member of a labeled bus group (or "" if not)

Definition at line 354 of file sch_connection.h.

Referenced by ConfigureFromLabel(), FullLocalName(), LocalName(), and Reset().

◆ m_members

std::vector< std::shared_ptr< SCH_CONNECTION > > SCH_CONNECTION::m_members
private

For bus connections, store a list of member connections.

NOTE: All connections that Clone() others share the list of member pointers. This seems fine at the moment.

Definition at line 382 of file sch_connection.h.

Referenced by AllMembers(), Clone(), ConfigureFromLabel(), Members(), Reset(), SetDriver(), and SetSheet().

◆ m_name

wxString SCH_CONNECTION::m_name
private

Name of the connection.

Definition at line 341 of file sch_connection.h.

Referenced by AppendInfoToMsgPanel(), Clone(), ConfigureFromLabel(), operator==(), RawName(), recacheName(), Reset(), and SetName().

◆ m_net_code

int SCH_CONNECTION::m_net_code
private

Definition at line 361 of file sch_connection.h.

Referenced by AppendInfoToMsgPanel(), Clone(), NetCode(), Reset(), and SetNetCode().

◆ m_parent

SCH_ITEM* SCH_CONNECTION::m_parent
private

The SCH_ITEM this connection is owned by.

Definition at line 335 of file sch_connection.h.

Referenced by ConfigureFromLabel(), and Parent().

◆ m_prefix

wxString SCH_CONNECTION::m_prefix
private

◆ m_sheet

SCH_SHEET_PATH SCH_CONNECTION::m_sheet
private

The hierarchical sheet this connection is on.

Definition at line 333 of file sch_connection.h.

Referenced by Clone(), ConfigureFromLabel(), IsDriver(), operator==(), recacheName(), SetSheet(), and Sheet().

◆ m_subgraph_code

int SCH_CONNECTION::m_subgraph_code
private

Groups directly-connected items.

Definition at line 365 of file sch_connection.h.

Referenced by AppendDebugInfoToMsgPanel(), Reset(), SetSubgraphCode(), and SubgraphCode().

◆ m_suffix

wxString SCH_CONNECTION::m_suffix
private

Name suffix (used only for disambiguation)

Definition at line 359 of file sch_connection.h.

Referenced by Clone(), FullLocalName(), recacheName(), Reset(), SetSuffix(), and Suffix().

◆ m_type

CONNECTION_TYPE SCH_CONNECTION::m_type
private

◆ m_vector_end

long SCH_CONNECTION::m_vector_end
private

Lowest member of a vector bus.

Prefix name of the vector, if m_type == CONNECTION_BUS (or "" if not)

Definition at line 371 of file sch_connection.h.

Referenced by Clone(), Reset(), and VectorEnd().

◆ m_vector_index

long SCH_CONNECTION::m_vector_index
private

Index of bus vector member nets.

Definition at line 367 of file sch_connection.h.

Referenced by Reset(), and VectorIndex().

◆ m_vector_prefix

wxString SCH_CONNECTION::m_vector_prefix
private

Definition at line 374 of file sch_connection.h.

Referenced by Clone(), ConfigureFromLabel(), Reset(), and VectorPrefix().

◆ m_vector_start

long SCH_CONNECTION::m_vector_start
private

Highest member of a vector bus.

Definition at line 369 of file sch_connection.h.

Referenced by Clone(), Reset(), and VectorStart().


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