KiCad PCB EDA Suite
GBR_APERTURE_METADATA Class Reference

#include <gbr_metadata.h>

Public Types

enum  GBR_APERTURE_ATTRIB {
  GBR_APERTURE_ATTRIB_NONE, GBR_APERTURE_ATTRIB_ETCHEDCMP, GBR_APERTURE_ATTRIB_CONDUCTOR, GBR_APERTURE_ATTRIB_CUTOUT,
  GBR_APERTURE_ATTRIB_NONCONDUCTOR, GBR_APERTURE_ATTRIB_VIAPAD, GBR_APERTURE_ATTRIB_COMPONENTPAD, GBR_APERTURE_ATTRIB_SMDPAD_SMDEF,
  GBR_APERTURE_ATTRIB_SMDPAD_CUDEF, GBR_APERTURE_ATTRIB_BGAPAD_SMDEF, GBR_APERTURE_ATTRIB_BGAPAD_CUDEF, GBR_APERTURE_ATTRIB_CONNECTORPAD,
  GBR_APERTURE_ATTRIB_WASHERPAD, GBR_APERTURE_ATTRIB_HEATSINKPAD, GBR_APERTURE_ATTRIB_VIADRILL, GBR_APERTURE_ATTRIB_COMPONENTDRILL,
  GBR_APERTURE_ATTRIB_SLOTDRILL, GBR_APERTURE_ATTRIB_END
}
 

Public Member Functions

 GBR_APERTURE_METADATA ()
 
std::string GetAttributeName ()
 
std::string FormatAttribute (bool aUseX1StructuredComment)
 

Static Public Member Functions

static std::string GetAttributeName (GBR_APERTURE_ATTRIB aAttribute)
 
static std::string FormatAttribute (GBR_APERTURE_ATTRIB aAttribute, bool aUseX1StructuredComment)
 

Public Attributes

GBR_APERTURE_ATTRIB m_ApertAttribute
 

Detailed Description

Definition at line 77 of file gbr_metadata.h.

Member Enumeration Documentation

◆ GBR_APERTURE_ATTRIB

Enumerator
GBR_APERTURE_ATTRIB_NONE 

uninitialized attribute

GBR_APERTURE_ATTRIB_ETCHEDCMP 

aperture used for etched components

GBR_APERTURE_ATTRIB_CONDUCTOR 

aperture used for connected items like tracks (not vias)

GBR_APERTURE_ATTRIB_CUTOUT 

aperture used for board cutout

GBR_APERTURE_ATTRIB_NONCONDUCTOR 

aperture used for not connected items (texts, outlines on copper)

GBR_APERTURE_ATTRIB_VIAPAD 

aperture used for vias

GBR_APERTURE_ATTRIB_COMPONENTPAD 

aperture used for through hole component on outer layer

GBR_APERTURE_ATTRIB_SMDPAD_SMDEF 

aperture used for SMD pad. Excluded BGA pads which have their own type

GBR_APERTURE_ATTRIB_SMDPAD_CUDEF 

aperture used for SMD pad with a solder mask defined by the solder mask

GBR_APERTURE_ATTRIB_BGAPAD_SMDEF 

aperture used for BGA pads with a solder mask defined by the copper shape

GBR_APERTURE_ATTRIB_BGAPAD_CUDEF 

aperture used for BGA pad with a solder mask defined by the solder mask

GBR_APERTURE_ATTRIB_CONNECTORPAD 

aperture used for edge connecto pad (outer layers)

GBR_APERTURE_ATTRIB_WASHERPAD 

aperture used for mechanical pads (NPTH)

GBR_APERTURE_ATTRIB_HEATSINKPAD 

aperture used for heat sink pad (typically for SMDs)

GBR_APERTURE_ATTRIB_VIADRILL 

aperture used for via holes in drill files

GBR_APERTURE_ATTRIB_COMPONENTDRILL 

aperture used for pad holes in drill files

GBR_APERTURE_ATTRIB_SLOTDRILL 

aperture used for oblong holes in drill files

GBR_APERTURE_ATTRIB_END 

sentinel: max value

Definition at line 80 of file gbr_metadata.h.

81  {
100  };
aperture used for etched components
Definition: gbr_metadata.h:83
aperture used for edge connecto pad (outer layers)
Definition: gbr_metadata.h:93
aperture used for heat sink pad (typically for SMDs)
Definition: gbr_metadata.h:95
aperture used for through hole component on outer layer
Definition: gbr_metadata.h:88
aperture used for via holes in drill files
Definition: gbr_metadata.h:96
aperture used for SMD pad. Excluded BGA pads which have their own type
Definition: gbr_metadata.h:89
aperture used for BGA pad with a solder mask defined by the solder mask
Definition: gbr_metadata.h:92
aperture used for pad holes in drill files
Definition: gbr_metadata.h:97
aperture used for mechanical pads (NPTH)
Definition: gbr_metadata.h:94
aperture used for BGA pads with a solder mask defined by the copper shape
Definition: gbr_metadata.h:91
aperture used for connected items like tracks (not vias)
Definition: gbr_metadata.h:84
aperture used for SMD pad with a solder mask defined by the solder mask
Definition: gbr_metadata.h:90
aperture used for not connected items (texts, outlines on copper)
Definition: gbr_metadata.h:86
aperture used for oblong holes in drill files
Definition: gbr_metadata.h:98

Constructor & Destructor Documentation

◆ GBR_APERTURE_METADATA()

GBR_APERTURE_METADATA::GBR_APERTURE_METADATA ( )
inline

Definition at line 102 of file gbr_metadata.h.

Member Function Documentation

◆ FormatAttribute() [1/2]

std::string GBR_APERTURE_METADATA::FormatAttribute ( GBR_APERTURE_ATTRIB  aAttribute,
bool  aUseX1StructuredComment 
)
static
Returns
the full command string corresponding to the aperture attribute like "%TA.AperFunction,<function>*%"
Parameters
aUseX1StructuredComment= false in X2 mode, and true in X1 mode to add the net attribut inside a compatible X1 structured comment starting by "G04 #@! " like "G04 #@! TA.AperFunction,<function>*"

Definition at line 150 of file gbr_metadata.cpp.

152 {
153  std::string attribute_string;
154 
155  // generate a string to print a Gerber Aperture attribute
156  switch( aAttribute )
157  {
158  case GBR_APERTURE_ATTRIB_END: // Dummy value (aAttribute must be < GBR_APERTURE_ATTRIB_END)
159  case GBR_APERTURE_ATTRIB_NONE: // idle command: do nothing
160  break;
161 
162  case GBR_APERTURE_ATTRIB_ETCHEDCMP: // print info associated to an item
163  // which connects 2 different nets
164  // (Net tees, microwave component)
165  attribute_string = "TA.AperFunction,EtchedComponent";
166  break;
167 
168  case GBR_APERTURE_ATTRIB_CONDUCTOR: // print info associated to a track
169  attribute_string = "TA.AperFunction,Conductor";
170  break;
171 
172  case GBR_APERTURE_ATTRIB_CUTOUT: // print info associated to a outline
173  attribute_string = "TA.AperFunction,CutOut";
174  break;
175 
176  case GBR_APERTURE_ATTRIB_VIAPAD: // print info associated to a flashed via
177  attribute_string = "TA.AperFunction,ViaPad";
178  break;
179 
180  case GBR_APERTURE_ATTRIB_NONCONDUCTOR: // print info associated to a item on a copper layer
181  // which is not a track (for instance a text)
182  attribute_string = "TA.AperFunction,NonConductor";
183  break;
184 
185  case GBR_APERTURE_ATTRIB_COMPONENTPAD: // print info associated to a flashed
186  // through hole component on outer layer
187  attribute_string = "TA.AperFunction,ComponentPad";
188  break;
189 
190  case GBR_APERTURE_ATTRIB_SMDPAD_SMDEF: // print info associated to a flashed for SMD pad.
191  // with solder mask defined from the copper shape
192  // Excluded BGA pads which have their own type
193  attribute_string = "TA.AperFunction,SMDPad,SMDef";
194  break;
195 
196  case GBR_APERTURE_ATTRIB_SMDPAD_CUDEF: // print info associated to a flashed SMD pad with
197  // a solder mask defined by the solder mask
198  attribute_string = "TA.AperFunction,SMDPad,CuDef";
199  break;
200 
201  case GBR_APERTURE_ATTRIB_BGAPAD_SMDEF: // print info associated to flashed BGA pads with
202  // a solder mask defined by the copper shape
203  attribute_string = "TA.AperFunction,BGAPad,SMDef";
204  break;
205 
206  case GBR_APERTURE_ATTRIB_BGAPAD_CUDEF: // print info associated to a flashed BGA pad with
207  // a solder mask defined by the solder mask
208  attribute_string = "TA.AperFunction,BGAPad,CuDef";
209  break;
210 
211  case GBR_APERTURE_ATTRIB_CONNECTORPAD: // print info associated to a flashed edge connector pad (outer layers)
212  attribute_string = "TA.AperFunction,ConnectorPad";
213  break;
214 
215  case GBR_APERTURE_ATTRIB_WASHERPAD: // print info associated to flashed mechanical pads (NPTH)
216  attribute_string = "TA.AperFunction,WasherPad";
217  break;
218 
219  case GBR_APERTURE_ATTRIB_HEATSINKPAD: // print info associated to a flashed heat sink pad
220  // (typically for SMDs)
221  attribute_string = "TA.AperFunction,HeatsinkPad";
222  break;
223 
224  case GBR_APERTURE_ATTRIB_VIADRILL: // print info associated to a via hole in drill files
225  attribute_string = "TA.AperFunction,ViaDrill";
226  break;
227 
228  case GBR_APERTURE_ATTRIB_COMPONENTDRILL: // print info associated to a component
229  // round hole in drill files
230  attribute_string = "TA.AperFunction,ComponentDrill";
231  break;
232 
233  case GBR_APERTURE_ATTRIB_SLOTDRILL: // print info associated to a oblong hole in drill files
234  attribute_string = "TA.AperFunction,Slot";
235  break;
236  }
237 
238  std::string full_attribute_string;
239  wxString eol_string;
240 
241  if( !attribute_string.empty() )
242  {
243  if( aUseX1StructuredComment )
244  {
245  full_attribute_string = "G04 #@! ";
246  eol_string = "*\n";
247  }
248  else
249  {
250  full_attribute_string = "%";
251  eol_string = "*%\n";
252  }
253  }
254 
255  full_attribute_string += attribute_string + eol_string;
256 
257  return full_attribute_string;
258 }
aperture used for etched components
Definition: gbr_metadata.h:83
aperture used for edge connecto pad (outer layers)
Definition: gbr_metadata.h:93
aperture used for heat sink pad (typically for SMDs)
Definition: gbr_metadata.h:95
aperture used for through hole component on outer layer
Definition: gbr_metadata.h:88
aperture used for via holes in drill files
Definition: gbr_metadata.h:96
aperture used for SMD pad. Excluded BGA pads which have their own type
Definition: gbr_metadata.h:89
aperture used for BGA pad with a solder mask defined by the solder mask
Definition: gbr_metadata.h:92
aperture used for pad holes in drill files
Definition: gbr_metadata.h:97
aperture used for mechanical pads (NPTH)
Definition: gbr_metadata.h:94
aperture used for BGA pads with a solder mask defined by the copper shape
Definition: gbr_metadata.h:91
aperture used for connected items like tracks (not vias)
Definition: gbr_metadata.h:84
aperture used for SMD pad with a solder mask defined by the solder mask
Definition: gbr_metadata.h:90
aperture used for not connected items (texts, outlines on copper)
Definition: gbr_metadata.h:86
aperture used for oblong holes in drill files
Definition: gbr_metadata.h:98

References GBR_APERTURE_ATTRIB_BGAPAD_CUDEF, GBR_APERTURE_ATTRIB_BGAPAD_SMDEF, GBR_APERTURE_ATTRIB_COMPONENTDRILL, GBR_APERTURE_ATTRIB_COMPONENTPAD, GBR_APERTURE_ATTRIB_CONDUCTOR, GBR_APERTURE_ATTRIB_CONNECTORPAD, GBR_APERTURE_ATTRIB_CUTOUT, GBR_APERTURE_ATTRIB_END, GBR_APERTURE_ATTRIB_ETCHEDCMP, GBR_APERTURE_ATTRIB_HEATSINKPAD, GBR_APERTURE_ATTRIB_NONCONDUCTOR, GBR_APERTURE_ATTRIB_NONE, GBR_APERTURE_ATTRIB_SLOTDRILL, GBR_APERTURE_ATTRIB_SMDPAD_CUDEF, GBR_APERTURE_ATTRIB_SMDPAD_SMDEF, GBR_APERTURE_ATTRIB_VIADRILL, GBR_APERTURE_ATTRIB_VIAPAD, and GBR_APERTURE_ATTRIB_WASHERPAD.

Referenced by FormatAttribute(), and GERBER_PLOTTER::writeApertureList().

◆ FormatAttribute() [2/2]

std::string GBR_APERTURE_METADATA::FormatAttribute ( bool  aUseX1StructuredComment)
inline

Definition at line 126 of file gbr_metadata.h.

127  {
128  return FormatAttribute( m_ApertAttribute, aUseX1StructuredComment );
129  }
static std::string FormatAttribute(GBR_APERTURE_ATTRIB aAttribute, bool aUseX1StructuredComment)
GBR_APERTURE_ATTRIB m_ApertAttribute
Definition: gbr_metadata.h:132

References FormatAttribute(), and m_ApertAttribute.

◆ GetAttributeName() [1/2]

static std::string GBR_APERTURE_METADATA::GetAttributeName ( GBR_APERTURE_ATTRIB  aAttribute)
static
Returns
the string corresponding to the aperture attribute

◆ GetAttributeName() [2/2]

std::string GBR_APERTURE_METADATA::GetAttributeName ( )
inline

Definition at line 110 of file gbr_metadata.h.

111  {
113  }
std::string GetAttributeName()
Definition: gbr_metadata.h:110
GBR_APERTURE_ATTRIB m_ApertAttribute
Definition: gbr_metadata.h:132

References m_ApertAttribute.

Member Data Documentation

◆ m_ApertAttribute

GBR_APERTURE_ATTRIB GBR_APERTURE_METADATA::m_ApertAttribute

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