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_EDGECUT,
  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_TESTPOINT, GBR_APERTURE_ATTRIB_FIDUCIAL_GLBL, GBR_APERTURE_ATTRIB_FIDUCIAL_LOCAL,
  GBR_APERTURE_ATTRIB_HEATSINKPAD, GBR_APERTURE_ATTRIB_CASTELLATEDPAD, GBR_APERTURE_ATTRIB_CASTELLATEDDRILL, GBR_APERTURE_ATTRIB_VIADRILL,
  GBR_APERTURE_ATTRIB_CMP_DRILL, GBR_APERTURE_ATTRIB_CMP_OBLONG_DRILL, GBR_APERTURE_ATTRIB_CMP_POSITION, GBR_APERTURE_ATTRIB_PAD1_POSITION,
  GBR_APERTURE_ATTRIB_PADOTHER_POSITION, GBR_APERTURE_ATTRIB_CMP_BODY, GBR_APERTURE_ATTRIB_CMP_LEAD2LEAD, GBR_APERTURE_ATTRIB_CMP_FOOTPRINT,
  GBR_APERTURE_ATTRIB_CMP_COURTYARD, 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_EDGECUT 

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 connector pad (outer layers)

GBR_APERTURE_ATTRIB_WASHERPAD 

aperture used for mechanical pads (NPTH)

GBR_APERTURE_ATTRIB_TESTPOINT 

aperture used for test point pad (outer layers)

GBR_APERTURE_ATTRIB_FIDUCIAL_GLBL 

aperture used for fiducial pad (outer layers), at board level

GBR_APERTURE_ATTRIB_FIDUCIAL_LOCAL 

aperture used for fiducial pad (outer layers), at footprint level

GBR_APERTURE_ATTRIB_HEATSINKPAD 

aperture used for heat sink pad (typically for SMDs)

GBR_APERTURE_ATTRIB_CASTELLATEDPAD 

aperture used for castellated pads in copper layer files

GBR_APERTURE_ATTRIB_CASTELLATEDDRILL 

aperture used for castellated pads in drill files

GBR_APERTURE_ATTRIB_VIADRILL 

aperture used for via holes in drill files

GBR_APERTURE_ATTRIB_CMP_DRILL 

aperture used for pad holes in drill files

GBR_APERTURE_ATTRIB_CMP_OBLONG_DRILL 

aperture used for pads oblong holes in drill files

GBR_APERTURE_ATTRIB_CMP_POSITION 

aperture used for flashed cmp position in placement files

GBR_APERTURE_ATTRIB_PAD1_POSITION 

aperture used for flashed pin 1 (or A1 or AA1) position in placement files

GBR_APERTURE_ATTRIB_PADOTHER_POSITION 

aperture used for flashed pads position in placement files

GBR_APERTURE_ATTRIB_CMP_BODY 

aperture used to draw component physical body outline (without pins) in placement files

GBR_APERTURE_ATTRIB_CMP_LEAD2LEAD 

aperture used to draw component physical body outline (with pins) in placement files

GBR_APERTURE_ATTRIB_CMP_FOOTPRINT 

aperture used to draw component footprint bounding box in placement files

GBR_APERTURE_ATTRIB_CMP_COURTYARD 

aperture used to draw component outline courtyard in placement files

GBR_APERTURE_ATTRIB_END 

sentinel: max value

Definition at line 80 of file gbr_metadata.h.

81  {
88 
102 
118  };
aperture used for etched components
Definition: gbr_metadata.h:83
aperture used to draw component footprint bounding box in placement files
Definition: gbr_metadata.h:113
aperture used for edge connector pad (outer layers)
Definition: gbr_metadata.h:94
aperture used for flashed pin 1 (or A1 or AA1) position in placement files
Definition: gbr_metadata.h:107
aperture used for pads oblong holes in drill files
Definition: gbr_metadata.h:105
aperture used for heat sink pad (typically for SMDs)
Definition: gbr_metadata.h:99
aperture used for flashed pads position in placement files
Definition: gbr_metadata.h:108
aperture used for through hole component on outer layer
Definition: gbr_metadata.h:89
aperture used for via holes in drill files
Definition: gbr_metadata.h:103
aperture used for castellated pads in drill files
Definition: gbr_metadata.h:101
aperture used for castellated pads in copper layer files
Definition: gbr_metadata.h:100
aperture used for SMD pad. Excluded BGA pads which have their own type
Definition: gbr_metadata.h:90
aperture used for BGA pad with a solder mask defined by the solder mask
Definition: gbr_metadata.h:93
aperture used for fiducial pad (outer layers), at board level
Definition: gbr_metadata.h:97
aperture used for pad holes in drill files
Definition: gbr_metadata.h:104
aperture used for mechanical pads (NPTH)
Definition: gbr_metadata.h:95
aperture used to draw component outline courtyard in placement files
Definition: gbr_metadata.h:115
aperture used for BGA pads with a solder mask defined by the copper shape
Definition: gbr_metadata.h:92
aperture used for connected items like tracks (not vias)
Definition: gbr_metadata.h:84
aperture used to draw component physical body outline (without pins) in placement files
Definition: gbr_metadata.h:109
aperture used for test point pad (outer layers)
Definition: gbr_metadata.h:96
aperture used for flashed cmp position in placement files
Definition: gbr_metadata.h:106
aperture used for fiducial pad (outer layers), at footprint level
Definition: gbr_metadata.h:98
aperture used for SMD pad with a solder mask defined by the solder mask
Definition: gbr_metadata.h:91
aperture used for not connected items (texts, outlines on copper)
Definition: gbr_metadata.h:86
aperture used to draw component physical body outline (with pins) in placement files
Definition: gbr_metadata.h:111

Constructor & Destructor Documentation

◆ GBR_APERTURE_METADATA()

GBR_APERTURE_METADATA::GBR_APERTURE_METADATA ( )
inline

Definition at line 120 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 151 of file gbr_metadata.cpp.

153 {
154  std::string attribute_string; // the specific aperture attribute (TA.xxx)
155  std::string comment_string; // a optional G04 comment line to write before the TA. line
156 
157  // generate a string to print a Gerber Aperture attribute
158  switch( aAttribute )
159  {
160  case GBR_APERTURE_ATTRIB_END: // Dummy value (aAttribute must be < GBR_APERTURE_ATTRIB_END)
161  case GBR_APERTURE_ATTRIB_NONE: // idle command: do nothing
162  break;
163 
164  case GBR_APERTURE_ATTRIB_ETCHEDCMP: // print info associated to an item
165  // which connects 2 different nets
166  // (Net tees, microwave component)
167  attribute_string = "TA.AperFunction,EtchedComponent";
168  break;
169 
170  case GBR_APERTURE_ATTRIB_CONDUCTOR: // print info associated to a track
171  attribute_string = "TA.AperFunction,Conductor";
172  break;
173 
174  case GBR_APERTURE_ATTRIB_EDGECUT: // print info associated to a board outline
175  attribute_string = "TA.AperFunction,Profile";
176  break;
177 
178  case GBR_APERTURE_ATTRIB_VIAPAD: // print info associated to a flashed via
179  attribute_string = "TA.AperFunction,ViaPad";
180  break;
181 
182  case GBR_APERTURE_ATTRIB_NONCONDUCTOR: // print info associated to a item on a copper layer
183  // which is not a track (for instance a text)
184  attribute_string = "TA.AperFunction,NonConductor";
185  break;
186 
187  case GBR_APERTURE_ATTRIB_COMPONENTPAD: // print info associated to a flashed
188  // through hole component on outer layer
189  attribute_string = "TA.AperFunction,ComponentPad";
190  break;
191 
192  case GBR_APERTURE_ATTRIB_SMDPAD_SMDEF: // print info associated to a flashed for SMD pad.
193  // with solder mask defined from the copper shape
194  // Excluded BGA pads which have their own type
195  attribute_string = "TA.AperFunction,SMDPad,SMDef";
196  break;
197 
198  case GBR_APERTURE_ATTRIB_SMDPAD_CUDEF: // print info associated to a flashed SMD pad with
199  // a solder mask defined by the solder mask
200  attribute_string = "TA.AperFunction,SMDPad,CuDef";
201  break;
202 
203  case GBR_APERTURE_ATTRIB_BGAPAD_SMDEF: // print info associated to flashed BGA pads with
204  // a solder mask defined by the copper shape
205  attribute_string = "TA.AperFunction,BGAPad,SMDef";
206  break;
207 
208  case GBR_APERTURE_ATTRIB_BGAPAD_CUDEF: // print info associated to a flashed BGA pad with
209  // a solder mask defined by the solder mask
210  attribute_string = "TA.AperFunction,BGAPad,CuDef";
211  break;
212 
213  case GBR_APERTURE_ATTRIB_CONNECTORPAD: // print info associated to a flashed edge connector pad (outer layers)
214  attribute_string = "TA.AperFunction,ConnectorPad";
215  break;
216 
217  case GBR_APERTURE_ATTRIB_WASHERPAD: // print info associated to flashed mechanical pads (NPTH)
218  attribute_string = "TA.AperFunction,WasherPad";
219  break;
220 
221  case GBR_APERTURE_ATTRIB_HEATSINKPAD: // print info associated to a flashed heat sink pad
222  // (typically for SMDs)
223  attribute_string = "TA.AperFunction,HeatsinkPad";
224  break;
225 
226  case GBR_APERTURE_ATTRIB_TESTPOINT: // print info associated to a flashed test point pad
227  // (typically for SMDs)
228  attribute_string = "TA.AperFunction,TestPad";
229  break;
230 
231  case GBR_APERTURE_ATTRIB_FIDUCIAL_GLBL: // print info associated to a flashed fiducial pad
232  // (typically for SMDs)
233  attribute_string = "TA.AperFunction,FiducialPad,Global";
234  break;
235 
236  case GBR_APERTURE_ATTRIB_FIDUCIAL_LOCAL: // print info associated to a flashed fiducial pad
237  // (typically for SMDs)
238  attribute_string = "TA.AperFunction,FiducialPad,Local";
239  break;
240 
241  case GBR_APERTURE_ATTRIB_CASTELLATEDPAD: // print info associated to a flashed castellated pad
242  // (typically for SMDs)
243  attribute_string = "TA.AperFunction,CastellatedPad";
244  break;
245 
246  case GBR_APERTURE_ATTRIB_CASTELLATEDDRILL: // print info associated to a flashed castellated pad
247  // in drill files
248  attribute_string = "TA.AperFunction,CastellatedDrill";
249  break;
250 
251  case GBR_APERTURE_ATTRIB_VIADRILL: // print info associated to a via hole in drill files
252  attribute_string = "TA.AperFunction,ViaDrill";
253  break;
254 
255  case GBR_APERTURE_ATTRIB_CMP_DRILL: // print info associated to a component
256  // round pad hole in drill files
257  attribute_string = "TA.AperFunction,ComponentDrill";
258  break;
259 
260  // print info associated to a component oblong pad hole in drill files
261  // Same as a round pad hole, but is a specific aperture in drill file and
262  // a G04 comment is added to the aperture function
264  comment_string = "aperture for slot hole";
265  attribute_string = "TA.AperFunction,ComponentDrill";
266  break;
267 
268  case GBR_APERTURE_ATTRIB_CMP_POSITION: // print info associated to a component
269  // flashed shape at the component position
270  // in placement files
271  attribute_string = "TA.AperFunction,ComponentMain";
272  break;
273 
274  case GBR_APERTURE_ATTRIB_PAD1_POSITION: // print info associated to a component
275  // flashed shape at pad 1 position
276  // (pad 1 is also pad A1 or pad AA1)
277  // in placement files
278  attribute_string = "TA.AperFunction,ComponentPin";
279  break;
280 
281  case GBR_APERTURE_ATTRIB_PADOTHER_POSITION: // print info associated to a component
282  // flashed shape at pads position (all but pad 1)
283  // in placement files
284  // Currently: (could be changed later) same as
285  // GBR_APERTURE_ATTRIB_PADOTHER_POSITION
286  attribute_string = "TA.AperFunction,ComponentPin";
287  break;
288 
289  case GBR_APERTURE_ATTRIB_CMP_BODY: // print info associated to a component
290  // print the component physical body
291  // polygon in placement files
292  attribute_string = "TA.AperFunction,ComponentOutline,Body";
293  break;
294 
295  case GBR_APERTURE_ATTRIB_CMP_LEAD2LEAD: // print info associated to a component
296  // print the component physical lead to lead
297  // polygon in placement files
298  attribute_string = "TA.AperFunction,ComponentOutline,Lead2Lead";
299  break;
300 
301  case GBR_APERTURE_ATTRIB_CMP_FOOTPRINT: // print info associated to a component
302  // print the component footprint bounding box
303  // polygon in placement files
304  attribute_string = "TA.AperFunction,ComponentOutline,Footprint";
305  break;
306 
307  case GBR_APERTURE_ATTRIB_CMP_COURTYARD: // print info associated to a component
308  // print the component courtyard
309  // polygon in placement files
310  attribute_string = "TA.AperFunction,ComponentOutline,Courtyard";
311  break;
312 
313  break;
314  }
315 
316  std::string full_attribute_string;
317  wxString eol_string;
318 
319  if( !attribute_string.empty() )
320  {
321  if( !comment_string.empty() )
322  {
323  full_attribute_string = "G04 " + comment_string + "*\n";
324  }
325 
326  if( aUseX1StructuredComment )
327  {
328  full_attribute_string += "G04 #@! ";
329  eol_string = "*\n";
330  }
331  else
332  {
333  full_attribute_string += "%";
334  eol_string = "*%\n";
335  }
336  }
337 
338  full_attribute_string += attribute_string + eol_string;
339 
340  return full_attribute_string;
341 }
aperture used for etched components
Definition: gbr_metadata.h:83
aperture used to draw component footprint bounding box in placement files
Definition: gbr_metadata.h:113
aperture used for edge connector pad (outer layers)
Definition: gbr_metadata.h:94
aperture used for flashed pin 1 (or A1 or AA1) position in placement files
Definition: gbr_metadata.h:107
aperture used for pads oblong holes in drill files
Definition: gbr_metadata.h:105
aperture used for heat sink pad (typically for SMDs)
Definition: gbr_metadata.h:99
aperture used for flashed pads position in placement files
Definition: gbr_metadata.h:108
aperture used for through hole component on outer layer
Definition: gbr_metadata.h:89
aperture used for via holes in drill files
Definition: gbr_metadata.h:103
aperture used for castellated pads in drill files
Definition: gbr_metadata.h:101
aperture used for castellated pads in copper layer files
Definition: gbr_metadata.h:100
aperture used for SMD pad. Excluded BGA pads which have their own type
Definition: gbr_metadata.h:90
aperture used for BGA pad with a solder mask defined by the solder mask
Definition: gbr_metadata.h:93
aperture used for fiducial pad (outer layers), at board level
Definition: gbr_metadata.h:97
aperture used for pad holes in drill files
Definition: gbr_metadata.h:104
aperture used for mechanical pads (NPTH)
Definition: gbr_metadata.h:95
aperture used to draw component outline courtyard in placement files
Definition: gbr_metadata.h:115
aperture used for BGA pads with a solder mask defined by the copper shape
Definition: gbr_metadata.h:92
aperture used for connected items like tracks (not vias)
Definition: gbr_metadata.h:84
aperture used to draw component physical body outline (without pins) in placement files
Definition: gbr_metadata.h:109
aperture used for test point pad (outer layers)
Definition: gbr_metadata.h:96
aperture used for flashed cmp position in placement files
Definition: gbr_metadata.h:106
aperture used for fiducial pad (outer layers), at footprint level
Definition: gbr_metadata.h:98
aperture used for SMD pad with a solder mask defined by the solder mask
Definition: gbr_metadata.h:91
aperture used for not connected items (texts, outlines on copper)
Definition: gbr_metadata.h:86
aperture used to draw component physical body outline (with pins) in placement files
Definition: gbr_metadata.h:111

References GBR_APERTURE_ATTRIB_BGAPAD_CUDEF, GBR_APERTURE_ATTRIB_BGAPAD_SMDEF, GBR_APERTURE_ATTRIB_CASTELLATEDDRILL, GBR_APERTURE_ATTRIB_CASTELLATEDPAD, GBR_APERTURE_ATTRIB_CMP_BODY, GBR_APERTURE_ATTRIB_CMP_COURTYARD, GBR_APERTURE_ATTRIB_CMP_DRILL, GBR_APERTURE_ATTRIB_CMP_FOOTPRINT, GBR_APERTURE_ATTRIB_CMP_LEAD2LEAD, GBR_APERTURE_ATTRIB_CMP_OBLONG_DRILL, GBR_APERTURE_ATTRIB_CMP_POSITION, GBR_APERTURE_ATTRIB_COMPONENTPAD, GBR_APERTURE_ATTRIB_CONDUCTOR, GBR_APERTURE_ATTRIB_CONNECTORPAD, GBR_APERTURE_ATTRIB_EDGECUT, GBR_APERTURE_ATTRIB_END, GBR_APERTURE_ATTRIB_ETCHEDCMP, GBR_APERTURE_ATTRIB_FIDUCIAL_GLBL, GBR_APERTURE_ATTRIB_FIDUCIAL_LOCAL, GBR_APERTURE_ATTRIB_HEATSINKPAD, GBR_APERTURE_ATTRIB_NONCONDUCTOR, GBR_APERTURE_ATTRIB_NONE, GBR_APERTURE_ATTRIB_PAD1_POSITION, GBR_APERTURE_ATTRIB_PADOTHER_POSITION, GBR_APERTURE_ATTRIB_SMDPAD_CUDEF, GBR_APERTURE_ATTRIB_SMDPAD_SMDEF, GBR_APERTURE_ATTRIB_TESTPOINT, GBR_APERTURE_ATTRIB_VIADRILL, GBR_APERTURE_ATTRIB_VIAPAD, and GBR_APERTURE_ATTRIB_WASHERPAD.

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

◆ FormatAttribute() [2/2]

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

Definition at line 144 of file gbr_metadata.h.

145  {
146  return FormatAttribute( m_ApertAttribute, aUseX1StructuredComment );
147  }
static std::string FormatAttribute(GBR_APERTURE_ATTRIB aAttribute, bool aUseX1StructuredComment)
GBR_APERTURE_ATTRIB m_ApertAttribute
Definition: gbr_metadata.h:150

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 128 of file gbr_metadata.h.

129  {
131  }
std::string GetAttributeName()
Definition: gbr_metadata.h:128
GBR_APERTURE_ATTRIB m_ApertAttribute
Definition: gbr_metadata.h:150

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: