KiCad PCB EDA Suite
netlist_object.cpp File Reference

Class NETLIST_OBJECT to handle 1 item connected (in netlist and erc calculations) More...

#include <fctsys.h>
#include <macros.h>
#include <sch_edit_frame.h>
#include <sch_component.h>
#include <netlist_object.h>
#include <wx/regex.h>

Go to the source code of this file.

Functions

static wxRegEx busLabelRe (wxT("^([^[:space:]]+)(\\[[\\d]+\\.+[\\d]+\\])$"), wxRE_ADVANCED)
 The regular expression string for label bus notation. More...
 
bool IsBusLabel (const wxString &aLabel)
 Function IsBusLabel test if aLabel has a bus notation. More...
 

Detailed Description

Class NETLIST_OBJECT to handle 1 item connected (in netlist and erc calculations)

Definition in file netlist_object.cpp.

Function Documentation

static wxRegEx busLabelRe ( wxT("^([^[:space:]]+)(\\[[\\d]+\\.+[\\d]+\\])$")  ,
wxRE_ADVANCED   
)
static

The regular expression string for label bus notation.

Valid bus labels are defined as one or more non-whitespace characters from the beginning of the string followed by the bus notation [nn...mm] with no characters after the closing bracket.

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

bool IsBusLabel ( const wxString &  aLabel)

Function IsBusLabel 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 49 of file netlist_object.cpp.

References busLabelRe(), NETLIST_OBJECT::GetNet(), NETLIST_OBJECT::m_Comp, NETLIST_OBJECT::m_End, NETLIST_OBJECT::m_Label, NETLIST_OBJECT::m_SheetPath, NETLIST_OBJECT::m_Start, NETLIST_OBJECT::m_Type, NET_BUS, NET_BUSLABELMEMBER, NET_GLOBBUSLABELMEMBER, NET_GLOBLABEL, NET_HIERBUSLABELMEMBER, NET_HIERLABEL, NET_JUNCTION, NET_LABEL, NET_NOCONNECT, NET_PIN, NET_PINLABEL, NET_SEGMENT, NET_SHEETBUSLABELMEMBER, NET_SHEETLABEL, SCH_SHEET_PATH::PathHumanReadable(), and TO_UTF8.

Referenced by NETLIST_OBJECT::ConvertBusToNetListItems(), SCH_TEXT::GetNetListItem(), SCH_SHEET::GetNetListItem(), SCH_SCREEN::IsTerminalPoint(), and NETLIST_OBJECT_LIST::sortItemsBySheet().

50 {
51  wxCHECK_MSG( busLabelRe.IsValid(), false,
52  wxT( "Invalid regular expression in IsBusLabel()." ) );
53 
54  return busLabelRe.Matches( aLabel );
55 }
static wxRegEx busLabelRe(wxT("^([^[:space:]]+)(\\[[\\d]+\\.+[\\d]+\\])$"), wxRE_ADVANCED)
The regular expression string for label bus notation.