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 (const SCH_CONNECTION &aOther)
 Copies connectivity information (but not parent) from another connection. More...
 
SCH_ITEMParent () const
 
SCH_ITEMDriver () const
 
void SetDriver (SCH_ITEM *aItem)
 
SCH_SHEET_PATH Sheet () const
 
void SetSheet (SCH_SHEET_PATH aSheet)
 
SCH_SHEET_PATH LocalSheet () const
 
bool IsDriver () const
 Checks if the SCH_ITEM this connection is attached to can drive connections Drivers can be labels, sheet pins, or symbol pins. More...
 
bool IsBus () const
 
bool IsNet () const
 
bool IsUnconnected () const
 
bool IsDirty () const
 
void SetDirty ()
 
void ClearDirty ()
 
bool HasDriverChanged () const
 
void ClearDriverChanged ()
 
void * GetLastDriver () const
 
wxString Name (bool aIgnoreSheet=false) const
 
wxString LocalName () const
 
wxString FullLocalName () const
 
void SetName (const wxString &aName)
 
wxString Prefix () const
 
void SetPrefix (const wxString &aPrefix)
 
wxString BusPrefix () const
 
wxString Suffix () const
 
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 (std::vector< MSG_PANEL_ITEM > &aList) const
 Adds information about the connection object to aList. More...
 

Static Public Member Functions

static wxString PrintBusForUI (const wxString &aString)
 
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_SHEET_PATH m_local_sheet
 When a connection is overridden by one on a different hierarchical sheet, it will be cloned and m_sheet will point to the parent sheet. More...
 
SCH_ITEMm_parent
 The SCH_ITEM this connection is owned by. More...
 
void * m_lastDriver
 WEAK POINTER (there is no guarantee it is still allocated) Equality comparisons are OK, but that's pretty much it. 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
 Prefix if connection is member of a labeled bus group (or "" if not) More...
 
wxString m_local_prefix
 Local prefix for group bus members (used with m_local_name) More...
 
wxString m_bus_prefix
 Optional prefix of a bux group (always empty for nets and vector buses) More...
 
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.

Symbols 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 64 of file sch_connection.cpp.

64  :
65  m_sheet( aPath ),
66  m_local_sheet( aPath ),
67  m_parent( aParent ),
68  m_driver( nullptr ),
69  m_graph( nullptr )
70 {
71  Reset();
72 }
SCH_ITEM * m_driver
The SCH_ITEM that drives this connection's net.
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_SHEET_PATH m_local_sheet
When a connection is overridden by one on a different hierarchical sheet, it will be cloned and m_she...
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 75 of file sch_connection.cpp.

75  :
78  m_parent( nullptr ),
79  m_driver( nullptr ),
80  m_graph( aGraph )
81 {
82  Reset();
83 }
SCH_ITEM * m_driver
The SCH_ITEM that drives this connection's net.
void Reset()
Clears connectivity information.
CONNECTION_GRAPH * m_graph
Pointer to the connection graph for the schematic this connection exists on.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
SCH_SHEET_PATH m_sheet
The hierarchical sheet this connection is on.
SCH_SHEET_PATH m_local_sheet
When a connection is overridden by one on a different hierarchical sheet, it will be cloned and m_she...
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 481 of file sch_connection.cpp.

482 {
483  std::vector< std::shared_ptr< SCH_CONNECTION > > ret( m_members );
484 
485  for( const auto& member : m_members )
486  if( member->IsBus() )
487  ret.insert( ret.end(), member->Members().begin(), member->Members().end() );
488 
489  return ret;
490 }
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().

◆ AppendInfoToMsgPanel()

void SCH_CONNECTION::AppendInfoToMsgPanel ( std::vector< MSG_PANEL_ITEM > &  aList) const

Adds information about the connection object to aList.

Definition at line 403 of file sch_connection.cpp.

404 {
405  wxString msg, group_name, members;
406  std::vector<wxString> group_members;
407 
408  aList.emplace_back( _( "Connection Name" ), UnescapeString( Name() ) );
409 
410  // NOTE(JE) Disabling this for now, because net codes are generated in the netlist exporter
411  // in order to avoid sort costs. It may make sense to just tear out net codes from the
412  // CONNECTION_GRAPH entirely in the future, as they are mostly only useful for netlist exports.
413 #if 0
414  if( !IsBus() )
415  aList.emplace_back( _( "Net Code" ), wxString::Format( "%d", m_net_code ) );
416 #endif
417 
418  if( auto alias = m_graph->GetBusAlias( m_name ) )
419  {
420  msg.Printf( _( "Bus Alias %s Members" ), m_name );
421 
422  for( const wxString& member : alias->Members() )
423  members << member << wxT( " " );
424 
425  aList.emplace_back( msg, members );
426  }
427  else if( NET_SETTINGS::ParseBusGroup( m_name, &group_name, &group_members ) )
428  {
429  for( const wxString& group_member : group_members )
430  {
431  if( std::shared_ptr<BUS_ALIAS> group_alias = m_graph->GetBusAlias( group_member ) )
432  {
433  msg.Printf( _( "Bus Alias %s Members" ), group_alias->GetName() );
434 
435  for( const wxString& member : group_alias->Members() )
436  members << member << wxT( " " );
437 
438  aList.emplace_back( msg, members );
439  }
440  }
441  }
442 
443 #if defined(DEBUG)
444  // These messages are not flagged as translatable, because they are only debug messages
445 
446  if( !ADVANCED_CFG::GetCfg().m_RealTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime )
447  return;
448 
449  if( IsBus() )
450  aList.emplace_back( wxT( "Bus Code" ), wxString::Format( wxT( "%d" ), m_bus_code ) );
451 
452  aList.emplace_back( wxT( "Subgraph Code" ), wxString::Format( wxT( "%d" ), m_subgraph_code ) );
453 
454  if( SCH_ITEM* driver = Driver() )
455  {
456  msg.Printf( wxT( "%s at %p" ), driver->GetSelectMenuText( EDA_UNITS::MILLIMETRES ), driver );
457  aList.emplace_back( wxT( "Connection Source" ), msg );
458  }
459 #endif
460 }
int m_subgraph_code
Groups directly-connected items.
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(const wxString &aGroup, wxString *name, std::vector< wxString > *aMemberList)
Parse a bus group label into the name and a list of components.
wxString Name(bool aIgnoreSheet=false) const
SCH_ITEM * Driver() const
#define _(s)
CONNECTION_GRAPH * m_graph
Pointer to the connection graph for the schematic this connection exists on.
wxString UnescapeString(const wxString &aSource)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
static bool m_allowRealTime
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
bool IsBus() const
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182

References _, Driver(), Format(), CONNECTION_GRAPH::GetBusAlias(), ADVANCED_CFG::GetCfg(), IsBus(), CONNECTION_GRAPH::m_allowRealTime, m_bus_code, m_graph, m_name, m_net_code, m_subgraph_code, MILLIMETRES, Name(), NET_SETTINGS::ParseBusGroup(), and UnescapeString().

Referenced by SCH_PIN::GetMsgPanelInfo(), SCH_BUS_ENTRY_BASE::GetMsgPanelInfo(), SCH_LINE::GetMsgPanelInfo(), and SCH_TEXT::GetMsgPanelInfo().

◆ BusCode()

int SCH_CONNECTION::BusCode ( ) const
inline

Definition at line 176 of file sch_connection.h.

176 { return m_bus_code; }

References m_bus_code.

Referenced by Clone().

◆ BusPrefix()

wxString SCH_CONNECTION::BusPrefix ( ) const
inline

Definition at line 160 of file sch_connection.h.

160 { return m_bus_prefix; }
wxString m_bus_prefix
Optional prefix of a bux group (always empty for nets and vector buses)

References m_bus_prefix.

◆ ClearDirty()

void SCH_CONNECTION::ClearDirty ( )
inline

Definition at line 136 of file sch_connection.h.

136 { m_dirty = false; }

References m_dirty.

Referenced by CONNECTION_SUBGRAPH::ResolveDrivers(), and CONNECTION_SUBGRAPH::UpdateItemConnections().

◆ ClearDriverChanged()

void SCH_CONNECTION::ClearDriverChanged ( )

Definition at line 337 of file sch_connection.cpp.

338 {
340 }
SCH_ITEM * m_driver
The SCH_ITEM that drives this connection's net.
void * m_lastDriver
WEAK POINTER (there is no guarantee it is still allocated) Equality comparisons are OK,...

References m_driver, and m_lastDriver.

Referenced by SCH_EDIT_FRAME::RecalculateConnections().

◆ Clone()

void SCH_CONNECTION::Clone ( const SCH_CONNECTION aOther)

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

Parameters
aOtheris the connection to clone

Definition at line 230 of file sch_connection.cpp.

231 {
232  m_graph = aOther.m_graph;
233  // Note: m_lastDriver is not cloned as it needs to be the last driver of *this* connection
234  m_driver = aOther.Driver();
235  m_sheet = aOther.Sheet();
236  // Note: m_local_sheet is not cloned
237  m_name = aOther.m_name;
238  // Note: m_local_name is not cloned if not set yet
239  if( m_local_name.IsEmpty() )
240  {
241  m_local_name = aOther.LocalName();
242  m_local_prefix = aOther.Prefix();
243  }
244 
245  m_prefix = aOther.Prefix();
246  // m_bus_prefix is not cloned; only used for local names
247  m_suffix = aOther.Suffix();
248  m_net_code = aOther.NetCode();
249  m_bus_code = aOther.BusCode();
250  m_vector_start = aOther.VectorStart();
251  m_vector_end = aOther.VectorEnd();
252  // Note: m_vector_index is not cloned
253  m_vector_prefix = aOther.VectorPrefix();
254 
255  // Note: subgraph code isn't cloned, it should remain with the original object
256 
257  // Handle vector bus members: make sure local names are preserved where possible
258  const std::vector<std::shared_ptr<SCH_CONNECTION>>& otherMembers = aOther.Members();
259 
260  if( m_type == CONNECTION_TYPE::BUS && aOther.Type() == CONNECTION_TYPE::BUS )
261  {
262  if( m_members.empty() )
263  {
264  m_members = otherMembers;
265  }
266  else
267  {
268  size_t cloneLimit = std::min( m_members.size(), otherMembers.size() );
269 
270  for( size_t i = 0; i < cloneLimit; ++i )
271  m_members[i]->Clone( *otherMembers[i] );
272  }
273  }
275  {
276  if( m_members.empty() )
277  {
278  m_members = otherMembers;
279  }
280  else
281  {
282  // TODO: refactor this once we support deep nesting
283  for( size_t i = 0; i < m_members.size(); ++i )
284  {
285  auto it = std::find_if( otherMembers.begin(), otherMembers.end(),
286  [&]( const std::shared_ptr<SCH_CONNECTION>& aTest )
287  {
288  return aTest->LocalName() == m_members[i]->LocalName();
289  } );
290 
291  if( it != otherMembers.end() )
292  m_members[i]->Clone( **it );
293  }
294  }
295  }
296 
297  m_type = aOther.Type();
298 
299  recacheName();
300 }
wxString Prefix() const
void Clone(const SCH_CONNECTION &aOther)
Copies connectivity information (but not parent) from another connection.
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.
This item represents a bus group.
wxString LocalName() const
int BusCode() const
CONNECTION_TYPE m_type
int NetCode() const
wxString Suffix() const
long VectorEnd() const
wxString m_local_prefix
Local prefix for group bus members (used with m_local_name)
SCH_ITEM * Driver() const
wxString m_prefix
Prefix if connection is member of a labeled bus group (or "" if not)
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)
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...
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
This item represents a bus vector.

References BUS, BUS_GROUP, BusCode(), Driver(), LocalName(), m_bus_code, m_driver, m_graph, m_local_name, m_local_prefix, 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 130 of file sch_connection.cpp.

131 {
132  m_members.clear();
133 
134  m_name = aLabel;
135  m_local_name = aLabel;
137 
138  wxString prefix;
139  std::vector<wxString> members;
140 
141  wxString unescaped = UnescapeString( aLabel );
142 
143  if( NET_SETTINGS::ParseBusVector( unescaped, &prefix, &members ) )
144  {
146  m_vector_prefix = prefix;
147 
148  long i = 0;
149 
150  for( const wxString& vector_member : members )
151  {
152  auto member = std::make_shared<SCH_CONNECTION>( m_parent, m_sheet );
153  member->m_type = CONNECTION_TYPE::NET;
154  member->m_prefix = m_prefix;
155  member->m_local_name = vector_member;
156  member->m_local_prefix = m_prefix;
157  member->m_vector_index = i++;
158  member->SetName( vector_member );
159  member->SetGraph( m_graph );
160  m_members.push_back( member );
161  }
162  }
163  else if( NET_SETTINGS::ParseBusGroup( unescaped, &prefix, &members ) )
164  {
166  m_bus_prefix = prefix;
167 
168  // Named bus groups generate a net prefix, unnamed ones don't
169  if( !prefix.IsEmpty() )
170  prefix += wxT( "." );
171 
172  for( const wxString& group_member : members )
173  {
174  // Handle alias inside bus group member list
175  if( auto alias = m_graph->GetBusAlias( group_member ) )
176  {
177  for( const wxString& alias_member : alias->Members() )
178  {
179  auto member = std::make_shared< SCH_CONNECTION >( m_parent, m_sheet );
180  member->SetPrefix( prefix );
181  member->SetGraph( m_graph );
182  member->ConfigureFromLabel( alias_member );
183  m_members.push_back( member );
184  }
185  }
186  else
187  {
188  auto member = std::make_shared< SCH_CONNECTION >( m_parent, m_sheet );
189  member->SetPrefix( prefix );
190  member->SetGraph( m_graph );
191  member->ConfigureFromLabel( group_member );
192  m_members.push_back( member );
193  }
194  }
195  }
196  else
197  {
199  }
200 
201  recacheName();
202 }
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.
wxString m_bus_prefix
Optional prefix of a bux group (always empty for nets and vector buses)
static bool ParseBusGroup(const wxString &aGroup, wxString *name, std::vector< wxString > *aMemberList)
Parse a bus group label into the name and a list of components.
CONNECTION_TYPE m_type
wxString m_local_prefix
Local prefix for group bus members (used with m_local_name)
wxString m_prefix
Prefix if connection is member of a labeled bus group (or "" if not)
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 UnescapeString(const wxString &aSource)
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...
static bool ParseBusVector(const wxString &aBus, wxString *aName, std::vector< wxString > *aMemberList)
Parse a bus vector (e.g.
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_bus_prefix, m_graph, m_local_name, m_local_prefix, m_members, m_name, m_parent, m_prefix, m_sheet, m_type, m_vector_prefix, NET, NET_SETTINGS::ParseBusGroup(), NET_SETTINGS::ParseBusVector(), recacheName(), and UnescapeString().

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

◆ Driver()

SCH_ITEM* SCH_CONNECTION::Driver ( ) const
inline

Definition at line 106 of file sch_connection.h.

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

References m_driver.

Referenced by AppendInfoToMsgPanel(), SCH_EDITOR_CONTROL::AssignNetclass(), Clone(), and SCH_EDITOR_CONTROL::UpdateNetHighlighting().

◆ FullLocalName()

wxString SCH_CONNECTION::FullLocalName ( ) const
inline

Definition at line 146 of file sch_connection.h.

147  {
149  }
wxString m_local_prefix
Local prefix for group bus members (used with m_local_name)
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_local_prefix, and m_suffix.

Referenced by IsSubsetOf().

◆ GetLastDriver()

void* SCH_CONNECTION::GetLastDriver ( ) const
inline

Definition at line 140 of file sch_connection.h.

140 { return m_lastDriver; }
void * m_lastDriver
WEAK POINTER (there is no guarantee it is still allocated) Equality comparisons are OK,...

References m_lastDriver.

◆ HasDriverChanged()

bool SCH_CONNECTION::HasDriverChanged ( ) const

Definition at line 331 of file sch_connection.cpp.

332 {
333  return m_driver != m_lastDriver;
334 }
SCH_ITEM * m_driver
The SCH_ITEM that drives this connection's net.
void * m_lastDriver
WEAK POINTER (there is no guarantee it is still allocated) Equality comparisons are OK,...

References m_driver, and m_lastDriver.

Referenced by SCH_EDIT_FRAME::RecalculateConnections().

◆ 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 463 of file sch_connection.cpp.

464 {
465  const wxString& unescaped = UnescapeString( aLabel );
466 
467  return NET_SETTINGS::ParseBusVector( unescaped, nullptr, nullptr )
468  || NET_SETTINGS::ParseBusGroup( unescaped, nullptr, nullptr );
469 }
static bool ParseBusGroup(const wxString &aGroup, wxString *name, std::vector< wxString > *aMemberList)
Parse a bus group label into the name and a list of components.
wxString UnescapeString(const wxString &aSource)
static bool ParseBusVector(const wxString &aBus, wxString *aName, std::vector< wxString > *aMemberList)
Parse a bus vector (e.g.

References NET_SETTINGS::ParseBusGroup(), NET_SETTINGS::ParseBusVector(), and UnescapeString().

Referenced by SCH_BUS_WIRE_ENTRY::ConnectionPropagatesTo().

◆ IsDirty()

bool SCH_CONNECTION::IsDirty ( ) const
inline

Definition at line 134 of file sch_connection.h.

134 { return m_dirty; }

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 symbol pins.

Returns
true if the attached items is a driver

Definition at line 303 of file sch_connection.cpp.

304 {
305  wxASSERT( Parent() );
306 
307  switch( Parent()->Type() )
308  {
309  case SCH_LABEL_T:
310  case SCH_GLOBAL_LABEL_T:
311  case SCH_HIER_LABEL_T:
312  case SCH_SHEET_PIN_T:
313  case SCH_SHEET_T:
314  case LIB_PIN_T:
315  return true;
316 
317  case SCH_PIN_T:
318  {
319  auto pin = static_cast<SCH_PIN*>( Parent() );
320 
321  // Only annotated symbols should drive nets.
322  return pin->IsPowerConnection() || pin->GetParentSymbol()->IsAnnotated( &m_sheet );
323  }
324 
325  default:
326  return false;
327  }
328 }
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(), pin, 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 571 of file sch_connection.cpp.

572 {
573  if( !aOther->IsBus() )
574  return false;
575 
576  auto me = Name( true );
577 
578  for( const auto& m : aOther->Members() )
579  if( m->Name( true ) == me )
580  return true;
581 
582  return false;
583 }
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 556 of file sch_connection.cpp.

557 {
558  if( !aOther->IsBus() )
559  return false;
560 
561  for( const auto& member : aOther->Members() )
562  {
563  if( member->FullLocalName() == FullLocalName() )
564  return true;
565  }
566 
567  return false;
568 }
wxString FullLocalName() const
std::vector< std::shared_ptr< SCH_CONNECTION > > & Members()
bool IsBus() const

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

Referenced by CONNECTION_SUBGRAPH::ResolveDrivers().

◆ IsUnconnected()

bool SCH_CONNECTION::IsUnconnected ( ) const
inline

Definition at line 132 of file sch_connection.h.

132 { return ( m_type == CONNECTION_TYPE::NONE ); }
CONNECTION_TYPE m_type
No connection to this item.

References m_type, and NONE.

Referenced by EE_SELECTION_TOOL::Main().

◆ LocalName()

wxString SCH_CONNECTION::LocalName ( ) const
inline

Definition at line 144 of file sch_connection.h.

144 { 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 Clone(), CONNECTION_GRAPH::matchBusMember(), and CONNECTION_GRAPH::propagateToNeighbors().

◆ LocalSheet()

SCH_SHEET_PATH SCH_CONNECTION::LocalSheet ( ) const
inline

Definition at line 112 of file sch_connection.h.

112 { return m_local_sheet; }
SCH_SHEET_PATH m_local_sheet
When a connection is overridden by one on a different hierarchical sheet, it will be cloned and m_she...

References m_local_sheet.

Referenced by SCH_EDIT_FRAME::RecalculateConnections().

◆ 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 194 of file sch_connection.h.

195  {
196  return m_members;
197  }
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 472 of file sch_connection.cpp.

473 {
474  // Weak heuristic for performance reasons. Stronger test will be used for connectivity
475  wxString label = UnescapeString( aLabel );
476 
477  return label.Contains( wxT( "[" ) ) || label.Contains( wxT( "{" ) );
478 }
wxString UnescapeString(const wxString &aSource)

References UnescapeString().

◆ Name()

◆ NetCode()

int SCH_CONNECTION::NetCode ( ) const
inline

Definition at line 173 of file sch_connection.h.

173 { return m_net_code; }

References m_net_code.

Referenced by Clone().

◆ operator!=()

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

Definition at line 124 of file sch_connection.cpp.

125 {
126  return !( aOther == *this );
127 }

◆ 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 86 of file sch_connection.cpp.

87 {
88  // NOTE: Not comparing m_dirty or net/bus/subgraph codes
89  if( ( aOther.m_driver == m_driver ) &&
90  ( aOther.m_type == m_type ) &&
91  ( aOther.m_name == m_name ) &&
92  ( aOther.m_sheet == m_sheet ) )
93  {
94  return true;
95  }
96 
97  return false;
98 }
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.

104 { return m_parent; }
SCH_ITEM * m_parent
The SCH_ITEM this connection is owned by.

References m_parent.

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

◆ Prefix()

wxString SCH_CONNECTION::Prefix ( ) const
inline

Definition at line 157 of file sch_connection.h.

157 { return m_prefix; }
wxString m_prefix
Prefix if connection is member of a labeled bus group (or "" if not)

References m_prefix.

Referenced by Clone().

◆ PrintBusForUI()

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

Definition at line 499 of file sch_connection.cpp.

500 {
501  size_t groupLen = aGroup.length();
502  size_t i = 0;
503  wxString ret;
504  int braceNesting = 0;
505 
506  // Parse prefix
507  //
508  for( ; i < groupLen; ++i )
509  {
510  if( isSuperSubOverbar( aGroup[i] ) && i + 1 < groupLen && aGroup[i+1] == '{' )
511  {
512  braceNesting++;
513  i++;
514  continue;
515  }
516  else if( aGroup[i] == '}' )
517  {
518  braceNesting--;
519  continue;
520  }
521 
522  ret += aGroup[i];
523 
524  if( aGroup[i] == '{' )
525  break;
526  }
527 
528  // Parse members
529  //
530  i++; // '{' character
531 
532  for( ; i < groupLen; ++i )
533  {
534  if( isSuperSubOverbar( aGroup[i] ) && i + 1 < groupLen && aGroup[i+1] == '{' )
535  {
536  braceNesting++;
537  i++;
538  continue;
539  }
540  else if( aGroup[i] == '}' )
541  {
542  braceNesting--;
543  continue;
544  }
545 
546  ret += aGroup[i];
547 
548  if( aGroup[i] == '}' )
549  break;
550  }
551 
552  return ret;
553 }
static bool isSuperSubOverbar(wxChar c)

References isSuperSubOverbar().

Referenced by BUS_UNFOLD_MENU::update().

◆ recacheName()

void SCH_CONNECTION::recacheName ( )
private

Definition at line 351 of file sch_connection.cpp.

352 {
353  m_cached_name = m_name.IsEmpty() ? wxT( "<NO NET>" ) : m_prefix + m_name + m_suffix;
354 
355  bool prepend_path = true;
356 
357  if( !Parent() || m_type == CONNECTION_TYPE::NONE )
358  prepend_path = false;
359 
360  if( m_driver )
361  {
362  switch( m_driver->Type() )
363  {
364  case SCH_GLOBAL_LABEL_T:
365  case SCH_PIN_T:
366  // Pins are either power connections or belong to a uniquely-annotated
367  // symbol, so they don't need a path if they are driving the subgraph.
368  prepend_path = false;
369  break;
370 
371  default:
372  break;
373  }
374  }
375 
378 }
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 PathHumanReadable(bool aUseShortRootName=true) const
Return the sheet path in a human readable form made from the sheet names.
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_prefix
Prefix if connection is member of a labeled bus group (or "" if not)
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
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:112

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 205 of file sch_connection.cpp.

206 {
208  m_name.Empty();
209  m_local_name.Empty();
210  m_local_prefix.Empty();
211  m_cached_name.Empty();
212  m_cached_name_with_path.Empty();
213  m_prefix.Empty();
214  m_bus_prefix.Empty();
215  m_suffix .Empty();
217  m_driver = nullptr;
218  m_members.clear();
219  m_dirty = true;
220  m_net_code = 0;
221  m_bus_code = 0;
222  m_subgraph_code = 0;
223  m_vector_start = 0;
224  m_vector_end = 0;
225  m_vector_index = 0;
226  m_vector_prefix.Empty();
227 }
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_bus_prefix
Optional prefix of a bux group (always empty for nets and vector buses)
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_local_prefix
Local prefix for group bus members (used with m_local_name)
wxString m_prefix
Prefix if connection is member of a labeled bus group (or "" if not)
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
void * m_lastDriver
WEAK POINTER (there is no guarantee it is still allocated) Equality comparisons are OK,...

References m_bus_code, m_bus_prefix, m_cached_name, m_cached_name_with_path, m_dirty, m_driver, m_lastDriver, m_local_name, m_local_prefix, 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 177 of file sch_connection.h.

177 { m_bus_code = aCode; }

References m_bus_code.

Referenced by CONNECTION_GRAPH::processSubGraphs().

◆ SetDirty()

void SCH_CONNECTION::SetDirty ( )
inline

Definition at line 135 of file sch_connection.h.

135 { m_dirty = true; }

References m_dirty.

◆ SetDriver()

void SCH_CONNECTION::SetDriver ( SCH_ITEM aItem)

Definition at line 101 of file sch_connection.cpp.

102 {
103  m_driver = aItem;
104 
105  recacheName();
106 
107  for( const std::shared_ptr<SCH_CONNECTION>& member : m_members )
108  member->SetDriver( aItem );
109 }
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_SUBGRAPH::ResolveDrivers().

◆ 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 SCH_ITEM::InitializeConnection().

◆ SetName()

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

Definition at line 151 of file sch_connection.h.

152  {
153  m_name = aName;
154  recacheName();
155  }
wxString m_name
Name of the connection.

References m_name, and recacheName().

Referenced by CONNECTION_GRAPH::generateInvisiblePinSubGraphs().

◆ SetNetCode()

void SCH_CONNECTION::SetNetCode ( int  aCode)
inline

◆ SetPrefix()

void SCH_CONNECTION::SetPrefix ( const wxString &  aPrefix)

Definition at line 381 of file sch_connection.cpp.

382 {
383  m_prefix = aPrefix;
384 
385  recacheName();
386 
387  for( const auto& m : Members() )
388  m->SetPrefix( aPrefix );
389 }
wxString m_prefix
Prefix if connection is member of a labeled bus group (or "" if not)
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 112 of file sch_connection.cpp.

113 {
114  m_sheet = aSheet;
115  m_local_sheet = aSheet;
116 
117  recacheName();
118 
119  for( const std::shared_ptr<SCH_CONNECTION>& member : m_members )
120  member->SetSheet( aSheet );
121 }
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.
SCH_SHEET_PATH m_local_sheet
When a connection is overridden by one on a different hierarchical sheet, it will be cloned and m_she...

References m_local_sheet, m_members, m_sheet, and recacheName().

Referenced by SCH_ITEM::InitializeConnection().

◆ SetSubgraphCode()

void SCH_CONNECTION::SetSubgraphCode ( int  aCode)
inline

Definition at line 180 of file sch_connection.h.

180 { m_subgraph_code = aCode; }
int m_subgraph_code
Groups directly-connected items.

References m_subgraph_code.

Referenced by CONNECTION_SUBGRAPH::Absorb(), CONNECTION_GRAPH::buildItemSubGraphs(), and CONNECTION_GRAPH::generateInvisiblePinSubGraphs().

◆ SetSuffix()

void SCH_CONNECTION::SetSuffix ( const wxString &  aSuffix)

Definition at line 392 of file sch_connection.cpp.

393 {
394  m_suffix = aSuffix;
395 
396  recacheName();
397 
398  for( const auto& m : Members() )
399  m->SetSuffix( aSuffix );
400 }
wxString m_suffix
Name suffix (used only for disambiguation)
std::vector< std::shared_ptr< SCH_CONNECTION > > & Members()

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

◆ SetType()

void SCH_CONNECTION::SetType ( CONNECTION_TYPE  aType)
inline

Definition at line 167 of file sch_connection.h.

168  {
169  m_type = aType;
170  recacheName();
171  }
CONNECTION_TYPE m_type

References m_type, and recacheName().

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

◆ Sheet()

SCH_SHEET_PATH SCH_CONNECTION::Sheet ( ) const
inline

Definition at line 109 of file sch_connection.h.

109 { return m_sheet; }
SCH_SHEET_PATH m_sheet
The hierarchical sheet this connection is on.

References m_sheet.

Referenced by Clone(), and BACK_ANNOTATE::processNetNameChange().

◆ SubgraphCode()

int SCH_CONNECTION::SubgraphCode ( ) const
inline

Definition at line 179 of file sch_connection.h.

179 { return m_subgraph_code; }
int m_subgraph_code
Groups directly-connected items.

References m_subgraph_code.

Referenced by CONNECTION_GRAPH::buildItemSubGraphs(), and CONNECTION_GRAPH::generateInvisiblePinSubGraphs().

◆ Suffix()

wxString SCH_CONNECTION::Suffix ( ) const
inline

Definition at line 162 of file sch_connection.h.

162 { return m_suffix; }
wxString m_suffix
Name suffix (used only for disambiguation)

References m_suffix.

Referenced by Clone().

◆ Type()

CONNECTION_TYPE SCH_CONNECTION::Type ( ) const
inline

◆ VectorEnd()

long SCH_CONNECTION::VectorEnd ( ) const
inline

Definition at line 183 of file sch_connection.h.

183 { return m_vector_end; }
long m_vector_end
Lowest member of a vector bus.

References m_vector_end.

Referenced by Clone().

◆ VectorIndex()

long SCH_CONNECTION::VectorIndex ( ) const
inline

Definition at line 185 of file sch_connection.h.

185 { return m_vector_index; }
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 187 of file sch_connection.h.

187 { return m_vector_prefix; }
wxString m_vector_prefix

References m_vector_prefix.

Referenced by Clone().

◆ VectorStart()

long SCH_CONNECTION::VectorStart ( ) const
inline

Definition at line 182 of file sch_connection.h.

182 { return m_vector_start; }
long m_vector_start
Highest member of a vector bus.

References m_vector_start.

Referenced by Clone().

Member Data Documentation

◆ m_bus_code

int SCH_CONNECTION::m_bus_code
private

Definition at line 290 of file sch_connection.h.

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

◆ m_bus_prefix

wxString SCH_CONNECTION::m_bus_prefix
private

Optional prefix of a bux group (always empty for nets and vector buses)

Definition at line 284 of file sch_connection.h.

Referenced by BusPrefix(), ConfigureFromLabel(), and Reset().

◆ m_cached_name

wxString SCH_CONNECTION::m_cached_name
private

Full name, including prefix and suffix.

Definition at line 264 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 266 of file sch_connection.h.

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

◆ m_dirty

bool SCH_CONNECTION::m_dirty
private

Definition at line 241 of file sch_connection.h.

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

◆ m_driver

SCH_ITEM* SCH_CONNECTION::m_driver
private

◆ 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 315 of file sch_connection.h.

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

◆ m_lastDriver

void* SCH_CONNECTION::m_lastDriver
private

WEAK POINTER (there is no guarantee it is still allocated) Equality comparisons are OK, but that's pretty much it.

Definition at line 255 of file sch_connection.h.

Referenced by ClearDriverChanged(), GetLastDriver(), HasDriverChanged(), and Reset().

◆ 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.

Definition at line 275 of file sch_connection.h.

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

◆ m_local_prefix

wxString SCH_CONNECTION::m_local_prefix
private

Local prefix for group bus members (used with m_local_name)

Definition at line 281 of file sch_connection.h.

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

◆ m_local_sheet

SCH_SHEET_PATH SCH_CONNECTION::m_local_sheet
private

When a connection is overridden by one on a different hierarchical sheet, it will be cloned and m_sheet will point to the parent sheet.

This member stores the original sheet so that it can be used for applications such as net highlighting to retrieve the sheet of the parent item from the highlighted connection.

Definition at line 251 of file sch_connection.h.

Referenced by LocalSheet(), and SetSheet().

◆ 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 309 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 262 of file sch_connection.h.

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

◆ m_net_code

int SCH_CONNECTION::m_net_code
private

Definition at line 288 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 253 of file sch_connection.h.

Referenced by ConfigureFromLabel(), and Parent().

◆ m_prefix

wxString SCH_CONNECTION::m_prefix
private

Prefix if connection is member of a labeled bus group (or "" if not)

Definition at line 278 of file sch_connection.h.

Referenced by Clone(), ConfigureFromLabel(), Prefix(), recacheName(), Reset(), and SetPrefix().

◆ m_sheet

SCH_SHEET_PATH SCH_CONNECTION::m_sheet
private

The hierarchical sheet this connection is on.

Definition at line 243 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 292 of file sch_connection.h.

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

◆ m_suffix

wxString SCH_CONNECTION::m_suffix
private

Name suffix (used only for disambiguation)

Definition at line 286 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 298 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 294 of file sch_connection.h.

Referenced by Reset(), and VectorIndex().

◆ m_vector_prefix

wxString SCH_CONNECTION::m_vector_prefix
private

Definition at line 301 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 296 of file sch_connection.h.

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


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