49 else if( aLayer ==
B_Cu )
58 case B_Adhes:
return wxT(
"gba" );
59 case F_Adhes:
return wxT(
"gta" );
61 case B_Paste:
return wxT(
"gbp" );
62 case F_Paste:
return wxT(
"gtp" );
64 case B_SilkS:
return wxT(
"gbo" );
65 case F_SilkS:
return wxT(
"gto" );
67 case B_Mask:
return wxT(
"gbs" );
68 case F_Mask:
return wxT(
"gts" );
76 default:
return wxT(
"gbr" );
90 attrib = wxT(
"Glue,Top" );
94 attrib = wxT(
"Glue,Bot" );
98 attrib = wxT(
"Legend,Top" );
102 attrib = wxT(
"Legend,Bot" );
106 attrib = wxT(
"Soldermask,Top" );
110 attrib = wxT(
"Soldermask,Bot" );
114 attrib = wxT(
"Paste,Top" );
118 attrib = wxT(
"Paste,Bot" );
125 attrib = wxT(
"Profile,NP" );
129 attrib = wxT(
"OtherDrawing,Comment" );
133 attrib = wxT(
"Other,Comment" );
137 attrib = wxT(
"Other,ECO1" );
141 attrib = wxT(
"Other,ECO2" );
146 attrib = wxT(
"AssemblyDrawing,Bot" );
151 attrib = wxT(
"AssemblyDrawing,Top" );
159 attrib = wxT(
"Copper,L1,Top" );
167 int ly_id = ( ( aLayer -
B_Cu ) / 2 ) + 1;
168 attrib.Printf( wxT(
"Copper,L%d,Inr" ), ly_id );
171 attrib.Printf( wxT(
"Other,User" ), aLayer+1 );
189 attrib += wxT(
",Signal" );
192 attrib += wxT(
",Plane" );
195 attrib += wxT(
",Mixed" );
204 fileFct.Printf( wxT(
"%%TF.FileFunction,%s*%%" ), attrib );
254 wxString filePolarity;
257 filePolarity = wxT(
"%TF.FilePolarity,Positive*%" );
259 filePolarity = wxT(
"%TF.FilePolarity,Negative*%" );
273 if( aUseX1CompatibilityMode )
275 aText.Replace( wxT(
"%" ), wxEmptyString );
276 aText.Prepend( wxT(
"G04 #@! " ) );
288 aMsg.Replace( wxT(
"," ), wxT(
"_" ) );
289 aMsg.Replace( wxT(
"*" ), wxT(
"\\u002A" ) );
290 aMsg.Replace( wxT(
"%" ), wxT(
"\\u0025" ) );
318 wxString msg = fn.GetFullName();
335 text.Printf( wxT(
"%%TF.ProjectId,%s,%s,%s*%%" ), msg.ToAscii(), guid, rev.ToAscii() );
349 wxString registration_id = wxT(
"Original" );
353 registration_id.Printf( wxT(
"PX%xPY%x" ), auxOrigin.
x, auxOrigin.
y );
355 text.Printf( wxT(
"%%TF.SameCoordinates,%s*%%" ), registration_id.GetData() );
361 bool aUseX1CompatibilityMode )
374 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