KiCad PCB EDA Suite
GBR_CMP_PNP_METADATA Class Reference

Information which can be added in a gerber P&P file as attribute of a component. More...

#include <gbr_netlist_metadata.h>

Public Types

enum  MOUNT_TYPE { MOUNT_TYPE_UNSPECIFIED, MOUNT_TYPE_SMD, MOUNT_TYPE_TH }
 

Public Member Functions

 GBR_CMP_PNP_METADATA ()
 
void ClearData ()
 
wxString FormatCmpPnPMetadata ()
 

Public Attributes

double m_Orientation
 
wxString m_Manufacturer
 
wxString m_MPN
 
wxString m_Package
 
wxString m_Footprint
 
wxString m_LibraryName
 
wxString m_LibraryDescr
 
wxString m_Value
 
MOUNT_TYPE m_MountType
 

Detailed Description

Information which can be added in a gerber P&P file as attribute of a component.

This is only applicable to objects having the TA.AperFunction attribute "ComponentMain" There are specific attributes defined attached to the component by the TO command TO.CRot,<angle> The rotation angle of the component. The rotation angle is consistent with the one for graphics objects. Positive rotation is counter- clockwise as viewed from the top side, even if the component is on the board side. The base orientation of component - no rotation - on the top side is as in IPC-7351. Components on the bottom side are of course mirrored. The base orientation on the bottom side is the one on the top side mirrored around the X axis.

TO.CMfr,<string> Manufacturer TO.CMPN,<string> Manufacturer part number TO.Cpkg,<string> Package, as per IPC-7351 TO.CVal,<string> Value, a string. E.g. 220nF TO.CMnt,<string> Mount type: (SMD|TH|Other) TO.CFtp,<string> Footprint name, a string. E.g. LQFP-100_14x14mm_P0.5mm This is the footprint name coming from the CAD tool libraries. TO.CPgN,<string> Package name, like the JEDEC JEP95 standard. TO.CPgD,<string> Package description. TO.CHgt,<string> Height, a decimal, in the unit of the file. TO.CLbN,<string> Library name. TO.CLbD,<string> Library description. TO.Sup,<SN>,<SPN> SN is a field with the supplier name. SPN is a field with the supplier part name.

Definition at line 57 of file gbr_netlist_metadata.h.

Member Enumeration Documentation

◆ MOUNT_TYPE

Constructor & Destructor Documentation

◆ GBR_CMP_PNP_METADATA()

GBR_CMP_PNP_METADATA::GBR_CMP_PNP_METADATA ( )
inline

Member Function Documentation

◆ ClearData()

void GBR_CMP_PNP_METADATA::ClearData ( )

◆ FormatCmpPnPMetadata()

wxString GBR_CMP_PNP_METADATA::FormatCmpPnPMetadata ( )
Returns
a string containing the formatted metadata in X2 syntax.
a string containing the formatted metadata in X2 syntax. one line by non empty data the orientation (.CRot) and mount type (.CMnt) are always generated

Definition at line 763 of file gbr_metadata.cpp.

764 {
765  wxString text;
766  wxString start_of_line( "%TO." );
767  wxString end_of_line( "*%\n" );
768 
769  wxString mounType[] =
770  {
771  "Other", "SMD", "TH"
772  };
773 
774  if( !m_Manufacturer.IsEmpty() )
775  text << start_of_line << "CMfr," << m_Manufacturer << end_of_line;
776 
777  if( !m_MPN.IsEmpty() )
778  text << start_of_line << "CMPN," << m_MPN << end_of_line;
779 
780  if( !m_Package.IsEmpty() )
781  text << start_of_line << "Cpkg," << m_Package << end_of_line;
782 
783  if( !m_Footprint.IsEmpty() )
784  text << start_of_line << "CFtp," << m_Footprint << end_of_line;
785 
786  if( !m_Value.IsEmpty() )
787  text << start_of_line << "CVal," << m_Value << end_of_line;
788 
789  if( !m_LibraryName.IsEmpty() )
790  text << start_of_line << "CLbN," << m_LibraryName << end_of_line;
791 
792  if( !m_LibraryDescr.IsEmpty() )
793  text << start_of_line << "CLbD," << m_LibraryDescr << end_of_line;
794 
795  text << start_of_line << "CMnt," << mounType[m_MountType] << end_of_line;
796  text << start_of_line << "CRot," << m_Orientation << end_of_line;
797 
798  return text;
799 }

References m_Footprint, m_LibraryDescr, m_LibraryName, m_Manufacturer, m_MountType, m_MPN, m_Orientation, m_Package, m_Value, and text.

Referenced by PLACEFILE_GERBER_WRITER::CreatePlaceFile().

Member Data Documentation

◆ m_Footprint

wxString GBR_CMP_PNP_METADATA::m_Footprint

◆ m_LibraryDescr

wxString GBR_CMP_PNP_METADATA::m_LibraryDescr

Definition at line 86 of file gbr_netlist_metadata.h.

Referenced by FormatCmpPnPMetadata().

◆ m_LibraryName

wxString GBR_CMP_PNP_METADATA::m_LibraryName

◆ m_Manufacturer

wxString GBR_CMP_PNP_METADATA::m_Manufacturer

Definition at line 81 of file gbr_netlist_metadata.h.

Referenced by ClearData(), and FormatCmpPnPMetadata().

◆ m_MountType

MOUNT_TYPE GBR_CMP_PNP_METADATA::m_MountType

◆ m_MPN

wxString GBR_CMP_PNP_METADATA::m_MPN

Definition at line 82 of file gbr_netlist_metadata.h.

Referenced by ClearData(), and FormatCmpPnPMetadata().

◆ m_Orientation

double GBR_CMP_PNP_METADATA::m_Orientation

◆ m_Package

wxString GBR_CMP_PNP_METADATA::m_Package

Definition at line 83 of file gbr_netlist_metadata.h.

Referenced by ClearData(), and FormatCmpPnPMetadata().

◆ m_Value

wxString GBR_CMP_PNP_METADATA::m_Value

The documentation for this class was generated from the following files: