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_CMP_DRILL,
  GBR_APERTURE_ATTRIB_CMP_OBLONG_DRILL, GBR_APERTURE_ATTRIB_CMP_POSITION, 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_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_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 shape 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  {
103  };
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 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 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:100
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 flashed shape 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

Constructor & Destructor Documentation

◆ GBR_APERTURE_METADATA()

GBR_APERTURE_METADATA::GBR_APERTURE_METADATA ( )
inline

Definition at line 105 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; // the specific aperture attribute (TA.xxx)
154  std::string comment_string; // a optional G04 comment line to write before the TA. line
155 
156  // generate a string to print a Gerber Aperture attribute
157  switch( aAttribute )
158  {
159  case GBR_APERTURE_ATTRIB_END: // Dummy value (aAttribute must be < GBR_APERTURE_ATTRIB_END)
160  case GBR_APERTURE_ATTRIB_NONE: // idle command: do nothing
161  break;
162 
163  case GBR_APERTURE_ATTRIB_ETCHEDCMP: // print info associated to an item
164  // which connects 2 different nets
165  // (Net tees, microwave component)
166  attribute_string = "TA.AperFunction,EtchedComponent";
167  break;
168 
169  case GBR_APERTURE_ATTRIB_CONDUCTOR: // print info associated to a track
170  attribute_string = "TA.AperFunction,Conductor";
171  break;
172 
173  case GBR_APERTURE_ATTRIB_CUTOUT: // print info associated to a outline
174  attribute_string = "TA.AperFunction,CutOut";
175  break;
176 
177  case GBR_APERTURE_ATTRIB_VIAPAD: // print info associated to a flashed via
178  attribute_string = "TA.AperFunction,ViaPad";
179  break;
180 
181  case GBR_APERTURE_ATTRIB_NONCONDUCTOR: // print info associated to a item on a copper layer
182  // which is not a track (for instance a text)
183  attribute_string = "TA.AperFunction,NonConductor";
184  break;
185 
186  case GBR_APERTURE_ATTRIB_COMPONENTPAD: // print info associated to a flashed
187  // through hole component on outer layer
188  attribute_string = "TA.AperFunction,ComponentPad";
189  break;
190 
191  case GBR_APERTURE_ATTRIB_SMDPAD_SMDEF: // print info associated to a flashed for SMD pad.
192  // with solder mask defined from the copper shape
193  // Excluded BGA pads which have their own type
194  attribute_string = "TA.AperFunction,SMDPad,SMDef";
195  break;
196 
197  case GBR_APERTURE_ATTRIB_SMDPAD_CUDEF: // print info associated to a flashed SMD pad with
198  // a solder mask defined by the solder mask
199  attribute_string = "TA.AperFunction,SMDPad,CuDef";
200  break;
201 
202  case GBR_APERTURE_ATTRIB_BGAPAD_SMDEF: // print info associated to flashed BGA pads with
203  // a solder mask defined by the copper shape
204  attribute_string = "TA.AperFunction,BGAPad,SMDef";
205  break;
206 
207  case GBR_APERTURE_ATTRIB_BGAPAD_CUDEF: // print info associated to a flashed BGA pad with
208  // a solder mask defined by the solder mask
209  attribute_string = "TA.AperFunction,BGAPad,CuDef";
210  break;
211 
212  case GBR_APERTURE_ATTRIB_CONNECTORPAD: // print info associated to a flashed edge connector pad (outer layers)
213  attribute_string = "TA.AperFunction,ConnectorPad";
214  break;
215 
216  case GBR_APERTURE_ATTRIB_WASHERPAD: // print info associated to flashed mechanical pads (NPTH)
217  attribute_string = "TA.AperFunction,WasherPad";
218  break;
219 
220  case GBR_APERTURE_ATTRIB_HEATSINKPAD: // print info associated to a flashed heat sink pad
221  // (typically for SMDs)
222  attribute_string = "TA.AperFunction,HeatsinkPad";
223  break;
224 
225  case GBR_APERTURE_ATTRIB_VIADRILL: // print info associated to a via hole in drill files
226  attribute_string = "TA.AperFunction,ViaDrill";
227  break;
228 
229  case GBR_APERTURE_ATTRIB_CMP_DRILL: // print info associated to a component
230  // round pad hole in drill files
231  attribute_string = "TA.AperFunction,ComponentDrill";
232  break;
233 
234  // print info associated to a component oblong pad hole in drill files
235  // Same as a round pad hole, but is a specific aperture in drill file and
236  // a G04 comment is added to the aperture function
238  comment_string = "aperture for slot hole";
239  attribute_string = "TA.AperFunction,ComponentDrill";
240  break;
241 
242  case GBR_APERTURE_ATTRIB_CMP_POSITION: // print info associated to a component
243  // flashed shape at the component position
244  // in placement files
245  attribute_string = "TA.AperFunction,ComponentMain";
246  break;
247 
248  case GBR_APERTURE_ATTRIB_CMP_COURTYARD: // print info associated to a component
249  // print the component courtyard polygon
250  // in placement files
251  attribute_string = "TA.AperFunction,ComponentOutline,Courtyard";
252  break;
253 
254  break;
255  }
256 
257  std::string full_attribute_string;
258  wxString eol_string;
259 
260  if( !attribute_string.empty() )
261  {
262  if( !comment_string.empty() )
263  {
264  full_attribute_string = "G04 " + comment_string + "*\n";
265  }
266 
267  if( aUseX1StructuredComment )
268  {
269  full_attribute_string += "G04 #@! ";
270  eol_string = "*\n";
271  }
272  else
273  {
274  full_attribute_string += "%";
275  eol_string = "*%\n";
276  }
277  }
278 
279  full_attribute_string += attribute_string + eol_string;
280 
281  return full_attribute_string;
282 }
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 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 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:100
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 flashed shape 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

References GBR_APERTURE_ATTRIB_BGAPAD_CUDEF, GBR_APERTURE_ATTRIB_BGAPAD_SMDEF, GBR_APERTURE_ATTRIB_CMP_COURTYARD, GBR_APERTURE_ATTRIB_CMP_DRILL, 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_CUTOUT, GBR_APERTURE_ATTRIB_END, GBR_APERTURE_ATTRIB_ETCHEDCMP, GBR_APERTURE_ATTRIB_HEATSINKPAD, GBR_APERTURE_ATTRIB_NONCONDUCTOR, GBR_APERTURE_ATTRIB_NONE, 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 129 of file gbr_metadata.h.

130  {
131  return FormatAttribute( m_ApertAttribute, aUseX1StructuredComment );
132  }
static std::string FormatAttribute(GBR_APERTURE_ATTRIB aAttribute, bool aUseX1StructuredComment)
GBR_APERTURE_ATTRIB m_ApertAttribute
Definition: gbr_metadata.h:135

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

114  {
116  }
std::string GetAttributeName()
Definition: gbr_metadata.h:113
GBR_APERTURE_ATTRIB m_ApertAttribute
Definition: gbr_metadata.h:135

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: