KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcbplot.cpp
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) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
6 * Copyright (C) 1992-2024 KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#include <plotters/plotter.h>
27#include <pcbplot.h>
28#include <base_units.h>
29#include <lset.h>
30#include <locale_io.h>
31#include <reporter.h>
32#include <board.h>
34#include <plotcontroller.h>
35#include <pcb_plot_params.h>
36#include <wx/ffile.h>
37#include <dialog_plot.h>
38#include <build_version.h>
39#include <gbr_metadata.h>
40#include <render_settings.h>
41
42
43const wxString GetGerberProtelExtension( int aLayer )
44{
45 if( IsCopperLayer( aLayer ) )
46 {
47 if( aLayer == F_Cu )
48 return wxT( "gtl" );
49 else if( aLayer == B_Cu )
50 return wxT( "gbl" );
51 else
52 return wxString::Format( wxT( "g%d" ), aLayer+1 );
53 }
54 else
55 {
56 switch( aLayer )
57 {
58 case B_Adhes: return wxT( "gba" );
59 case F_Adhes: return wxT( "gta" );
60
61 case B_Paste: return wxT( "gbp" );
62 case F_Paste: return wxT( "gtp" );
63
64 case B_SilkS: return wxT( "gbo" );
65 case F_SilkS: return wxT( "gto" );
66
67 case B_Mask: return wxT( "gbs" );
68 case F_Mask: return wxT( "gts" );
69
70 case Edge_Cuts: return wxT( "gm1" );
71
72 case Dwgs_User:
73 case Cmts_User:
74 case Eco1_User:
75 case Eco2_User:
76 default: return wxT( "gbr" );
77 }
78 }
79}
80
81
82const wxString GetGerberFileFunctionAttribute( const BOARD* aBoard, int aLayer )
83{
84 wxString attrib;
85
86 switch( aLayer )
87 {
88 case F_Adhes:
89 attrib = wxT( "Glue,Top" );
90 break;
91
92 case B_Adhes:
93 attrib = wxT( "Glue,Bot" );
94 break;
95
96 case F_SilkS:
97 attrib = wxT( "Legend,Top" );
98 break;
99
100 case B_SilkS:
101 attrib = wxT( "Legend,Bot" );
102 break;
103
104 case F_Mask:
105 attrib = wxT( "Soldermask,Top" );
106 break;
107
108 case B_Mask:
109 attrib = wxT( "Soldermask,Bot" );
110 break;
111
112 case F_Paste:
113 attrib = wxT( "Paste,Top" );
114 break;
115
116 case B_Paste:
117 attrib = wxT( "Paste,Bot" );
118 break;
119
120 case Edge_Cuts:
121 // Board outline.
122 // Can be "Profile,NP" (Not Plated: usual) or "Profile,P"
123 // This last is the exception (Plated)
124 attrib = wxT( "Profile,NP" );
125 break;
126
127 case Dwgs_User:
128 attrib = wxT( "OtherDrawing,Comment" );
129 break;
130
131 case Cmts_User:
132 attrib = wxT( "Other,Comment" );
133 break;
134
135 case Eco1_User:
136 attrib = wxT( "Other,ECO1" );
137 break;
138
139 case Eco2_User:
140 attrib = wxT( "Other,ECO2" );
141 break;
142
143 case B_Fab:
144 // This is actually a assembly layer
145 attrib = wxT( "AssemblyDrawing,Bot" );
146 break;
147
148 case F_Fab:
149 // This is actually a assembly layer
150 attrib = wxT( "AssemblyDrawing,Top" );
151 break;
152
153 case B_Cu:
154 attrib.Printf( wxT( "Copper,L%d,Bot" ), aBoard->GetCopperLayerCount() );
155 break;
156
157 case F_Cu:
158 attrib = wxT( "Copper,L1,Top" );
159 break;
160
161 default:
162 if( IsCopperLayer( aLayer ) )
163 attrib.Printf( wxT( "Copper,L%d,Inr" ), aLayer+1 );
164 else
165 attrib.Printf( wxT( "Other,User" ), aLayer+1 );
166 break;
167 }
168
169 // This code adds a optional parameter: the type of copper layers.
170 // Because it is not used by Pcbnew (it can be used only by external autorouters)
171 // user do not really set this parameter.
172 // Therefore do not add it.
173 // However, this code is left here, for perhaps a future usage.
174#if 0
175 // Add the signal type of the layer, if relevant
176 if( IsCopperLayer( aLayer ) )
177 {
178 LAYER_T type = aBoard->GetLayerType( ToLAYER_ID( aLayer ) );
179
180 switch( type )
181 {
182 case LT_SIGNAL:
183 attrib += wxT( ",Signal" );
184 break;
185 case LT_POWER:
186 attrib += wxT( ",Plane" );
187 break;
188 case LT_MIXED:
189 attrib += wxT( ",Mixed" );
190 break;
191 default:
192 break; // do nothing (but avoid a warning for unhandled LAYER_T values from GCC)
193 }
194 }
195#endif
196
197 wxString fileFct;
198 fileFct.Printf( wxT( "%%TF.FileFunction,%s*%%" ), attrib );
199
200 return fileFct;
201}
202
203
204static const wxString GetGerberFilePolarityAttribute( int aLayer )
205{
206 /* build the string %TF.FilePolarity,Positive*%
207 * or %TF.FilePolarity,Negative*%
208 * an emply string for layers which do not use a polarity
209 *
210 * The value of the .FilePolarity specifies whether the image represents the
211 * presence or absence of material.
212 * This attribute can only be used when the file represents a pattern in a material layer,
213 * e.g. copper, solder mask, legend.
214 * Together with.FileFunction it defines the role of that image in
215 * the layer structure of the PCB.
216 * Note that the .FilePolarity attribute does not change the image -
217 * no attribute does.
218 * It changes the interpretation of the image.
219 * For example, in a copper layer in positive polarity a round flash generates a copper pad.
220 * In a copper layer in negative polarity it generates a clearance.
221 * Solder mask images usually represent solder mask openings and are then negative.
222 * This may be counter-intuitive.
223 */
224 int polarity = 0;
225
226 switch( aLayer )
227 {
228 case F_Adhes:
229 case B_Adhes:
230 case F_SilkS:
231 case B_SilkS:
232 case F_Paste:
233 case B_Paste:
234 polarity = 1;
235 break;
236
237 case F_Mask:
238 case B_Mask:
239 polarity = -1;
240 break;
241
242 default:
243 if( IsCopperLayer( aLayer ) )
244 polarity = 1;
245 break;
246 }
247
248 wxString filePolarity;
249
250 if( polarity == 1 )
251 filePolarity = wxT( "%TF.FilePolarity,Positive*%" );
252 if( polarity == -1 )
253 filePolarity = wxT( "%TF.FilePolarity,Negative*%" );
254
255 return filePolarity;
256}
257
258
259/* Add some X2 attributes to the file header, as defined in the
260 * Gerber file format specification J4 and "Revision 2015.06"
261 */
262
263
264// A helper function to convert a X2 attribute string to a X1 structured comment:
265static wxString& makeStringCompatX1( wxString& aText, bool aUseX1CompatibilityMode )
266{
267 if( aUseX1CompatibilityMode )
268 {
269 aText.Replace( wxT( "%" ), wxEmptyString );
270 aText.Prepend( wxT( "G04 #@! " ) );
271 }
272
273 return aText;
274}
275
276
277// A helper function to replace reserved chars (separators in gerber fields)
278// in a gerber string field.
279// reserved chars are replaced by _ (for ,) or an escaped sequence (for * and %)
280static void replaceReservedCharsField( wxString& aMsg )
281{
282 aMsg.Replace( wxT( "," ), wxT( "_" ) ); // can be replaced by \\u002C
283 aMsg.Replace( wxT( "*" ), wxT( "\\u002A" ) );
284 aMsg.Replace( wxT( "%" ), wxT( "\\u0025" ) );
285}
286
287
288void AddGerberX2Header( PLOTTER* aPlotter, const BOARD* aBoard, bool aUseX1CompatibilityMode )
289{
290 wxString text;
291
292 // Creates the TF,.GenerationSoftware. Format is:
293 // %TF,.GenerationSoftware,<vendor>,<application name>[,<application version>]*%
294 text.Printf( wxT( "%%TF.GenerationSoftware,KiCad,Pcbnew,%s*%%" ), GetBuildVersion() );
295 aPlotter->AddLineToHeader( makeStringCompatX1( text, aUseX1CompatibilityMode ) );
296
297 // creates the TF.CreationDate attribute:
300 aPlotter->AddLineToHeader( text );
301
302 // Creates the TF,.ProjectId. Format is (from Gerber file format doc):
303 // %TF.ProjectId,<project id>,<project GUID>,<revision id>*%
304 // <project id> is the name of the project, restricted to basic ASCII symbols only,
305 // Rem: <project id> accepts only ASCII 7 code (only basic ASCII codes are allowed in
306 // gerber files) and comma not accepted.
307 // All illegal chars will be replaced by underscore.
308 //
309 // <project GUID> is a string which is an unique id of a project.
310 // However Kicad does not handle such a project GUID, so it is built from the board name
311 wxFileName fn = aBoard->GetFileName();
312 wxString msg = fn.GetFullName();
313
314 // Build a <project GUID>, from the board name
315 wxString guid = GbrMakeProjectGUIDfromString( msg );
316
317 // build the <project id> string: this is the board short filename (without ext)
318 // and all non ASCII chars and reserved chars (, * % ) are replaced by '_'
319 msg = fn.GetName();
321
322 // build the <revision id> string. All non ASCII chars and reserved chars are replaced by '_'
323 wxString rev = ExpandTextVars( aBoard->GetTitleBlock().GetRevision(), aBoard->GetProject() );
325
326 if( rev.IsEmpty() )
327 rev = wxT( "rev?" );
328
329 text.Printf( wxT( "%%TF.ProjectId,%s,%s,%s*%%" ), msg.ToAscii(), guid, rev.ToAscii() );
330 aPlotter->AddLineToHeader( makeStringCompatX1( text, aUseX1CompatibilityMode ) );
331
332 // Add the TF.SameCoordinates to specify that all gerber files uses the same origin and
333 // orientation, and the registration between files is OK.
334 // The parameter of TF.SameCoordinates is a string that is common to all files using the
335 // same registration. The string value has no meaning; it is just a key.
336 // Because there is no mirroring/rotation in Kicad, only the plot offset origin can create
337 // incorrect registration, so we create a key from plot offset options.
338 //
339 // Currently the key is "Original" when using absolute Pcbnew coordinates, and the PY and PY
340 // position of the auxiliary axis when using it.
341 // If we ever add user-settable absolute Pcbnew coordinates, we'll need to change the way
342 // the key is built to ensure file only using the *same* axis have the same key.
343 wxString registration_id = wxT( "Original" );
344 VECTOR2I auxOrigin = aBoard->GetDesignSettings().GetAuxOrigin();
345
346 if( aBoard->GetPlotOptions().GetUseAuxOrigin() && auxOrigin.x && auxOrigin.y )
347 registration_id.Printf( wxT( "PX%xPY%x" ), auxOrigin.x, auxOrigin.y );
348
349 text.Printf( wxT( "%%TF.SameCoordinates,%s*%%" ), registration_id.GetData() );
350 aPlotter->AddLineToHeader( makeStringCompatX1( text, aUseX1CompatibilityMode ) );
351}
352
353
354void AddGerberX2Attribute( PLOTTER* aPlotter, const BOARD* aBoard, int aLayer,
355 bool aUseX1CompatibilityMode )
356{
357 AddGerberX2Header( aPlotter, aBoard, aUseX1CompatibilityMode );
358
359 wxString text;
360
361 // Add the TF.FileFunction
362 text = GetGerberFileFunctionAttribute( aBoard, aLayer );
363 aPlotter->AddLineToHeader( makeStringCompatX1( text, aUseX1CompatibilityMode ) );
364
365 // Add the TF.FilePolarity (for layers which support that)
367
368 if( !text.IsEmpty() )
369 aPlotter->AddLineToHeader( makeStringCompatX1( text, aUseX1CompatibilityMode ) );
370}
371
372
373void BuildPlotFileName( wxFileName* aFilename, const wxString& aOutputDir,
374 const wxString& aSuffix, const wxString& aExtension )
375{
376 // aFilename contains the base filename only (without path and extension)
377 // when calling this function.
378 // It is expected to be a valid filename (this is usually the board filename)
379 aFilename->SetPath( aOutputDir );
380
381 // Set the file extension
382 aFilename->SetExt( aExtension );
383
384 // remove leading and trailing spaces if any from the suffix, if
385 // something survives add it to the name;
386 // also the suffix can contain some not allowed chars in filename (/ \ . : and some others),
387 // so change them to underscore
388 // Remember it can be called from a python script, so the illegal chars
389 // have to be filtered here.
390 wxString suffix = aSuffix;
391 suffix.Trim( true );
392 suffix.Trim( false );
393
394 wxString badchars = wxFileName::GetForbiddenChars(wxPATH_DOS);
395 badchars.Append( "%." );
396
397 for( unsigned ii = 0; ii < badchars.Len(); ii++ )
398 suffix.Replace( badchars[ii], wxT("_") );
399
400 if( !suffix.IsEmpty() )
401 aFilename->SetName( aFilename->GetName() + wxT( "-" ) + suffix );
402}
403
404
406{
407 m_plotter = nullptr;
408 m_board = aBoard;
410}
411
412
414{
415 ClosePlot();
416}
417
418
419/*
420 * IMPORTANT: the locale during plots *MUST* be kept as C/POSIX using a LOCALE_IO object on the
421 * stack. This even when opening/closing the plotfile, as some drivers do I/O even then.
422 */
424{
425 LOCALE_IO toggle;
426
427 if( m_plotter )
428 {
430
431 delete m_plotter->RenderSettings();
432 delete m_plotter;
433
434 m_plotter = nullptr;
435 }
436}
437
438
439bool PLOT_CONTROLLER::OpenPlotfile( const wxString& aSuffix, PLOT_FORMAT aFormat,
440 const wxString& aSheetName, const wxString& aSheetPath )
441{
442 LOCALE_IO toggle;
443
444 // Save the current format: sadly some plot routines depends on this but the main reason
445 // is that the StartPlot method uses it to dispatch the plotter creation
446 GetPlotOptions().SetFormat( aFormat );
447
448 // Ensure that the previous plot is closed
449 ClosePlot();
450
451 // Now compute the full filename for the output and start the plot (after ensuring the
452 // output directory is OK).
453
454 std::function<bool( wxString* )> textResolver =
455 [&]( wxString* token ) -> bool
456 {
457 // Handles m_board->GetTitleBlock() *and* m_board->GetProject()
458 return m_board->ResolveTextVar( token, 0 );
459 };
460
461 wxString outputDirName = GetPlotOptions().GetOutputDirectory();
462 outputDirName = ExpandTextVars( outputDirName, &textResolver );
463 outputDirName = ExpandEnvVarSubstitutions( outputDirName, nullptr );
464
465 wxFileName outputDir = wxFileName::DirName( outputDirName );
466 wxString boardFilename = m_board->GetFileName();
467 PCB_LAYER_ID layer = ToLAYER_ID( GetLayer() );
468 wxString layerName = m_board->GetLayerName( layer );
469
470 if( EnsureFileDirectoryExists( &outputDir, boardFilename ) )
471 {
472 // outputDir contains now the full path of plot files
473 m_plotFile = boardFilename;
474 m_plotFile.SetPath( outputDir.GetPath() );
475 wxString fileExt = GetDefaultPlotExtension( aFormat );
476
477 // Gerber format *can* use layer-specific file extensions (this is no longer best
478 // practice as the official file ext is now .gbr).
479 if( GetPlotOptions().GetFormat() == PLOT_FORMAT::GERBER
480 && GetPlotOptions().GetUseGerberProtelExtensions() )
481 {
482 fileExt = GetGerberProtelExtension( GetLayer() );
483 }
484
485 // Build plot filenames from the board name and layer names:
486 BuildPlotFileName( &m_plotFile, outputDir.GetPath(), aSuffix, fileExt );
487
488 m_plotter = StartPlotBoard( m_board, &GetPlotOptions(), layer, layerName,
489 m_plotFile.GetFullPath(), aSheetName, aSheetPath );
490 }
491
492 return ( m_plotter != nullptr );
493}
494
495
497{
498 LOCALE_IO toggle;
499
500 // No plot open, nothing to do...
501 if( !m_plotter )
502 return false;
503
504 // Fully delegated to the parent
507 return true;
508}
509
510
511bool PLOT_CONTROLLER::PlotLayers( const LSEQ& aLayerSequence )
512{
513 LOCALE_IO toggle;
514
515 // No plot open, nothing to do...
516 if( !m_plotter )
517 return false;
518
519 // Fully delegated to the parent
520 PlotBoardLayers( m_board, m_plotter, aLayerSequence, GetPlotOptions() );
522 return true;
523}
524
525
526void PLOT_CONTROLLER::SetColorMode( bool aColorMode )
527{
528 if( !m_plotter )
529 return;
530
531 m_plotter->SetColorMode( aColorMode );
532}
533
534
536{
537 if( !m_plotter )
538 return false;
539
540 return m_plotter->GetColorMode();
541}
LAYER_T
The allowed types of layers, same as Specctra DSN spec.
Definition: board.h:152
@ LT_POWER
Definition: board.h:155
@ LT_MIXED
Definition: board.h:156
@ LT_SIGNAL
Definition: board.h:154
wxString GetBuildVersion()
Get the full KiCad version string.
const VECTOR2I & GetAuxOrigin()
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:289
LAYER_T GetLayerType(PCB_LAYER_ID aLayer) const
Return the type of the copper layer given by aLayer.
Definition: board.cpp:610
bool ResolveTextVar(wxString *token, int aDepth) const
Definition: board.cpp:431
TITLE_BLOCK & GetTitleBlock()
Definition: board.h:688
int GetCopperLayerCount() const
Definition: board.cpp:733
const wxString & GetFileName() const
Definition: board.h:326
const PCB_PLOT_PARAMS & GetPlotOptions() const
Definition: board.h:685
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition: board.cpp:575
PROJECT * GetProject() const
Definition: board.h:490
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:874
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: locale_io.h:49
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
Definition: lseq.h:47
bool GetUseAuxOrigin() const
wxString GetOutputDirectory() const
void SetFormat(PLOT_FORMAT aFormat)
Base plotter engine class.
Definition: plotter.h:105
virtual bool EndPlot()=0
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:136
bool GetColorMode() const
Definition: plotter.h:133
void AddLineToHeader(const wxString &aExtraString)
Add a line to the list of free lines to print at the beginning of the file.
Definition: plotter.h:164
virtual void SetColorMode(bool aColorMode)
Plot in B/W or color.
Definition: plotter.h:132
~PLOT_CONTROLLER()
Ensure that the last plot is closed.
Definition: pcbplot.cpp:413
bool GetColorMode()
Definition: pcbplot.cpp:535
wxFileName m_plotFile
bool PlotLayer()
Plot a single layer on the current plotfile m_plotLayer is the layer to plot.
Definition: pcbplot.cpp:496
PLOT_CONTROLLER(BOARD *aBoard)
Batch plotter constructor, nothing interesting here.
Definition: pcbplot.cpp:405
void SetColorMode(bool aColorMode)
Choose color or bland and white plot mode.
Definition: pcbplot.cpp:526
bool OpenPlotfile(const wxString &aSuffix, PLOT_FORMAT aFormat, const wxString &aSheetName=wxEmptyString, const wxString &aSheetPath=wxEmptyString)
Open a new plotfile; works as a factory for plotter objects/.
Definition: pcbplot.cpp:439
bool PlotLayers(const LSEQ &aLayerSequence)
Plot a sequence of board layer IDs in the given order.
Definition: pcbplot.cpp:511
PLOTTER * m_plotter
This is the plotter object; it starts NULL and become instantiated when a plotfile is.
PCB_PLOT_PARAMS & GetPlotOptions()
Accessor to the plot parameters and options.
void ClosePlot()
Close the current plot, nothing happens if it isn't open.
Definition: pcbplot.cpp:423
const wxString & GetRevision() const
Definition: title_block.h:86
const wxString ExpandEnvVarSubstitutions(const wxString &aString, const PROJECT *aProject)
Replace any environment variable & text variable references with their values.
Definition: common.cpp:343
bool EnsureFileDirectoryExists(wxFileName *aTargetFullFileName, const wxString &aBaseFilename, REPORTER *aReporter)
Make aTargetFullFileName absolute and create the path of this file if it doesn't yet exist.
Definition: common.cpp:371
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject)
Definition: common.cpp:59
wxString GetDefaultPlotExtension(PLOT_FORMAT aFormat)
Returns the default plot extension for a format.
wxString GbrMakeProjectGUIDfromString(const wxString &aText)
Build a project GUID using format RFC4122 Version 1 or 4 from the project name, because a KiCad proje...
wxString GbrMakeCreationDateAttributeString(GBR_NC_STRING_FORMAT aFormat)
Handle special data (items attributes) during plot.
@ GBR_NC_STRING_FORMAT_X1
Definition: gbr_metadata.h:61
@ GBR_NC_STRING_FORMAT_X2
Definition: gbr_metadata.h:62
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
Definition: layer_ids.h:531
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
@ B_Adhes
Definition: layer_ids.h:97
@ Edge_Cuts
Definition: layer_ids.h:113
@ Dwgs_User
Definition: layer_ids.h:109
@ F_Paste
Definition: layer_ids.h:101
@ Cmts_User
Definition: layer_ids.h:110
@ F_Adhes
Definition: layer_ids.h:98
@ B_Mask
Definition: layer_ids.h:106
@ B_Cu
Definition: layer_ids.h:95
@ Eco1_User
Definition: layer_ids.h:111
@ F_Mask
Definition: layer_ids.h:107
@ B_Paste
Definition: layer_ids.h:100
@ F_Fab
Definition: layer_ids.h:120
@ F_SilkS
Definition: layer_ids.h:104
@ UNDEFINED_LAYER
Definition: layer_ids.h:61
@ Eco2_User
Definition: layer_ids.h:112
@ B_SilkS
Definition: layer_ids.h:103
@ F_Cu
Definition: layer_ids.h:64
@ B_Fab
Definition: layer_ids.h:119
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:875
const wxString GetGerberProtelExtension(int aLayer)
Definition: pcbplot.cpp:43
static wxString & makeStringCompatX1(wxString &aText, bool aUseX1CompatibilityMode)
Definition: pcbplot.cpp:265
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...
Definition: pcbplot.cpp:288
const wxString GetGerberFileFunctionAttribute(const BOARD *aBoard, int aLayer)
Return the "file function" attribute for aLayer, as defined in the Gerber file format specification J...
Definition: pcbplot.cpp:82
static void replaceReservedCharsField(wxString &aMsg)
Definition: pcbplot.cpp:280
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...
Definition: pcbplot.cpp:354
void BuildPlotFileName(wxFileName *aFilename, const wxString &aOutputDir, const wxString &aSuffix, const wxString &aExtension)
Complete a plot filename.
Definition: pcbplot.cpp:373
static const wxString GetGerberFilePolarityAttribute(int aLayer)
Definition: pcbplot.cpp:204
void PlotOneBoardLayer(BOARD *aBoard, PLOTTER *aPlotter, PCB_LAYER_ID aLayer, const PCB_PLOT_PARAMS &aPlotOpt)
Plot one copper or technical layer.
void PlotBoardLayers(BOARD *aBoard, PLOTTER *aPlotter, const LSEQ &aLayerSequence, const PCB_PLOT_PARAMS &aPlotOptions)
Plot a sequence of board layer IDs.
void PlotInteractiveLayer(BOARD *aBoard, PLOTTER *aPlotter, const PCB_PLOT_PARAMS &aPlotOpt)
Plot interactive items (hypertext links, properties, etc.).
PLOTTER * StartPlotBoard(BOARD *aBoard, const PCB_PLOT_PARAMS *aPlotOpts, int aLayer, const wxString &aLayerName, const wxString &aFullFileName, const wxString &aSheetName, const wxString &aSheetPath)
Open a new plotfile using the options (and especially the format) specified in the options and prepar...
PLOT_FORMAT
The set of supported output plot formats.
Definition: plotter.h:65