KiCad PCB EDA Suite
GBR_NETLIST_METADATA Class Reference

this class handle info which can be added in a gerber file as attribute of an object the GBR_INFO_TYPE types can be OR'ed to add 2 (or more) attributes There are only 3 net attributes defined attached to an object by the TO command TO.P TO.N TO.C the .P attribute can be used only for flashed pads (using the D03 command) and only for external copper layers, if the component is on a external copper layer for other copper layer items (pads on internal layers, tracks ... More...

#include <gbr_netlist_metadata.h>

Public Types

enum  GBR_NETINFO_TYPE { GBR_NETINFO_UNSPECIFIED, GBR_NETINFO_PAD = 1, GBR_NETINFO_NET = 2, GBR_NETINFO_CMP = 4 }
 

Public Member Functions

 GBR_NETLIST_METADATA ()
 
void ClearExtraData ()
 Clear the extra data string printed at end of net attributes. More...
 
void SetExtraData (const wxString &aExtraData)
 Set the extra data string printed at end of net attributes. More...
 
void ClearAttribute (const wxString *aName)
 remove the net attribute specified by aName If aName == NULL or empty, remove all attributes More...
 

Public Attributes

int m_NetAttribType
 the type of net info (used to define the gerber string to create) More...
 
bool m_NotInNet
 true if a pad of a footprint cannot be connected (for instance a mechanical NPTH, ot a not named pad) in this case the pad net name is empty in gerber file More...
 
GBR_DATA_FIELD m_Padname
 for a flashed pad: the pad name ((TO.P attribute) More...
 
GBR_DATA_FIELD m_PadPinFunction
 for a pad: the pin function (defined in schematic) More...
 
wxString m_Cmpref
 the component reference parent of the data More...
 
wxString m_Netname
 for items associated to a net: the netname More...
 
wxString m_ExtraData
 a string to print after TO object attributes, if not empty it is printed "as this" More...
 
bool m_TryKeepPreviousAttributes
 If true, do not clear all attributes when a atribute has changed Usefull when some attributes need to be persistant. More...
 

Detailed Description

this class handle info which can be added in a gerber file as attribute of an object the GBR_INFO_TYPE types can be OR'ed to add 2 (or more) attributes There are only 3 net attributes defined attached to an object by the TO command TO.P TO.N TO.C the .P attribute can be used only for flashed pads (using the D03 command) and only for external copper layers, if the component is on a external copper layer for other copper layer items (pads on internal layers, tracks ...

), only .N and .C can be used

Definition at line 145 of file gbr_netlist_metadata.h.

Member Enumeration Documentation

◆ GBR_NETINFO_TYPE

Enumerator
GBR_NETINFO_UNSPECIFIED 

idle command (no command)

GBR_NETINFO_PAD 

print info associated to a flashed pad (TO.P attribute)

GBR_NETINFO_NET 

print info associated to a net (TO.N attribute)

GBR_NETINFO_CMP 

print info associated to a component (TO.C attribute)

Definition at line 151 of file gbr_netlist_metadata.h.

152  {
154  GBR_NETINFO_PAD = 1,
155  GBR_NETINFO_NET = 2,
156  GBR_NETINFO_CMP = 4
157  };
print info associated to a component (TO.C attribute)
print info associated to a flashed pad (TO.P attribute)
print info associated to a net (TO.N attribute)

Constructor & Destructor Documentation

◆ GBR_NETLIST_METADATA()

GBR_NETLIST_METADATA::GBR_NETLIST_METADATA ( )
inline

Definition at line 180 of file gbr_netlist_metadata.h.

181  m_NotInNet( false ), m_TryKeepPreviousAttributes( false )
182  {
183  }
bool m_TryKeepPreviousAttributes
If true, do not clear all attributes when a atribute has changed Usefull when some attributes need to...
bool m_NotInNet
true if a pad of a footprint cannot be connected (for instance a mechanical NPTH, ot a not named pad)...
int m_NetAttribType
the type of net info (used to define the gerber string to create)

Member Function Documentation

◆ ClearAttribute()

void GBR_NETLIST_METADATA::ClearAttribute ( const wxString *  aName)
inline

remove the net attribute specified by aName If aName == NULL or empty, remove all attributes

Parameters
aNameis the name (.CN, .P .N or .C) of the attribute to remove

Definition at line 204 of file gbr_netlist_metadata.h.

205  {
207  {
208  m_Padname.clear();
210  m_Cmpref.clear();
211  m_Netname.clear();
212  return;
213  }
214 
215  if( !aName || aName->IsEmpty() || *aName == ".CN" )
216  {
218  m_Padname.clear();
220  m_Cmpref.clear();
221  m_Netname.clear();
222  return;
223  }
224 
225  if( *aName == ".C" )
226  {
228  m_Cmpref.clear();
229  return;
230  }
231 
232  if( *aName == ".N" )
233  {
235  m_Netname.clear();
236  return;
237  }
238 
239  if( *aName == ".P" )
240  {
242  m_Padname.clear();
244  return;
245  }
246  }
print info associated to a component (TO.C attribute)
wxString m_Cmpref
the component reference parent of the data
GBR_DATA_FIELD m_PadPinFunction
for a pad: the pin function (defined in schematic)
GBR_DATA_FIELD m_Padname
for a flashed pad: the pad name ((TO.P attribute)
wxString m_Netname
for items associated to a net: the netname
print info associated to a flashed pad (TO.P attribute)
print info associated to a net (TO.N attribute)
int m_NetAttribType
the type of net info (used to define the gerber string to create)

References GBR_DATA_FIELD::clear(), GBR_NETINFO_CMP, GBR_NETINFO_NET, GBR_NETINFO_PAD, GBR_NETINFO_UNSPECIFIED, m_Cmpref, m_NetAttribType, m_Netname, m_Padname, and m_PadPinFunction.

Referenced by GERBER_FILE_IMAGE::RemoveAttribute().

◆ ClearExtraData()

void GBR_NETLIST_METADATA::ClearExtraData ( )
inline

Clear the extra data string printed at end of net attributes.

Definition at line 187 of file gbr_netlist_metadata.h.

188  {
189  m_ExtraData.Clear();
190  }
wxString m_ExtraData
a string to print after TO object attributes, if not empty it is printed "as this"

References m_ExtraData.

Referenced by PLACEFILE_GERBER_WRITER::CreatePlaceFile().

◆ SetExtraData()

void GBR_NETLIST_METADATA::SetExtraData ( const wxString &  aExtraData)
inline

Set the extra data string printed at end of net attributes.

Definition at line 194 of file gbr_netlist_metadata.h.

195  {
196  m_ExtraData = aExtraData;
197  }
wxString m_ExtraData
a string to print after TO object attributes, if not empty it is printed "as this"

References m_ExtraData.

Referenced by PLACEFILE_GERBER_WRITER::CreatePlaceFile().

Member Data Documentation

◆ m_Cmpref

◆ m_ExtraData

wxString GBR_NETLIST_METADATA::m_ExtraData

a string to print after TO object attributes, if not empty it is printed "as this"

Definition at line 170 of file gbr_netlist_metadata.h.

Referenced by ClearExtraData(), GERBER_PLOTTER::formatNetAttribute(), and SetExtraData().

◆ m_NetAttribType

int GBR_NETLIST_METADATA::m_NetAttribType

◆ m_Netname

◆ m_NotInNet

bool GBR_NETLIST_METADATA::m_NotInNet

true if a pad of a footprint cannot be connected (for instance a mechanical NPTH, ot a not named pad) in this case the pad net name is empty in gerber file

Definition at line 162 of file gbr_netlist_metadata.h.

Referenced by FormatNetAttribute(), BRDITEMS_PLOTTER::PlotPad(), and PlotStandardLayer().

◆ m_Padname

GBR_DATA_FIELD GBR_NETLIST_METADATA::m_Padname

for a flashed pad: the pad name ((TO.P attribute)

Definition at line 165 of file gbr_netlist_metadata.h.

Referenced by ClearAttribute(), GERBER_FILE_IMAGE::ExecuteRS274XCommand(), FormatNetAttribute(), GERBER_DRAW_ITEM::GetMsgPanelInfo(), and GBR_METADATA::SetPadName().

◆ m_PadPinFunction

GBR_DATA_FIELD GBR_NETLIST_METADATA::m_PadPinFunction

◆ m_TryKeepPreviousAttributes

bool GBR_NETLIST_METADATA::m_TryKeepPreviousAttributes

If true, do not clear all attributes when a atribute has changed Usefull when some attributes need to be persistant.

If false, attributes will be cleared if only one attribute cleared This is a more secure way to set attributes, when all attribute changess are not safely managed

Definition at line 177 of file gbr_netlist_metadata.h.

Referenced by PLACEFILE_GERBER_WRITER::CreatePlaceFile(), and FormatNetAttribute().


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