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
87 switch( aLayer )
88 {
89 case F_Adhes:
90 attrib = wxT( "Glue,Top" );
91 break;
92
93 case B_Adhes:
94 attrib = wxT( "Glue,Bot" );
95 break;
96
97 case F_SilkS:
98 attrib = wxT( "Legend,Top" );
99 break;
100
101 case B_SilkS:
102 attrib = wxT( "Legend,Bot" );
103 break;
104
105 case F_Mask:
106 attrib = wxT( "Soldermask,Top" );
107 break;
108
109 case B_Mask:
110 attrib = wxT( "Soldermask,Bot" );
111 break;
112
113 case F_Paste:
114 attrib = wxT( "Paste,Top" );
115 break;
116
117 case B_Paste:
118 attrib = wxT( "Paste,Bot" );
119 break;
120
121 case Edge_Cuts:
122 // Board outline.
123 // Can be "Profile,NP" (Not Plated: usual) or "Profile,P"
124 // This last is the exception (Plated)
125 attrib = wxT( "Profile,NP" );
126 break;
127
128 case Dwgs_User:
129 attrib = wxT( "OtherDrawing,Comment" );
130 break;
131
132 case Cmts_User:
133 attrib = wxT( "Other,Comment" );
134 break;
135
136 case Eco1_User:
137 attrib = wxT( "Other,ECO1" );
138 break;
139
140 case Eco2_User:
141 attrib = wxT( "Other,ECO2" );
142 break;
143
144 case B_Fab:
145 // This is actually a assembly layer
146 attrib = wxT( "AssemblyDrawing,Bot" );
147 break;
148
149 case F_Fab:
150 // This is actually a assembly layer
151 attrib = wxT( "AssemblyDrawing,Top" );
152 break;
153
154 case B_Cu:
155 attrib.Printf( wxT( "Copper,L%d,Bot" ), aBoard->GetCopperLayerCount() );
156 break;
157
158 case F_Cu:
159 attrib = wxT( "Copper,L1,Top" );
160 break;
161
162 default:
163 if( IsCopperLayer( aLayer ) )
164 {
165 // aLayer use even values, and the first internal layer
166 // is B_Cu + 2. And in gerber file, layer id is 2 (1 is F_Cu)
167 int ly_id = ( ( aLayer - B_Cu ) / 2 ) + 1;
168 attrib.Printf( wxT( "Copper,L%d,Inr" ), ly_id );
169 }
170 else
171 attrib.Printf( wxT( "Other,User" ), aLayer+1 );
172 break;
173 }
174
175 // This code adds a optional parameter: the type of copper layers.
176 // Because it is not used by Pcbnew (it can be used only by external autorouters)
177 // user do not really set this parameter.
178 // Therefore do not add it.
179 // However, this code is left here, for perhaps a future usage.
180#if 0
181 // Add the signal type of the layer, if relevant
182 if( IsCopperLayer( aLayer ) )
183 {
184 LAYER_T type = aBoard->GetLayerType( ToLAYER_ID( aLayer ) );
185
186 switch( type )
187 {
188 case LT_SIGNAL:
189 attrib += wxT( ",Signal" );
190 break;
191 case LT_POWER:
192 attrib += wxT( ",Plane" );
193 break;
194 case LT_MIXED:
195 attrib += wxT( ",Mixed" );
196 break;
197 default:
198 break; // do nothing (but avoid a warning for unhandled LAYER_T values from GCC)
199 }
200 }
201#endif
202
203 wxString fileFct;
204 fileFct.Printf( wxT( "%%TF.FileFunction,%s*%%" ), attrib );
205
206 return fileFct;
207}
208
209
210static const wxString GetGerberFilePolarityAttribute( int aLayer )
211{
212 /* build the string %TF.FilePolarity,Positive*%
213 * or %TF.FilePolarity,Negative*%
214 * an emply string for layers which do not use a polarity
215 *
216 * The value of the .FilePolarity specifies whether the image represents the
217 * presence or absence of material.
218 * This attribute can only be used when the file represents a pattern in a material layer,
219 * e.g. copper, solder mask, legend.
220 * Together with.FileFunction it defines the role of that image in
221 * the layer structure of the PCB.
222 * Note that the .FilePolarity attribute does not change the image -
223 * no attribute does.
224 * It changes the interpretation of the image.
225 * For example, in a copper layer in positive polarity a round flash generates a copper pad.
226 * In a copper layer in negative polarity it generates a clearance.
227 * Solder mask images usually represent solder mask openings and are then negative.
228 * This may be counter-intuitive.
229 */
230 int polarity = 0;
231
232 switch( aLayer )
233 {
234 case F_Adhes:
235 case B_Adhes:
236 case F_SilkS:
237 case B_SilkS:
238 case F_Paste:
239 case B_Paste:
240 polarity = 1;
241 break;
242
243 case F_Mask:
244 case B_Mask:
245 polarity = -1;
246 break;
247
248 default:
249 if( IsCopperLayer( aLayer ) )
250 polarity = 1;
251 break;
252 }
253
254 wxString filePolarity;
255
256 if( polarity == 1 )
257 filePolarity = wxT( "%TF.FilePolarity,Positive*%" );
258 if( polarity == -1 )
259 filePolarity = wxT( "%TF.FilePolarity,Negative*%" );
260
261 return filePolarity;
262}
263
264
265/* Add some X2 attributes to the file header, as defined in the
266 * Gerber file format specification J4 and "Revision 2015.06"
267 */
268
269
270// A helper function to convert a X2 attribute string to a X1 structured comment:
271static wxString& makeStringCompatX1( wxString& aText, bool aUseX1CompatibilityMode )
272{
273 if( aUseX1CompatibilityMode )
274 {
275 aText.Replace( wxT( "%" ), wxEmptyString );
276 aText.Prepend( wxT( "G04 #@! " ) );
277 }
278
279 return aText;
280}
281
282
283// A helper function to replace reserved chars (separators in gerber fields)
284// in a gerber string field.
285// reserved chars are replaced by _ (for ,) or an escaped sequence (for * and %)
286static void replaceReservedCharsField( wxString& aMsg )
287{
288 aMsg.Replace( wxT( "," ), wxT( "_" ) ); // can be replaced by \\u002C
289 aMsg.Replace( wxT( "*" ), wxT( "\\u002A" ) );
290 aMsg.Replace( wxT( "%" ), wxT( "\\u0025" ) );
291}
292
293
294void AddGerberX2Header( PLOTTER* aPlotter, const BOARD* aBoard, bool aUseX1CompatibilityMode )
295{
296 wxString text;
297
298 // Creates the TF,.GenerationSoftware. Format is:
299 // %TF,.GenerationSoftware,<vendor>,<application name>[,<application version>]*%
300 text.Printf( wxT( "%%TF.GenerationSoftware,KiCad,Pcbnew,%s*%%" ), GetBuildVersion() );
301 aPlotter->AddLineToHeader( makeStringCompatX1( text, aUseX1CompatibilityMode ) );
302
303 // creates the TF.CreationDate attribute:
306 aPlotter->AddLineToHeader( text );
307
308 // Creates the TF,.ProjectId. Format is (from Gerber file format doc):
309 // %TF.ProjectId,<project id>,<project GUID>,<revision id>*%
310 // <project id> is the name of the project, restricted to basic ASCII symbols only,
311 // Rem: <project id> accepts only ASCII 7 code (only basic ASCII codes are allowed in
312 // gerber files) and comma not accepted.
313 // All illegal chars will be replaced by underscore.
314 //
315 // <project GUID> is a string which is an unique id of a project.
316 // However Kicad does not handle such a project GUID, so it is built from the board name
317 wxFileName fn = aBoard->GetFileName();
318 wxString msg = fn.GetFullName();
319
320 // Build a <project GUID>, from the board name
321 wxString guid = GbrMakeProjectGUIDfromString( msg );
322
323 // build the <project id> string: this is the board short filename (without ext)
324 // and all non ASCII chars and reserved chars (, * % ) are replaced by '_'
325 msg = fn.GetName();
327
328 // build the <revision id> string. All non ASCII chars and reserved chars are replaced by '_'
329 wxString rev = ExpandTextVars( aBoard->GetTitleBlock().GetRevision(), aBoard->GetProject() );
331
332 if( rev.IsEmpty() )
333 rev = wxT( "rev?" );
334
335 text.Printf( wxT( "%%TF.ProjectId,%s,%s,%s*%%" ), msg.ToAscii(), guid, rev.ToAscii() );
336 aPlotter->AddLineToHeader( makeStringCompatX1( text, aUseX1CompatibilityMode ) );
337
338 // Add the TF.SameCoordinates to specify that all gerber files uses the same origin and
339 // orientation, and the registration between files is OK.
340 // The parameter of TF.SameCoordinates is a string that is common to all files using the
341 // same registration. The string value has no meaning; it is just a key.
342 // Because there is no mirroring/rotation in Kicad, only the plot offset origin can create
343 // incorrect registration, so we create a key from plot offset options.
344 //
345 // Currently the key is "Original" when using absolute Pcbnew coordinates, and the PY and PY
346 // position of the auxiliary axis when using it.
347 // If we ever add user-settable absolute Pcbnew coordinates, we'll need to change the way
348 // the key is built to ensure file only using the *same* axis have the same key.
349 wxString registration_id = wxT( "Original" );
350 VECTOR2I auxOrigin = aBoard->GetDesignSettings().GetAuxOrigin();
351
352 if( aBoard->GetPlotOptions().GetUseAuxOrigin() && auxOrigin.x && auxOrigin.y )
353 registration_id.Printf( wxT( "PX%xPY%x" ), auxOrigin.x, auxOrigin.y );
354
355 text.Printf( wxT( "%%TF.SameCoordinates,%s*%%" ), registration_id.GetData() );
356 aPlotter->AddLineToHeader( makeStringCompatX1( text, aUseX1CompatibilityMode ) );
357}
358
359
360void AddGerberX2Attribute( PLOTTER* aPlotter, const BOARD* aBoard, int aLayer,
361 bool aUseX1CompatibilityMode )
362{
363 AddGerberX2Header( aPlotter, aBoard, aUseX1CompatibilityMode );
364
365 wxString text;
366
367 // Add the TF.FileFunction
368 text = GetGerberFileFunctionAttribute( aBoard, aLayer );
369 aPlotter->AddLineToHeader( makeStringCompatX1( text, aUseX1CompatibilityMode ) );
370
371 // Add the TF.FilePolarity (for layers which support that)
373
374 if( !text.IsEmpty() )
375 aPlotter->AddLineToHeader( makeStringCompatX1( text, aUseX1CompatibilityMode ) );
376}
377
378
379void BuildPlotFileName( wxFileName* aFilename, const wxString& aOutputDir,
380 const wxString& aSuffix, const wxString& aExtension )
381{
382 // aFilename contains the base filename only (without path and extension)
383 // when calling this function.
384 // It is expected to be a valid filename (this is usually the board filename)
385 aFilename->SetPath( aOutputDir );
386
387 // Set the file extension
388 aFilename->SetExt( aExtension );
389
390 // remove leading and trailing spaces if any from the suffix, if
391 // something survives add it to the name;
392 // also the suffix can contain some not allowed chars in filename (/ \ . : and some others),
393 // so change them to underscore
394 // Remember it can be called from a python script, so the illegal chars
395 // have to be filtered here.
396 wxString suffix = aSuffix;
397 suffix.Trim( true );
398 suffix.Trim( false );
399
400 wxString badchars = wxFileName::GetForbiddenChars(wxPATH_DOS);
401 badchars.Append( "%." );
402
403 for( unsigned ii = 0; ii < badchars.Len(); ii++ )
404 suffix.Replace( badchars[ii], wxT("_") );
405
406 if( !suffix.IsEmpty() )
407 aFilename->SetName( aFilename->GetName() + wxT( "-" ) + suffix );
408}
409
410
412{
413 m_plotter = nullptr;
414 m_board = aBoard;
416}
417
418
420{
421 ClosePlot();
422}
423
424
425/*
426 * IMPORTANT: the locale during plots *MUST* be kept as C/POSIX using a LOCALE_IO object on the
427 * stack. This even when opening/closing the plotfile, as some drivers do I/O even then.
428 */
430{
431 LOCALE_IO toggle;
432
433 if( m_plotter )
434 {
436
437 delete m_plotter->RenderSettings();
438 delete m_plotter;
439
440 m_plotter = nullptr;
441 }
442}
443
444
445bool PLOT_CONTROLLER::OpenPlotfile( const wxString& aSuffix, PLOT_FORMAT aFormat,
446 const wxString& aSheetName, const wxString& aSheetPath )
447{
448 LOCALE_IO toggle;
449
450 // Save the current format: sadly some plot routines depends on this but the main reason
451 // is that the StartPlot method uses it to dispatch the plotter creation
452 GetPlotOptions().SetFormat( aFormat );
453
454 // Ensure that the previous plot is closed
455 ClosePlot();
456
457 // Now compute the full filename for the output and start the plot (after ensuring the
458 // output directory is OK).
459
460 std::function<bool( wxString* )> textResolver =
461 [&]( wxString* token ) -> bool
462 {
463 // Handles m_board->GetTitleBlock() *and* m_board->GetProject()
464 return m_board->ResolveTextVar( token, 0 );
465 };
466
467 wxString outputDirName = GetPlotOptions().GetOutputDirectory();
468 outputDirName = ExpandTextVars( outputDirName, &textResolver );
469 outputDirName = ExpandEnvVarSubstitutions( outputDirName, nullptr );
470
471 wxFileName outputDir = wxFileName::DirName( outputDirName );
472 wxString boardFilename = m_board->GetFileName();
473 PCB_LAYER_ID layer = ToLAYER_ID( GetLayer() );
474 wxString layerName = m_board->GetLayerName( layer );
475
476 if( EnsureFileDirectoryExists( &outputDir, boardFilename ) )
477 {
478 // outputDir contains now the full path of plot files
479 m_plotFile = boardFilename;
480 m_plotFile.SetPath( outputDir.GetPath() );
481 wxString fileExt = GetDefaultPlotExtension( aFormat );
482
483 // Gerber format *can* use layer-specific file extensions (this is no longer best
484 // practice as the official file ext is now .gbr).
485 if( GetPlotOptions().GetFormat() == PLOT_FORMAT::GERBER
486 && GetPlotOptions().GetUseGerberProtelExtensions() )
487 {
488 fileExt = GetGerberProtelExtension( GetLayer() );
489 }
490
491 // Build plot filenames from the board name and layer names:
492 BuildPlotFileName( &m_plotFile, outputDir.GetPath(), aSuffix, fileExt );
493
494 m_plotter = StartPlotBoard( m_board, &GetPlotOptions(), layer, layerName,
495 m_plotFile.GetFullPath(), aSheetName, aSheetPath );
496 }
497
498 return ( m_plotter != nullptr );
499}
500
501
503{
504 LOCALE_IO toggle;
505
506 // No plot open, nothing to do...
507 if( !m_plotter )
508 return false;
509
510 // Fully delegated to the parent
513 return true;
514}
515
516
517bool PLOT_CONTROLLER::PlotLayers( const LSEQ& aLayerSequence )
518{
519 LOCALE_IO toggle;
520
521 // No plot open, nothing to do...
522 if( !m_plotter )
523 return false;
524
525 // Fully delegated to the parent
526 PlotBoardLayers( m_board, m_plotter, aLayerSequence, GetPlotOptions() );
528 return true;
529}
530
531
532void PLOT_CONTROLLER::SetColorMode( bool aColorMode )
533{
534 if( !m_plotter )
535 return;
536
537 m_plotter->SetColorMode( aColorMode );
538}
539
540
542{
543 if( !m_plotter )
544 return false;
545
546 return m_plotter->GetColorMode();
547}
LAYER_T
The allowed types of layers, same as Specctra DSN spec.
Definition: board.h:153
@ LT_POWER
Definition: board.h:156
@ LT_MIXED
Definition: board.h:157
@ LT_SIGNAL
Definition: board.h:155
wxString GetBuildVersion()
Get the full KiCad version string.
const VECTOR2I & GetAuxOrigin()
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:290
LAYER_T GetLayerType(PCB_LAYER_ID aLayer) const
Return the type of the copper layer given by aLayer.
Definition: board.cpp:612
bool ResolveTextVar(wxString *token, int aDepth) const
Definition: board.cpp:433
TITLE_BLOCK & GetTitleBlock()
Definition: board.h:695
int GetCopperLayerCount() const
Definition: board.cpp:741
const wxString & GetFileName() const
Definition: board.h:327
const PCB_PLOT_PARAMS & GetPlotOptions() const
Definition: board.h:692
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition: board.cpp:574
PROJECT * GetProject() const
Definition: board.h:491
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:895
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:419
bool GetColorMode()
Definition: pcbplot.cpp:541
wxFileName m_plotFile
bool PlotLayer()
Plot a single layer on the current plotfile m_plotLayer is the layer to plot.
Definition: pcbplot.cpp:502
PLOT_CONTROLLER(BOARD *aBoard)
Batch plotter constructor, nothing interesting here.
Definition: pcbplot.cpp:411
void SetColorMode(bool aColorMode)
Choose color or bland and white plot mode.
Definition: pcbplot.cpp:532
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:445
bool PlotLayers(const LSEQ &aLayerSequence)
Plot a sequence of board layer IDs in the given order.
Definition: pcbplot.cpp:517
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:429
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:348
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject, int aFlags)
Definition: common.cpp:59
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:369
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:103
@ Edge_Cuts
Definition: layer_ids.h:112
@ Dwgs_User
Definition: layer_ids.h:107
@ F_Paste
Definition: layer_ids.h:104
@ Cmts_User
Definition: layer_ids.h:108
@ F_Adhes
Definition: layer_ids.h:102
@ B_Mask
Definition: layer_ids.h:98
@ B_Cu
Definition: layer_ids.h:65
@ Eco1_User
Definition: layer_ids.h:109
@ F_Mask
Definition: layer_ids.h:97
@ B_Paste
Definition: layer_ids.h:105
@ F_Fab
Definition: layer_ids.h:119
@ F_SilkS
Definition: layer_ids.h:100
@ UNDEFINED_LAYER
Definition: layer_ids.h:61
@ Eco2_User
Definition: layer_ids.h:110
@ B_SilkS
Definition: layer_ids.h:101
@ F_Cu
Definition: layer_ids.h:64
@ B_Fab
Definition: layer_ids.h:118
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:820
const wxString GetGerberProtelExtension(int aLayer)
Definition: pcbplot.cpp:43
static wxString & makeStringCompatX1(wxString &aText, bool aUseX1CompatibilityMode)
Definition: pcbplot.cpp:271
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:294
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:286
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:360
void BuildPlotFileName(wxFileName *aFilename, const wxString &aOutputDir, const wxString &aSuffix, const wxString &aExtension)
Complete a plot filename.
Definition: pcbplot.cpp:379
static const wxString GetGerberFilePolarityAttribute(int aLayer)
Definition: pcbplot.cpp:210
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