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 152 of file gbr_metadata.cpp.

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