KiCad PCB EDA Suite
GBR_CMP_PNP_METADATA Class Reference

this class handle info which can be added in a gerber P&P file as attribute of a component 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. 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

this class handle info which can be added in a gerber P&P file as attribute of a component 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 supppier name. SPN is a field with the supppier part name

Definition at line 55 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 formated metadata in X2 syntax. one line by non empty data the orientation is always generated
a string containing the formated metadata in X2 syntax. one line by non empty data the orientation (.CRot) and mount type (.CMnt) are always generated

Definition at line 729 of file gbr_metadata.cpp.

730 {
731  wxString text;
732  wxString start_of_line( "%TO.");
733  wxString end_of_line( "*%\n" );
734 
735  wxString mounType[] =
736  {
737  "Other", "SMD", "TH"
738  };
739 
740  if( !m_Manufacturer.IsEmpty() )
741  text << start_of_line << "CMfr," << m_Manufacturer << end_of_line;
742 
743  if( !m_MPN.IsEmpty() )
744  text << start_of_line << "CMPN," << m_MPN << end_of_line;
745 
746  if( !m_Package.IsEmpty() )
747  text << start_of_line << "Cpkg," << m_Package << end_of_line;
748 
749  if( !m_Footprint.IsEmpty() )
750  text << start_of_line << "CFtp," << m_Footprint << end_of_line;
751 
752  if( !m_Value.IsEmpty() )
753  text << start_of_line << "CVal," << m_Value << end_of_line;
754 
755  if( !m_LibraryName.IsEmpty() )
756  text << start_of_line << "CLbN," << m_LibraryName << end_of_line;
757 
758  if( !m_LibraryDescr.IsEmpty() )
759  text << start_of_line << "CLbD," << m_LibraryDescr << end_of_line;
760 
761  text << start_of_line << "CMnt," << mounType[m_MountType] << end_of_line;
762  text << start_of_line << "CRot," << m_Orientation << end_of_line;
763 
764  return text;
765 }

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

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 71 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 66 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 67 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 68 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: