KiCad PCB EDA Suite
plot_auxiliary_data.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
33 #ifndef PLOT_EXTRA_DATA_H
34 #define PLOT_EXTRA_DATA_H
35 
36 #include <gbr_netlist_metadata.h>
37 
38 
39 // this class handle info which can be added in a gerber file as attribute
40 // of an aperture, by the %TA.AperFunction command
41 // This attribute is added when creating a new aperture (command %ADDxx)
42 // Only one aperture attribute can be added to a given aperture
43 //
45 {
46 public:
48  {
64  };
65 
68  {}
69 
73  static std::string GetAttributeName( GBR_APERTURE_ATTRIB aAttribute );
74  std::string GetAttributeName()
75  {
77  }
78 
83  static std::string FormatAttribute( GBR_APERTURE_ATTRIB aAttribute );
84  std::string FormatAttribute()
85  {
87  }
88 
89  // The id of the aperture attribute
91 };
92 
93 // this class handle metadata which can be added in a gerber file as attribute
94 // in X2 format
96 {
97 public:
99 
101  {
102  m_ApertureMetadata.m_ApertAttribute = aApertAttribute;
103  }
104 
106  {
108  }
109 
110  void SetNetAttribType( int aNetAttribType )
111  {
112  m_NetlistMetadata.m_NetAttribType = aNetAttribType;
113  }
114 
115  int GetNetAttribType() const
116  {
118  }
119 
120  void SetNetName( const wxString& aNetname ) { m_NetlistMetadata.m_Netname = aNetname; }
121  void SetPadName( const wxString& aPadname ) { m_NetlistMetadata.m_Padname = aPadname; }
122  void SetCmpReference( const wxString& aComponentRef ) { m_NetlistMetadata.m_Cmpref = aComponentRef; }
123 
126 };
127 
136 std::string formatStringToGerber( const wxString& aString );
137 
151 bool FormatNetAttribute( std::string& aPrintedText, std::string& aLastNetAttributes,
152  GBR_NETLIST_METADATA* aData, bool& aClearPreviousAttributes );
153 
154 #endif // PLOT_EXTRA_DATA_H
void SetPadName(const wxString &aPadname)
std::string formatStringToGerber(const wxString &aString)
This helper function "normalize" aString and convert it to a Gerber std::string Normalisation means c...
aperture used for edge connecto pad (outer layers)
aperture used for heat sink pad (typically for SMDs)
void SetNetAttribType(int aNetAttribType)
wxString m_Cmpref
the component reference parent of the data
aperture used for through hole component on outer layer
bool FormatNetAttribute(std::string &aPrintedText, std::string &aLastNetAttributes, GBR_NETLIST_METADATA *aData, bool &aClearPreviousAttributes)
Generates the string to print to a gerber file, to set a net attribute for a graphic object...
aperture used for SMD pad. Excluded BGA pads which have their own type
aperture used for BGA pad with a solder mask defined by the solder mask
wxString m_Padname
for a flashed pad: the pad name ((TO.P attribute)
wxString m_Netname
for items associated to a net: the netname
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB GetApertureAttrib()
std::string GetAttributeName()
aperture used for mechanical pads (NPTH)
aperture used for BGA pads with a solder mask defined by the copper shape
aperture used for connected items like tracks (not vias)
void SetNetName(const wxString &aNetname)
aperture used for SMD pad with a solder mask defined by the solder mask
void SetApertureAttrib(GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB aApertAttribute)
GBR_NETLIST_METADATA m_NetlistMetadata
aperture used for not connected items (texts, outlines on copper)
int GetNetAttribType() const
void SetCmpReference(const wxString &aComponentRef)
GBR_APERTURE_METADATA m_ApertureMetadata
GBR_APERTURE_ATTRIB m_ApertAttribute
int m_NetAttribType
the type of net info (used to define the gerber string to create)