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_HEATSINKPAD, 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 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_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  {
111  };
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:106
aperture used for edge connecto pad (outer layers)
Definition: gbr_metadata.h:93
aperture used for flashed pin 1 (or A1 or AA1) position in placement files
Definition: gbr_metadata.h:100
aperture used for pads oblong holes in drill files
Definition: gbr_metadata.h:98
aperture used for heat sink pad (typically for SMDs)
Definition: gbr_metadata.h:95
aperture used for flashed pads position in placement files
Definition: gbr_metadata.h:101
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 to draw component outline courtyard in placement files
Definition: gbr_metadata.h:108
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 to draw component physical body outline (without pins) in placement files
Definition: gbr_metadata.h:102
aperture used for flashed cmp position in placement files
Definition: gbr_metadata.h:99
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 to draw component physical body outline (with pins) in placement files
Definition: gbr_metadata.h:104

Constructor & Destructor Documentation

◆ GBR_APERTURE_METADATA()

GBR_APERTURE_METADATA::GBR_APERTURE_METADATA ( )
inline

Definition at line 113 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_VIADRILL: // print info associated to a via hole in drill files
227  attribute_string = "TA.AperFunction,ViaDrill";
228  break;
229 
230  case GBR_APERTURE_ATTRIB_CMP_DRILL: // print info associated to a component
231  // round pad hole in drill files
232  attribute_string = "TA.AperFunction,ComponentDrill";
233  break;
234 
235  // print info associated to a component oblong pad hole in drill files
236  // Same as a round pad hole, but is a specific aperture in drill file and
237  // a G04 comment is added to the aperture function
239  comment_string = "aperture for slot hole";
240  attribute_string = "TA.AperFunction,ComponentDrill";
241  break;
242 
243  case GBR_APERTURE_ATTRIB_CMP_POSITION: // print info associated to a component
244  // flashed shape at the component position
245  // in placement files
246  attribute_string = "TA.AperFunction,ComponentMain";
247  break;
248 
249  case GBR_APERTURE_ATTRIB_PAD1_POSITION: // print info associated to a component
250  // flashed shape at pad 1 position
251  // (pad 1 is also pad A1 or pad AA1)
252  // in placement files
253  attribute_string = "TA.AperFunction,ComponentPin";
254  break;
255 
256  case GBR_APERTURE_ATTRIB_PADOTHER_POSITION: // print info associated to a component
257  // flashed shape at pads position (all but pad 1)
258  // in placement files
259  // Currently: (could be changed later) same as
260  // GBR_APERTURE_ATTRIB_PADOTHER_POSITION
261  attribute_string = "TA.AperFunction,ComponentPin";
262  break;
263 
264  case GBR_APERTURE_ATTRIB_CMP_BODY: // print info associated to a component
265  // print the component physical body
266  // polygon in placement files
267  attribute_string = "TA.AperFunction,ComponentOutline,Body";
268  break;
269 
270  case GBR_APERTURE_ATTRIB_CMP_LEAD2LEAD: // print info associated to a component
271  // print the component physical lead to lead
272  // polygon in placement files
273  attribute_string = "TA.AperFunction,ComponentOutline,Lead2Lead";
274  break;
275 
276  case GBR_APERTURE_ATTRIB_CMP_FOOTPRINT: // print info associated to a component
277  // print the component footprint bounding box
278  // polygon in placement files
279  attribute_string = "TA.AperFunction,ComponentOutline,Footprint";
280  break;
281 
282  case GBR_APERTURE_ATTRIB_CMP_COURTYARD: // print info associated to a component
283  // print the component courtyard
284  // polygon in placement files
285  attribute_string = "TA.AperFunction,ComponentOutline,Courtyard";
286  break;
287 
288  break;
289  }
290 
291  std::string full_attribute_string;
292  wxString eol_string;
293 
294  if( !attribute_string.empty() )
295  {
296  if( !comment_string.empty() )
297  {
298  full_attribute_string = "G04 " + comment_string + "*\n";
299  }
300 
301  if( aUseX1StructuredComment )
302  {
303  full_attribute_string += "G04 #@! ";
304  eol_string = "*\n";
305  }
306  else
307  {
308  full_attribute_string += "%";
309  eol_string = "*%\n";
310  }
311  }
312 
313  full_attribute_string += attribute_string + eol_string;
314 
315  return full_attribute_string;
316 }
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:106
aperture used for edge connecto pad (outer layers)
Definition: gbr_metadata.h:93
aperture used for flashed pin 1 (or A1 or AA1) position in placement files
Definition: gbr_metadata.h:100
aperture used for pads oblong holes in drill files
Definition: gbr_metadata.h:98
aperture used for heat sink pad (typically for SMDs)
Definition: gbr_metadata.h:95
aperture used for flashed pads position in placement files
Definition: gbr_metadata.h:101
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 to draw component outline courtyard in placement files
Definition: gbr_metadata.h:108
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 to draw component physical body outline (without pins) in placement files
Definition: gbr_metadata.h:102
aperture used for flashed cmp position in placement files
Definition: gbr_metadata.h:99
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 to draw component physical body outline (with pins) in placement files
Definition: gbr_metadata.h:104

References GBR_APERTURE_ATTRIB_BGAPAD_CUDEF, GBR_APERTURE_ATTRIB_BGAPAD_SMDEF, 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_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_VIADRILL, GBR_APERTURE_ATTRIB_VIAPAD, and GBR_APERTURE_ATTRIB_WASHERPAD.

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

◆ FormatAttribute() [2/2]

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

Definition at line 137 of file gbr_metadata.h.

138  {
139  return FormatAttribute( m_ApertAttribute, aUseX1StructuredComment );
140  }
static std::string FormatAttribute(GBR_APERTURE_ATTRIB aAttribute, bool aUseX1StructuredComment)
GBR_APERTURE_ATTRIB m_ApertAttribute
Definition: gbr_metadata.h:143

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

122  {
124  }
std::string GetAttributeName()
Definition: gbr_metadata.h:121
GBR_APERTURE_ATTRIB m_ApertAttribute
Definition: gbr_metadata.h:143

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: