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 88 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.

aperture used for connected items like tracks (not vias).

GBR_APERTURE_ATTRIB_CONDUCTOR 
GBR_APERTURE_ATTRIB_EDGECUT 

aperture used for board cutout,

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

GBR_APERTURE_ATTRIB_NONCONDUCTOR 
GBR_APERTURE_ATTRIB_VIAPAD 

aperture used for vias.

aperture used for through hole component on outer layer.

GBR_APERTURE_ATTRIB_COMPONENTPAD 

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

GBR_APERTURE_ATTRIB_SMDPAD_SMDEF 

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

GBR_APERTURE_ATTRIB_SMDPAD_CUDEF 

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

GBR_APERTURE_ATTRIB_BGAPAD_SMDEF 

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

GBR_APERTURE_ATTRIB_BGAPAD_CUDEF 

aperture used for edge connector pad (outer layers).

GBR_APERTURE_ATTRIB_CONNECTORPAD 
GBR_APERTURE_ATTRIB_WASHERPAD 

aperture used for mechanical pads (NPTH).

GBR_APERTURE_ATTRIB_TESTPOINT 

aperture used for test point pad (outer layers).

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

GBR_APERTURE_ATTRIB_FIDUCIAL_GLBL 

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

GBR_APERTURE_ATTRIB_FIDUCIAL_LOCAL 

aperture used for heat sink pad (typically for SMDs).

GBR_APERTURE_ATTRIB_HEATSINKPAD 

aperture used for castellated pads in copper layer files.

GBR_APERTURE_ATTRIB_CASTELLATEDPAD 

aperture used for castellated pads in drill files.

GBR_APERTURE_ATTRIB_CASTELLATEDDRILL 
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.

aperture used for pads oblong holes in drill files.

GBR_APERTURE_ATTRIB_CMP_OBLONG_DRILL 

aperture used for flashed cmp position in placement files.

GBR_APERTURE_ATTRIB_CMP_POSITION 

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

GBR_APERTURE_ATTRIB_PAD1_POSITION 

aperture used for flashed pads position in placement files.

GBR_APERTURE_ATTRIB_PADOTHER_POSITION 

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

GBR_APERTURE_ATTRIB_CMP_BODY 

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

GBR_APERTURE_ATTRIB_CMP_LEAD2LEAD 

aperture used to draw component footprint bounding box in placement files.

GBR_APERTURE_ATTRIB_CMP_FOOTPRINT 

aperture used to draw component outline courtyard in placement files.

GBR_APERTURE_ATTRIB_CMP_COURTYARD 
GBR_APERTURE_ATTRIB_END 

sentinel: max value

Definition at line 91 of file gbr_metadata.h.

92  {
95 
99 
103 
106 
109 
112 
115 
118 
123 
126 
129 
132 
135 
138 
141 
144 
147 
150 
153 
156 
159 
162 
166  };
aperture used for etched components.
Definition: gbr_metadata.h:94
aperture used to draw component outline courtyard in placement files.
Definition: gbr_metadata.h:161
aperture used for flashed pads position in placement files.
Definition: gbr_metadata.h:149
aperture used for flashed cmp position in placement files.
Definition: gbr_metadata.h:143
aperture used for castellated pads in copper layer files.
Definition: gbr_metadata.h:131
aperture used to draw component physical body outline without pins in placement files.
Definition: gbr_metadata.h:152
aperture used for SMD pad. Excluded BGA pads which have their own type.
Definition: gbr_metadata.h:105
aperture used for via holes in drill files.
Definition: gbr_metadata.h:139
aperture used for castellated pads in drill files.
Definition: gbr_metadata.h:134
aperture used for SMD pad with a solder mask defined by the solder mask.
Definition: gbr_metadata.h:108
aperture used for edge connector pad (outer layers).
Definition: gbr_metadata.h:117
aperture used for fiducial pad (outer layers), at footprint level.
Definition: gbr_metadata.h:125
aperture used for pad holes in drill files.
Definition: gbr_metadata.h:140
aperture used for mechanical pads (NPTH).
Definition: gbr_metadata.h:121
aperture used for BGA pad with a solder mask defined by the solder mask.
Definition: gbr_metadata.h:114
aperture used to draw component physical body outline with pins in placement files.
Definition: gbr_metadata.h:155
aperture used for test point pad (outer layers).
Definition: gbr_metadata.h:122
aperture used for flashed pin 1 (or A1 or AA1) position in placement files.
Definition: gbr_metadata.h:146
aperture used for heat sink pad (typically for SMDs).
Definition: gbr_metadata.h:128
aperture used for BGA pads with a solder mask defined by the copper shape.
Definition: gbr_metadata.h:111
aperture used to draw component footprint bounding box in placement files.
Definition: gbr_metadata.h:158

Constructor & Destructor Documentation

◆ GBR_APERTURE_METADATA()

GBR_APERTURE_METADATA::GBR_APERTURE_METADATA ( )
inline

Definition at line 168 of file gbr_metadata.h.

Member Function Documentation

◆ FormatAttribute() [1/2]

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

Definition at line 156 of file gbr_metadata.cpp.

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

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

192  {
193  return FormatAttribute( m_ApertAttribute, aUseX1StructuredComment );
194  }
static std::string FormatAttribute(GBR_APERTURE_ATTRIB aAttribute, bool aUseX1StructuredComment)
GBR_APERTURE_ATTRIB m_ApertAttribute
Definition: gbr_metadata.h:197

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

177  {
179  }
std::string GetAttributeName()
Definition: gbr_metadata.h:176
GBR_APERTURE_ATTRIB m_ApertAttribute
Definition: gbr_metadata.h:197

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: