45 else if( aLayer ==
B_Cu )
54 case B_Adhes:
return wxT(
"gba" );
55 case F_Adhes:
return wxT(
"gta" );
57 case B_Paste:
return wxT(
"gbp" );
58 case F_Paste:
return wxT(
"gtp" );
60 case B_SilkS:
return wxT(
"gbo" );
61 case F_SilkS:
return wxT(
"gto" );
63 case B_Mask:
return wxT(
"gbs" );
64 case F_Mask:
return wxT(
"gts" );
72 default:
return wxT(
"gbr" );
86 attrib = wxT(
"Glue,Top" );
90 attrib = wxT(
"Glue,Bot" );
94 attrib = wxT(
"Legend,Top" );
98 attrib = wxT(
"Legend,Bot" );
102 attrib = wxT(
"Soldermask,Top" );
106 attrib = wxT(
"Soldermask,Bot" );
110 attrib = wxT(
"Paste,Top" );
114 attrib = wxT(
"Paste,Bot" );
121 attrib = wxT(
"Profile,NP" );
125 attrib = wxT(
"OtherDrawing,Comment" );
129 attrib = wxT(
"Other,Comment" );
133 attrib = wxT(
"Other,ECO1" );
137 attrib = wxT(
"Other,ECO2" );
142 attrib = wxT(
"AssemblyDrawing,Bot" );
147 attrib = wxT(
"AssemblyDrawing,Top" );
155 attrib = wxT(
"Copper,L1,Top" );
163 int ly_id = ( ( aLayer -
B_Cu ) / 2 ) + 1;
164 attrib.Printf( wxT(
"Copper,L%d,Inr" ), ly_id );
167 attrib.Printf( wxT(
"Other,User" ), aLayer+1 );
185 attrib += wxT(
",Signal" );
188 attrib += wxT(
",Plane" );
191 attrib += wxT(
",Mixed" );
200 fileFct.Printf( wxT(
"%%TF.FileFunction,%s*%%" ), attrib );
250 wxString filePolarity;
253 filePolarity = wxT(
"%TF.FilePolarity,Positive*%" );
255 filePolarity = wxT(
"%TF.FilePolarity,Negative*%" );
269 if( aUseX1CompatibilityMode )
271 aText.Replace( wxT(
"%" ), wxEmptyString );
272 aText.Prepend( wxT(
"G04 #@! " ) );
284 aMsg.Replace( wxT(
"," ), wxT(
"_" ) );
285 aMsg.Replace( wxT(
"*" ), wxT(
"\\u002A" ) );
286 aMsg.Replace( wxT(
"%" ), wxT(
"\\u0025" ) );
314 wxString msg = fn.GetFullName();
331 text.Printf( wxT(
"%%TF.ProjectId,%s,%s,%s*%%" ), msg.ToAscii(), guid, rev.ToAscii() );
345 wxString registration_id = wxT(
"Original" );
349 registration_id.Printf( wxT(
"PX%xPY%x" ), auxOrigin.
x, auxOrigin.
y );
351 text.Printf( wxT(
"%%TF.SameCoordinates,%s*%%" ), registration_id.GetData() );
357 bool aUseX1CompatibilityMode )
370 if( !
text.IsEmpty() )
LAYER_T
The allowed types of layers, same as Specctra DSN spec.
wxString GetBuildVersion()
Get the full KiCad version string.
const VECTOR2I & GetAuxOrigin() const
Information pertinent to a Pcbnew printed circuit board.
LAYER_T GetLayerType(PCB_LAYER_ID aLayer) const
Return the type of the copper layer given by aLayer.
TITLE_BLOCK & GetTitleBlock()
int GetCopperLayerCount() const
const wxString & GetFileName() const
const PCB_PLOT_PARAMS & GetPlotOptions() const
PROJECT * GetProject() const
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
bool GetUseAuxOrigin() const
Base plotter engine class.
void AddLineToHeader(const wxString &aExtraString)
Add a line to the list of free lines to print at the beginning of the file.
const wxString & GetRevision() const
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject, int aFlags)
bool IsCopperLayer(int aLayerId)
Test whether a layer is a copper layer.
size_t CopperLayerToOrdinal(PCB_LAYER_ID aLayer)
Converts KiCad copper layer enum to an ordinal between the front and back layers.
PCB_LAYER_ID ToLAYER_ID(int aLayer)
const wxString GetGerberProtelExtension(int aLayer)
static wxString & makeStringCompatX1(wxString &aText, bool aUseX1CompatibilityMode)
void AddGerberX2Header(PLOTTER *aPlotter, const BOARD *aBoard, bool aUseX1CompatibilityMode)
Calculate some X2 attributes as defined in the Gerber file format specification J4 (chapter 5) and ad...
const wxString GetGerberFileFunctionAttribute(const BOARD *aBoard, int aLayer)
Return the "file function" attribute for aLayer, as defined in the Gerber file format specification J...
static void replaceReservedCharsField(wxString &aMsg)
void AddGerberX2Attribute(PLOTTER *aPlotter, const BOARD *aBoard, int aLayer, bool aUseX1CompatibilityMode)
Calculate some X2 attributes as defined in the Gerber file format specification and add them to the g...
static const wxString GetGerberFilePolarityAttribute(int aLayer)
VECTOR2< int32_t > VECTOR2I