KiCad PCB EDA Suite
NETCLASS Class Reference

NETCLASS handles a collection of nets and the parameters used to route or test these nets. More...

#include <netclass.h>

Public Types

typedef STRINGSET::iterator iterator
 
typedef STRINGSET::const_iterator const_iterator
 

Public Member Functions

 NETCLASS (const wxString &aName)
 Constructor stuffs a NETCLASS instance with aParent, aName, and optionally the initialParameters. More...
 
 ~NETCLASS ()
 
wxString GetClass () const
 
const wxString & GetName () const
 
void SetName (const wxString &aName)
 
unsigned GetCount () const
 Function GetCount returns the number of nets in this NETCLASS, i.e. More...
 
void Clear ()
 Function Clear empties the collection of members. More...
 
void Add (const wxString &aNetname)
 Function Add adds aNetname to this NETCLASS if it is not already in this NETCLASS. More...
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
void Remove (iterator aName)
 Function Remove will remove NET name aName from the collection of members. More...
 
void Remove (const wxString &aName)
 Function Remove will remove NET name aName from the collection of members. More...
 
STRINGSET & NetNames ()
 for SWIG More...
 
const wxString & GetDescription () const
 
void SetDescription (const wxString &aDesc)
 
int GetClearance (wxString *aSource=nullptr) const
 
void SetClearance (int aClearance)
 
int GetTrackWidth () const
 
void SetTrackWidth (int aWidth)
 
int GetViaDiameter () const
 
void SetViaDiameter (int aDia)
 
int GetViaDrill () const
 
void SetViaDrill (int aSize)
 
int GetuViaDiameter () const
 
void SetuViaDiameter (int aSize)
 
int GetuViaDrill () const
 
void SetuViaDrill (int aSize)
 
int GetDiffPairWidth () const
 
void SetDiffPairWidth (int aSize)
 
int GetDiffPairGap () const
 
void SetDiffPairGap (int aSize)
 
int GetDiffPairViaGap () const
 
void SetDiffPairViaGap (int aSize)
 
COLOR4D GetPcbColor () const
 
void SetPcbColor (const COLOR4D &aColor)
 
int GetWireWidth () const
 
void SetWireWidth (int aWidth)
 
int GetBusWidth () const
 
void SetBusWidth (int aWidth)
 
COLOR4D GetSchematicColor () const
 
void SetSchematicColor (COLOR4D aColor)
 
int GetLineStyle () const
 
void SetLineStyle (int aStyle)
 

Static Public Attributes

static const char Default [] = "Default"
 the name of the default NETCLASS More...
 

Protected Attributes

wxString m_Name
 Name of the net class. More...
 
wxString m_Description
 what this NETCLASS is for. More...
 
STRINGSET m_Members
 names of NET members of this class More...
 
int m_Clearance
 The units on these parameters is Internal Units (1 nm) More...
 
int m_TrackWidth
 track width used to route NETs in this NETCLASS More...
 
int m_ViaDia
 via diameter More...
 
int m_ViaDrill
 via drill hole diameter More...
 
int m_uViaDia
 microvia diameter More...
 
int m_uViaDrill
 microvia drill hole diameter More...
 
int m_diffPairWidth
 
int m_diffPairGap
 
int m_diffPairViaGap
 
int m_wireWidth
 
int m_busWidth
 
COLOR4D m_schematicColor
 
int m_lineStyle
 
COLOR4D m_PcbColor
 Optional color override for this netclass (PCB context) More...
 

Detailed Description

NETCLASS handles a collection of nets and the parameters used to route or test these nets.

Definition at line 49 of file netclass.h.

Member Typedef Documentation

◆ const_iterator

typedef STRINGSET::const_iterator NETCLASS::const_iterator

Definition at line 131 of file netclass.h.

◆ iterator

typedef STRINGSET::iterator NETCLASS::iterator

Definition at line 127 of file netclass.h.

Constructor & Destructor Documentation

◆ NETCLASS()

NETCLASS::NETCLASS ( const wxString &  aName)

Constructor stuffs a NETCLASS instance with aParent, aName, and optionally the initialParameters.

Parameters
aName= the name of this new netclass

Definition at line 50 of file netclass.cpp.

50  :
51  m_Name( aName ),
53 {
54  // Default settings
58  // These defaults will be overwritten by SetParams,
59  // from the board design parameters, later
66 
69  SetSchematicColor( COLOR4D::UNSPECIFIED );
71 }
const int DEFAULT_WIRE_WIDTH
Definition: netclass.cpp:44
void SetDiffPairWidth(int aSize)
Definition: netclass.h:184
const int DEFAULT_LINE_STYLE
Definition: netclass.cpp:47
const int DEFAULT_VIA_DIAMETER
Definition: netclass.cpp:35
void SetLineStyle(int aStyle)
Definition: netclass.h:205
COLOR4D m_PcbColor
Optional color override for this netclass (PCB context)
Definition: netclass.h:77
void SetTrackWidth(int aWidth)
Definition: netclass.h:169
void SetWireWidth(int aWidth)
Definition: netclass.h:196
void SetViaDrill(int aSize)
Definition: netclass.h:175
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
Definition: color4d.h:372
void SetDiffPairGap(int aSize)
Definition: netclass.h:187
void SetClearance(int aClearance)
Definition: netclass.h:166
const int DEFAULT_UVIA_DIAMETER
Definition: netclass.cpp:37
const int DEFAULT_CLEARANCE
Definition: netclass.cpp:34
const int DEFAULT_DIFF_PAIR_VIAGAP
Definition: netclass.cpp:42
void SetSchematicColor(COLOR4D aColor)
Definition: netclass.h:202
const int DEFAULT_DIFF_PAIR_GAP
Definition: netclass.cpp:41
void SetuViaDiameter(int aSize)
Definition: netclass.h:178
void SetBusWidth(int aWidth)
Definition: netclass.h:199
void SetDiffPairViaGap(int aSize)
Definition: netclass.h:190
const int DEFAULT_VIA_DRILL
Definition: netclass.cpp:36
void SetuViaDrill(int aSize)
Definition: netclass.h:181
const int DEFAULT_DIFF_PAIR_WIDTH
Definition: netclass.cpp:40
const int DEFAULT_TRACK_WIDTH
Definition: netclass.cpp:39
wxString m_Name
Name of the net class.
Definition: netclass.h:52
const int DEFAULT_BUS_WIDTH
Definition: netclass.cpp:45
void SetViaDiameter(int aDia)
Definition: netclass.h:172
const int DEFAULT_UVIA_DRILL
Definition: netclass.cpp:38

References DEFAULT_BUS_WIDTH, DEFAULT_CLEARANCE, DEFAULT_DIFF_PAIR_GAP, DEFAULT_DIFF_PAIR_VIAGAP, DEFAULT_DIFF_PAIR_WIDTH, DEFAULT_LINE_STYLE, DEFAULT_TRACK_WIDTH, DEFAULT_UVIA_DIAMETER, DEFAULT_UVIA_DRILL, DEFAULT_VIA_DIAMETER, DEFAULT_VIA_DRILL, DEFAULT_WIRE_WIDTH, SetBusWidth(), SetClearance(), SetDiffPairGap(), SetDiffPairViaGap(), SetDiffPairWidth(), SetLineStyle(), SetSchematicColor(), SetTrackWidth(), SetuViaDiameter(), SetuViaDrill(), SetViaDiameter(), SetViaDrill(), and SetWireWidth().

◆ ~NETCLASS()

NETCLASS::~NETCLASS ( )

Definition at line 74 of file netclass.cpp.

75 {
76 }

Member Function Documentation

◆ Add()

void NETCLASS::Add ( const wxString &  aNetname)
inline

Function Add adds aNetname to this NETCLASS if it is not already in this NETCLASS.

It is harmless to try and add a second identical name.

Definition at line 122 of file netclass.h.

123  {
124  m_Members.insert( aNetname );
125  }
STRINGSET m_Members
names of NET members of this class
Definition: netclass.h:55

◆ begin() [1/2]

iterator NETCLASS::begin ( )
inline

Definition at line 128 of file netclass.h.

128 { return m_Members.begin(); }
STRINGSET m_Members
names of NET members of this class
Definition: netclass.h:55

Referenced by filterNetClass().

◆ begin() [2/2]

const_iterator NETCLASS::begin ( ) const
inline

Definition at line 132 of file netclass.h.

132 { return m_Members.begin(); }
STRINGSET m_Members
names of NET members of this class
Definition: netclass.h:55

◆ Clear()

void NETCLASS::Clear ( )
inline

Function Clear empties the collection of members.

Definition at line 112 of file netclass.h.

113  {
114  m_Members.clear();
115  }
STRINGSET m_Members
names of NET members of this class
Definition: netclass.h:55

◆ end() [1/2]

iterator NETCLASS::end ( )
inline

Definition at line 129 of file netclass.h.

129 { return m_Members.end(); }
STRINGSET m_Members
names of NET members of this class
Definition: netclass.h:55

Referenced by filterNetClass().

◆ end() [2/2]

const_iterator NETCLASS::end ( ) const
inline

Definition at line 133 of file netclass.h.

133 { return m_Members.end(); }
STRINGSET m_Members
names of NET members of this class
Definition: netclass.h:55

◆ GetBusWidth()

int NETCLASS::GetBusWidth ( ) const
inline

Definition at line 198 of file netclass.h.

198 { return m_busWidth; }
int m_busWidth
Definition: netclass.h:73

◆ GetClass()

wxString NETCLASS::GetClass ( ) const
inline

Definition at line 91 of file netclass.h.

92  {
93  return wxT( "NETCLASS" );
94  }

◆ GetClearance()

int NETCLASS::GetClearance ( wxString *  aSource = nullptr) const
inline

Definition at line 158 of file netclass.h.

159  {
160  if( aSource )
161  *aSource = wxString::Format( _( "'%s' netclass" ), m_Name );
162 
163  return m_Clearance;
164  }
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
#define _(s)
Definition: 3d_actions.cpp:33
wxString m_Name
Name of the net class.
Definition: netclass.h:52
int m_Clearance
The units on these parameters is Internal Units (1 nm)
Definition: netclass.h:59

References _, and Format().

Referenced by GERBER_JOBFILE_WRITER::addJSONDesignRules(), DSN::SPECCTRA_DB::FromBOARD(), BOARD_DESIGN_SETTINGS::GetBiggestClearanceValue(), BOARD_CONNECTED_ITEM::GetClearance(), and BOARD_DESIGN_SETTINGS::GetSmallestClearanceValue().

◆ GetCount()

unsigned NETCLASS::GetCount ( ) const
inline

Function GetCount returns the number of nets in this NETCLASS, i.e.

using these rules.

Definition at line 103 of file netclass.h.

104  {
105  return m_Members.size();
106  }
STRINGSET m_Members
names of NET members of this class
Definition: netclass.h:55

◆ GetDescription()

const wxString& NETCLASS::GetDescription ( ) const
inline

Definition at line 155 of file netclass.h.

155 { return m_Description; }
wxString m_Description
what this NETCLASS is for.
Definition: netclass.h:53

◆ GetDiffPairGap()

int NETCLASS::GetDiffPairGap ( ) const
inline

Definition at line 186 of file netclass.h.

186 { return m_diffPairGap; }
int m_diffPairGap
Definition: netclass.h:69

◆ GetDiffPairViaGap()

int NETCLASS::GetDiffPairViaGap ( ) const
inline

Definition at line 189 of file netclass.h.

189 { return m_diffPairViaGap; }
int m_diffPairViaGap
Definition: netclass.h:70

◆ GetDiffPairWidth()

int NETCLASS::GetDiffPairWidth ( ) const
inline

Definition at line 183 of file netclass.h.

183 { return m_diffPairWidth; }
int m_diffPairWidth
Definition: netclass.h:68

◆ GetLineStyle()

int NETCLASS::GetLineStyle ( ) const
inline

Definition at line 204 of file netclass.h.

204 { return m_lineStyle; }
int m_lineStyle
Definition: netclass.h:75

◆ GetName()

◆ GetPcbColor()

COLOR4D NETCLASS::GetPcbColor ( ) const
inline

Definition at line 192 of file netclass.h.

192 { return m_PcbColor; }
COLOR4D m_PcbColor
Optional color override for this netclass (PCB context)
Definition: netclass.h:77

◆ GetSchematicColor()

COLOR4D NETCLASS::GetSchematicColor ( ) const
inline

Definition at line 201 of file netclass.h.

201 { return m_schematicColor; }
COLOR4D m_schematicColor
Definition: netclass.h:74

◆ GetTrackWidth()

int NETCLASS::GetTrackWidth ( ) const
inline

Definition at line 168 of file netclass.h.

168 { return m_TrackWidth; }
int m_TrackWidth
track width used to route NETs in this NETCLASS
Definition: netclass.h:61

Referenced by DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::buildNetclassesGrid(), DSN::SPECCTRA_DB::FromBOARD(), and DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow().

◆ GetuViaDiameter()

int NETCLASS::GetuViaDiameter ( ) const
inline

Definition at line 177 of file netclass.h.

177 { return m_uViaDia; }
int m_uViaDia
microvia diameter
Definition: netclass.h:65

Referenced by DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::buildNetclassesGrid(), and DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow().

◆ GetuViaDrill()

int NETCLASS::GetuViaDrill ( ) const
inline

Definition at line 180 of file netclass.h.

180 { return m_uViaDrill; }
int m_uViaDrill
microvia drill hole diameter
Definition: netclass.h:66

Referenced by DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::buildNetclassesGrid(), VIA::GetDrillValue(), and DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow().

◆ GetViaDiameter()

int NETCLASS::GetViaDiameter ( ) const
inline

◆ GetViaDrill()

int NETCLASS::GetViaDrill ( ) const
inline

◆ GetWireWidth()

int NETCLASS::GetWireWidth ( ) const
inline

Definition at line 195 of file netclass.h.

195 { return m_wireWidth; }
int m_wireWidth
Definition: netclass.h:72

◆ NetNames()

STRINGSET& NETCLASS::NetNames ( )
inline

for SWIG

Definition at line 153 of file netclass.h.

◆ Remove() [1/2]

void NETCLASS::Remove ( iterator  aName)
inline

Function Remove will remove NET name aName from the collection of members.

Definition at line 139 of file netclass.h.

140  {
141  m_Members.erase( aName );
142  }
STRINGSET m_Members
names of NET members of this class
Definition: netclass.h:55

Referenced by filterNetClass().

◆ Remove() [2/2]

void NETCLASS::Remove ( const wxString &  aName)
inline

Function Remove will remove NET name aName from the collection of members.

Definition at line 148 of file netclass.h.

149  {
150  m_Members.erase( aName );
151  }
STRINGSET m_Members
names of NET members of this class
Definition: netclass.h:55

◆ SetBusWidth()

void NETCLASS::SetBusWidth ( int  aWidth)
inline

Definition at line 199 of file netclass.h.

199 { m_busWidth = aWidth; }
int m_busWidth
Definition: netclass.h:73

Referenced by NETCLASS().

◆ SetClearance()

void NETCLASS::SetClearance ( int  aClearance)
inline

◆ SetDescription()

void NETCLASS::SetDescription ( const wxString &  aDesc)
inline

Definition at line 156 of file netclass.h.

156 { m_Description = aDesc; }
wxString m_Description
what this NETCLASS is for.
Definition: netclass.h:53

Referenced by BOARD::BOARD().

◆ SetDiffPairGap()

void NETCLASS::SetDiffPairGap ( int  aSize)
inline

Definition at line 187 of file netclass.h.

187 { m_diffPairGap = aSize; }
int m_diffPairGap
Definition: netclass.h:69

Referenced by NETCLASS().

◆ SetDiffPairViaGap()

void NETCLASS::SetDiffPairViaGap ( int  aSize)
inline

Definition at line 190 of file netclass.h.

190 { m_diffPairViaGap = aSize; }
int m_diffPairViaGap
Definition: netclass.h:70

Referenced by NETCLASS().

◆ SetDiffPairWidth()

void NETCLASS::SetDiffPairWidth ( int  aSize)
inline

Definition at line 184 of file netclass.h.

184 { m_diffPairWidth = aSize; }
int m_diffPairWidth
Definition: netclass.h:68

Referenced by NETCLASS().

◆ SetLineStyle()

void NETCLASS::SetLineStyle ( int  aStyle)
inline

Definition at line 205 of file netclass.h.

205 { m_lineStyle = aStyle; }
int m_lineStyle
Definition: netclass.h:75

Referenced by NETCLASS().

◆ SetName()

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

Definition at line 97 of file netclass.h.

97 { m_Name = aName; }
wxString m_Name
Name of the net class.
Definition: netclass.h:52

◆ SetPcbColor()

void NETCLASS::SetPcbColor ( const COLOR4D aColor)
inline

Definition at line 193 of file netclass.h.

193 { m_PcbColor = aColor; }
COLOR4D m_PcbColor
Optional color override for this netclass (PCB context)
Definition: netclass.h:77

◆ SetSchematicColor()

void NETCLASS::SetSchematicColor ( COLOR4D  aColor)
inline

Definition at line 202 of file netclass.h.

202 { m_schematicColor = aColor; }
COLOR4D m_schematicColor
Definition: netclass.h:74

Referenced by NETCLASS().

◆ SetTrackWidth()

void NETCLASS::SetTrackWidth ( int  aWidth)
inline

Definition at line 169 of file netclass.h.

169 { m_TrackWidth = aWidth; }
int m_TrackWidth
track width used to route NETs in this NETCLASS
Definition: netclass.h:61

Referenced by LEGACY_PLUGIN::loadSETUP(), and NETCLASS().

◆ SetuViaDiameter()

void NETCLASS::SetuViaDiameter ( int  aSize)
inline

Definition at line 178 of file netclass.h.

178 { m_uViaDia = aSize; }
int m_uViaDia
microvia diameter
Definition: netclass.h:65

Referenced by LEGACY_PLUGIN::loadSETUP(), NETCLASS(), and PCB_PARSER::parseSetup().

◆ SetuViaDrill()

void NETCLASS::SetuViaDrill ( int  aSize)
inline

Definition at line 181 of file netclass.h.

181 { m_uViaDrill = aSize; }
int m_uViaDrill
microvia drill hole diameter
Definition: netclass.h:66

Referenced by LEGACY_PLUGIN::loadSETUP(), NETCLASS(), and PCB_PARSER::parseSetup().

◆ SetViaDiameter()

void NETCLASS::SetViaDiameter ( int  aDia)
inline

Definition at line 172 of file netclass.h.

172 { m_ViaDia = aDia; }
int m_ViaDia
via diameter
Definition: netclass.h:62

Referenced by LEGACY_PLUGIN::loadSETUP(), NETCLASS(), and PCB_PARSER::parseSetup().

◆ SetViaDrill()

void NETCLASS::SetViaDrill ( int  aSize)
inline

Definition at line 175 of file netclass.h.

175 { m_ViaDrill = aSize; }
int m_ViaDrill
via drill hole diameter
Definition: netclass.h:63

Referenced by LEGACY_PLUGIN::loadSETUP(), NETCLASS(), and PCB_PARSER::parseSetup().

◆ SetWireWidth()

void NETCLASS::SetWireWidth ( int  aWidth)
inline

Definition at line 196 of file netclass.h.

196 { m_wireWidth = aWidth; }
int m_wireWidth
Definition: netclass.h:72

Referenced by NETCLASS().

Member Data Documentation

◆ Default

◆ m_busWidth

int NETCLASS::m_busWidth
protected

Definition at line 73 of file netclass.h.

◆ m_Clearance

int NETCLASS::m_Clearance
protected

The units on these parameters is Internal Units (1 nm)

clearance when routing

Definition at line 59 of file netclass.h.

◆ m_Description

wxString NETCLASS::m_Description
protected

what this NETCLASS is for.

Definition at line 53 of file netclass.h.

◆ m_diffPairGap

int NETCLASS::m_diffPairGap
protected

Definition at line 69 of file netclass.h.

◆ m_diffPairViaGap

int NETCLASS::m_diffPairViaGap
protected

Definition at line 70 of file netclass.h.

◆ m_diffPairWidth

int NETCLASS::m_diffPairWidth
protected

Definition at line 68 of file netclass.h.

◆ m_lineStyle

int NETCLASS::m_lineStyle
protected

Definition at line 75 of file netclass.h.

◆ m_Members

STRINGSET NETCLASS::m_Members
protected

names of NET members of this class

Definition at line 55 of file netclass.h.

◆ m_Name

wxString NETCLASS::m_Name
protected

Name of the net class.

Definition at line 52 of file netclass.h.

◆ m_PcbColor

COLOR4D NETCLASS::m_PcbColor
protected

Optional color override for this netclass (PCB context)

Definition at line 77 of file netclass.h.

◆ m_schematicColor

COLOR4D NETCLASS::m_schematicColor
protected

Definition at line 74 of file netclass.h.

◆ m_TrackWidth

int NETCLASS::m_TrackWidth
protected

track width used to route NETs in this NETCLASS

Definition at line 61 of file netclass.h.

◆ m_uViaDia

int NETCLASS::m_uViaDia
protected

microvia diameter

Definition at line 65 of file netclass.h.

◆ m_uViaDrill

int NETCLASS::m_uViaDrill
protected

microvia drill hole diameter

Definition at line 66 of file netclass.h.

◆ m_ViaDia

int NETCLASS::m_ViaDia
protected

via diameter

Definition at line 62 of file netclass.h.

◆ m_ViaDrill

int NETCLASS::m_ViaDrill
protected

via drill hole diameter

Definition at line 63 of file netclass.h.

◆ m_wireWidth

int NETCLASS::m_wireWidth
protected

Definition at line 72 of file netclass.h.


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