KiCad PCB EDA Suite
pcb_plot_params.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) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, you may find one here:
18  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19  * or you may search the http://www.gnu.org website for the version 2 license,
20  * or you may write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23 
24 #include <pcb_plot_params_parser.h>
25 #include <pcb_plot_params.h>
27 #include <plotter.h>
28 #include <macros.h>
29 #include <convert_to_biu.h>
30 
31 
32 #define PLOT_LINEWIDTH_MIN (0.02*IU_PER_MM) // min value for default line thickness
33 #define PLOT_LINEWIDTH_MAX (2*IU_PER_MM) // max value for default line thickness
34 #define PLOT_LINEWIDTH_DEFAULT (0.15*IU_PER_MM) // def. value for default line thickness
35 #define HPGL_PEN_DIAMETER_MIN 0
36 #define HPGL_PEN_DIAMETER_MAX 100 // Unit = mil
37 #define HPGL_PEN_SPEED_MIN 1 // this param is always in cm/s
38 #define HPGL_PEN_SPEED_MAX 99 // this param is always in cm/s
39 #define HPGL_PEN_NUMBER_MIN 1
40 #define HPGL_PEN_NUMBER_MAX 16
41 
42 
48 
49 // default trailing digits in Gerber coordinates, when units are mm
50 // This is also the max usable precision (i.e. internal Pcbnew Units)
51 static const int gbrDefaultPrecision = 6;
52 
53 
54 using namespace PCBPLOTPARAMS_T;
55 
56 
57 static const char* getTokenName( T aTok )
58 {
59  return PCB_PLOT_PARAMS_LEXER::TokenName( aTok );
60 }
61 
62 
63 static bool setInt( int* aInt, int aValue, int aMin, int aMax )
64 {
65  int temp = aValue;
66 
67  if( aValue < aMin )
68  temp = aMin;
69  else if( aValue > aMax )
70  temp = aMax;
71 
72  *aInt = temp;
73  return (temp == aValue);
74 }
75 
76 // PCB_PLOT_PARAMS
77 
79 {
80  m_useGerberProtelExtensions = false;
81  m_useGerberAttributes = false;
82  m_includeGerberNetlistInfo = false;
83  m_createGerberJobFile = false;
84  m_gerberPrecision = gbrDefaultPrecision;
85  m_excludeEdgeLayer = true;
86  m_lineWidth = g_DrawDefaultLineThickness;
87  m_plotFrameRef = false;
88  m_plotViaOnMaskLayer = false;
89  m_plotMode = FILLED;
90  m_DXFplotPolygonMode = true;
91  m_useAuxOrigin = false;
92  m_HPGLPenNum = 1;
93  m_HPGLPenSpeed = 20; // this param is always in cm/s
94  m_HPGLPenDiam = 15; // in mils
95  m_negative = false;
96  m_A4Output = false;
97  m_plotReference = true;
98  m_plotValue = true;
99  m_plotInvisibleText = false;
100  m_plotPadsOnSilkLayer = false;
101  m_subtractMaskFromSilk = false;
102  m_format = PLOT_FORMAT_GERBER;
103  m_mirror = false;
104  m_drillMarks = SMALL_DRILL_SHAPE;
105  m_autoScale = false;
106  m_scale = 1.0;
107  m_scaleSelection = 1;
108  m_fineScaleAdjustX = 1.0;
109  m_fineScaleAdjustY = 1.0;
110  m_widthAdjust = 0.;
111  m_outputDirectory.clear();
112  m_color = BLACK;
113  m_textMode = PLOTTEXTMODE_DEFAULT;
114  m_layerSelection = LSET( 7, F_SilkS, B_SilkS, F_Mask, B_Mask,
116  | LSET::AllCuMask();
117  // This parameter controls if the NPTH pads will be plotted or not
118  // it is a "local" parameter
119  m_skipNPTH_Pads = false;
120 }
121 
123 {
124  // Currently geber files use mm.
125  // accepted precision is only 6 (max value, this is the resolution of Pcbnew)
126  // or 5, min value for professional boards, when 6 creates problems
127  // to board makers.
128 
129  m_gerberPrecision = aPrecision == gbrDefaultPrecision-1 ? gbrDefaultPrecision-1 :
131 }
132 
133 
134 // PLEASE NOTE: only plot dialog options are processed
136  int aNestLevel, int aControl ) const
137 {
138  const char* falseStr = getTokenName( T_false );
139  const char* trueStr = getTokenName( T_true );
140 
141  aFormatter->Print( aNestLevel, "(%s\n", getTokenName( T_pcbplotparams ) );
142 
143  aFormatter->Print( aNestLevel+1, "(%s 0x%s)\n", getTokenName( T_layerselection ),
144  m_layerSelection.FmtHex().c_str() );
145 
146  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberextensions ),
147  m_useGerberProtelExtensions ? trueStr : falseStr );
148 
149  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberattributes ),
150  GetUseGerberAttributes() ? trueStr : falseStr );
151 
152  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberadvancedattributes ),
153  GetIncludeGerberNetlistInfo() ? trueStr : falseStr );
154 
155  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_creategerberjobfile ),
156  GetCreateGerberJobFile() ? trueStr : falseStr );
157 
158  if( m_gerberPrecision != gbrDefaultPrecision ) // save this option only if it is not the default value,
159  // to avoid incompatibility with older Pcbnew version
160  aFormatter->Print( aNestLevel+1, "(%s %d)\n",
161  getTokenName( T_gerberprecision ), m_gerberPrecision );
162 
163  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_excludeedgelayer ),
164  m_excludeEdgeLayer ? trueStr : falseStr );
165  aFormatter->Print( aNestLevel+1, "(%s %f)\n", getTokenName( T_linewidth ),
166  m_lineWidth / IU_PER_MM );
167  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotframeref ),
168  m_plotFrameRef ? trueStr : falseStr );
169  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_viasonmask ),
170  m_plotViaOnMaskLayer ? trueStr : falseStr );
171  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_mode ),
172  GetPlotMode() == SKETCH ? 2 : 1 ); // Value 0 (LINE mode) no more used
173  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_useauxorigin ),
174  m_useAuxOrigin ? trueStr : falseStr );
175  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpennumber ),
176  m_HPGLPenNum );
177 
178  // Obsolete parameter, pen speed is no more managed, because hpgl format
179  // is now an export format, and for this, pen speed has no meaning
180  // aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpenspeed ),
181  // m_HPGLPenSpeed );
182 
183  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpenspeed ),
184  m_HPGLPenSpeed );
185  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpendiameter ),
186  m_HPGLPenDiam );
187  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psnegative ),
188  m_negative ? trueStr : falseStr );
189  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psa4output ),
190  m_A4Output ? trueStr : falseStr );
191  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotreference ),
192  m_plotReference ? trueStr : falseStr );
193  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotvalue ),
194  m_plotValue ? trueStr : falseStr );
195  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotinvisibletext ),
196  m_plotInvisibleText ? trueStr : falseStr );
197  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_padsonsilk ),
198  m_plotPadsOnSilkLayer ? trueStr : falseStr );
199  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_subtractmaskfromsilk ),
200  m_subtractMaskFromSilk ? trueStr : falseStr );
201  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_outputformat ),
202  m_format );
203  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_mirror ),
204  m_mirror ? trueStr : falseStr );
205  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_drillshape ),
206  m_drillMarks );
207  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_scaleselection ),
208  m_scaleSelection );
209  aFormatter->Print( aNestLevel+1, "(%s %s)", getTokenName( T_outputdirectory ),
210  aFormatter->Quotew( m_outputDirectory ).c_str() );
211  aFormatter->Print( 0, ")\n" );
212 }
213 
214 
216 {
217  aParser->Parse( this );
218 }
219 
220 
221 bool PCB_PLOT_PARAMS::IsSameAs( const PCB_PLOT_PARAMS &aPcbPlotParams, bool aCompareOnlySavedPrms ) const
222 {
223  if( m_layerSelection != aPcbPlotParams.m_layerSelection )
224  return false;
225  if( m_useGerberProtelExtensions != aPcbPlotParams.m_useGerberProtelExtensions )
226  return false;
227  if( m_useGerberAttributes != aPcbPlotParams.m_useGerberAttributes )
228  return false;
229  if( m_useGerberAttributes && m_includeGerberNetlistInfo != aPcbPlotParams.m_includeGerberNetlistInfo )
230  return false;
231  if( m_createGerberJobFile != aPcbPlotParams.m_createGerberJobFile )
232  return false;
233  if( m_gerberPrecision != aPcbPlotParams.m_gerberPrecision )
234  return false;
235  if( m_excludeEdgeLayer != aPcbPlotParams.m_excludeEdgeLayer )
236  return false;
237  if( m_lineWidth != aPcbPlotParams.m_lineWidth )
238  return false;
239  if( m_plotFrameRef != aPcbPlotParams.m_plotFrameRef )
240  return false;
241  if( m_plotViaOnMaskLayer != aPcbPlotParams.m_plotViaOnMaskLayer )
242  return false;
243  if( m_plotMode != aPcbPlotParams.m_plotMode )
244  return false;
245  if( !aCompareOnlySavedPrms )
246  {
247  if( m_DXFplotPolygonMode != aPcbPlotParams.m_DXFplotPolygonMode )
248  return false;
249  }
250  if( m_useAuxOrigin != aPcbPlotParams.m_useAuxOrigin )
251  return false;
252  if( m_HPGLPenNum != aPcbPlotParams.m_HPGLPenNum )
253  return false;
254  if( m_HPGLPenSpeed != aPcbPlotParams.m_HPGLPenSpeed )
255  return false;
256  if( m_HPGLPenDiam != aPcbPlotParams.m_HPGLPenDiam )
257  return false;
258  if( m_negative != aPcbPlotParams.m_negative )
259  return false;
260  if( m_A4Output != aPcbPlotParams.m_A4Output )
261  return false;
262  if( m_plotReference != aPcbPlotParams.m_plotReference )
263  return false;
264  if( m_plotValue != aPcbPlotParams.m_plotValue )
265  return false;
266  if( m_plotInvisibleText != aPcbPlotParams.m_plotInvisibleText )
267  return false;
268  if( m_plotPadsOnSilkLayer != aPcbPlotParams.m_plotPadsOnSilkLayer )
269  return false;
270  if( m_subtractMaskFromSilk != aPcbPlotParams.m_subtractMaskFromSilk )
271  return false;
272  if( m_format != aPcbPlotParams.m_format )
273  return false;
274  if( m_mirror != aPcbPlotParams.m_mirror )
275  return false;
276  if( m_drillMarks != aPcbPlotParams.m_drillMarks )
277  return false;
278  if( m_scaleSelection != aPcbPlotParams.m_scaleSelection )
279  return false;
280  if( m_autoScale != aPcbPlotParams.m_autoScale )
281  return false;
282  if( m_scale != aPcbPlotParams.m_scale )
283  return false;
284  if( m_fineScaleAdjustX != aPcbPlotParams.m_fineScaleAdjustX )
285  return false;
286  if( m_fineScaleAdjustY != aPcbPlotParams.m_fineScaleAdjustY )
287  return false;
288  if( m_widthAdjust != aPcbPlotParams.m_widthAdjust )
289  return false;
290  if( !aCompareOnlySavedPrms )
291  {
292  if( m_color != aPcbPlotParams.m_color )
293  return false;
294  }
295  if( m_textMode != aPcbPlotParams.m_textMode )
296  return false;
297  if( !m_outputDirectory.IsSameAs( aPcbPlotParams.m_outputDirectory ) )
298  return false;
299 
300  return true;
301 }
302 
303 
305 {
306  return setInt( &m_HPGLPenDiam, aValue, HPGL_PEN_DIAMETER_MIN, HPGL_PEN_DIAMETER_MAX );
307 }
308 
309 
311 {
312  return setInt( &m_HPGLPenSpeed, aValue, HPGL_PEN_SPEED_MIN, HPGL_PEN_SPEED_MAX );
313 }
314 
315 
317 {
318  return setInt( &m_lineWidth, aValue, PLOT_LINEWIDTH_MIN, PLOT_LINEWIDTH_MAX );
319 }
320 
321 // PCB_PLOT_PARAMS_PARSER
322 
324  PCB_PLOT_PARAMS_LEXER( aReader )
325 {
326 }
327 
328 
329 PCB_PLOT_PARAMS_PARSER::PCB_PLOT_PARAMS_PARSER( char* aLine, const wxString& aSource ) :
330  PCB_PLOT_PARAMS_LEXER( aLine, aSource )
331 {
332 }
333 
334 
336 {
337  T token;
338 
339  while( ( token = NextTok() ) != T_RIGHT )
340  {
341  if( token == T_EOF)
342  Unexpected( T_EOF );
343 
344  if( token == T_LEFT )
345  token = NextTok();
346 
347  if( token == T_pcbplotparams )
348  continue;
349 
350  bool skip_right = false;
351 
352  switch( token )
353  {
354  case T_layerselection:
355  {
356  token = NeedSYMBOLorNUMBER();
357 
358  const std::string& cur = CurStr();
359 
360  if( token == T_NUMBER ) // pretty 3 format had legacy Cu stack.
361  {
362  // unsigned legacy_mask = atol( cur.c_str() );
363 
364  /* It's not possible to convert a legacy Cu layer number to a new
365  Cu layer number without knowing the number or total Cu layers
366  in the legacy board. We do not have that information here.
367  So simply set all layers ON. User can turn them off in the UI.
368  This is one of the superiorities of the new Cu sequence.
369  aPcbPlotParams->m_layerSelection = LEGACY_PLUGIN::leg_mask2new( cu_count, legacy_mask );
370  */
371 
372  // sorry, use the UI once to fix:
373  aPcbPlotParams->m_layerSelection = LSET( 2, F_SilkS, B_SilkS) | LSET::AllCuMask();
374  }
375  else if( cur.find_first_of( "0x" ) == 0 ) // pretty ver. 4.
376  {
377  // skip the leading 2 0x bytes.
378  aPcbPlotParams->m_layerSelection.ParseHex( cur.c_str()+2, cur.size()-2 );
379  }
380  else
381  Expecting( "integer or hex layerSelection" );
382  }
383  break;
384 
385  case T_usegerberextensions:
386  aPcbPlotParams->m_useGerberProtelExtensions = parseBool();
387  break;
388 
389  case T_usegerberattributes:
390  aPcbPlotParams->m_useGerberAttributes = parseBool();
391  break;
392 
393  case T_usegerberadvancedattributes:
394  aPcbPlotParams->m_includeGerberNetlistInfo = parseBool();
395  break;
396 
397  case T_creategerberjobfile:
398  aPcbPlotParams->m_createGerberJobFile = parseBool();
399  break;
400 
401  case T_gerberprecision:
402  aPcbPlotParams->m_gerberPrecision =
404  break;
405 
406  case T_psa4output:
407  aPcbPlotParams->m_A4Output = parseBool();
408  break;
409 
410  case T_excludeedgelayer:
411  aPcbPlotParams->m_excludeEdgeLayer = parseBool();
412  break;
413 
414  case T_linewidth:
415  {
416  // Due to a bug, this (minor) parameter was saved in biu
417  // and now is saved in mm
418  // If the read value is outside bounds, force a default value
419  double tmp = parseDouble();
420  if( !aPcbPlotParams->SetLineWidth( KiROUND( tmp * IU_PER_MM ) ) )
421  aPcbPlotParams->SetLineWidth( PLOT_LINEWIDTH_DEFAULT );
422  }
423  break;
424 
425  case T_plotframeref:
426  aPcbPlotParams->m_plotFrameRef = parseBool();
427  break;
428 
429  case T_viasonmask:
430  aPcbPlotParams->m_plotViaOnMaskLayer = parseBool();
431  break;
432 
433  case T_mode:
434  aPcbPlotParams->SetPlotMode( parseInt( 0, 2 ) > 1 ? SKETCH : FILLED );
435  break;
436 
437  case T_useauxorigin:
438  aPcbPlotParams->m_useAuxOrigin = parseBool();
439  break;
440 
441  case T_hpglpennumber:
442  aPcbPlotParams->m_HPGLPenNum = parseInt( HPGL_PEN_NUMBER_MIN,
444  break;
445 
446  case T_hpglpenspeed:
447  aPcbPlotParams->m_HPGLPenSpeed = parseInt( HPGL_PEN_SPEED_MIN,
449  break;
450 
451  case T_hpglpendiameter:
452  aPcbPlotParams->m_HPGLPenDiam = parseInt( HPGL_PEN_DIAMETER_MIN,
454  break;
455 
456  case T_hpglpenoverlay:
457  // No more used. juste here for compatibility with old versions
459  break;
460 
461  case T_pscolor:
462  NeedSYMBOL(); // This actually was never used...
463  break;
464 
465  case T_psnegative:
466  aPcbPlotParams->m_negative = parseBool();
467  break;
468 
469  case T_plotreference:
470  aPcbPlotParams->m_plotReference = parseBool();
471  break;
472 
473  case T_plotvalue:
474  aPcbPlotParams->m_plotValue = parseBool();
475  break;
476 
477  case T_plotinvisibletext:
478  aPcbPlotParams->m_plotInvisibleText = parseBool();
479  break;
480 
481  case T_padsonsilk:
482  aPcbPlotParams->m_plotPadsOnSilkLayer= parseBool();
483  break;
484 
485  case T_subtractmaskfromsilk:
486  aPcbPlotParams->m_subtractMaskFromSilk = parseBool();
487  break;
488 
489  case T_outputformat:
490  aPcbPlotParams->m_format = static_cast<PlotFormat>(
492  break;
493 
494  case T_mirror:
495  aPcbPlotParams->m_mirror = parseBool();
496  break;
497 
498  case T_drillshape:
499  aPcbPlotParams->m_drillMarks = static_cast<PCB_PLOT_PARAMS::DrillMarksType>
500  ( parseInt( 0, 2 ) );
501  break;
502 
503  case T_scaleselection:
504  aPcbPlotParams->m_scaleSelection = parseInt( 0, 4 );
505  break;
506 
507  case T_outputdirectory:
508  NeedSYMBOL();
509  aPcbPlotParams->m_outputDirectory = FROM_UTF8( CurText() );
510  break;
511 
512  default:
513  skipCurrent(); // skip unknown or outdated plot parameter
514  skip_right = true; // the closing right token is already read.
515  break;
516  }
517 
518  if( ! skip_right )
519  NeedRIGHT();
520  }
521 }
522 
523 
525 {
526  T token = NeedSYMBOL();
527 
528  if( token != T_false && token != T_true )
529  Expecting( "true|false" );
530 
531  return token == T_true;
532 }
533 
534 
535 int PCB_PLOT_PARAMS_PARSER::parseInt( int aMin, int aMax )
536 {
537  T token = NextTok();
538 
539  if( token != T_NUMBER )
540  Expecting( T_NUMBER );
541 
542  int val = atoi( CurText() );
543 
544  if( val < aMin )
545  val = aMin;
546  else if( val > aMax )
547  val = aMax;
548 
549  return val;
550 }
551 
552 
554 {
555  T token = NextTok();
556 
557  if( token != T_NUMBER )
558  Expecting( T_NUMBER );
559 
560  double val = strtod( CurText(), NULL );
561 
562  return val;
563 }
564 
565 
567 {
568  int curr_level = 0;
569  T token;
570 
571  while( ( token = NextTok() ) != T_EOF )
572  {
573  if( token == T_LEFT )
574  curr_level--;
575 
576  if( token == T_RIGHT )
577  {
578  curr_level++;
579 
580  if( curr_level > 0 )
581  return;
582  }
583  }
584 }
double m_fineScaleAdjustX
fine scale adjust X axis
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:673
#define HPGL_PEN_NUMBER_MAX
bool m_plotValue
Enable plotting of part values.
#define HPGL_PEN_SPEED_MAX
Class LINE_READER is an abstract class from which implementation specific LINE_READERs may be derived...
Definition: richio.h:81
double parseDouble()
Function parseDouble parses a double.
#define PLOT_LINEWIDTH_DEFAULT
void SetGerberPrecision(int aPrecision)
wxString m_outputDirectory
Output directory for plot files (usually relative to the board file)
static wxString FROM_UTF8(const char *cstring)
function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes...
Definition: macros.h:53
bool m_mirror
Mirror the plot around the X axis.
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
Class PCB_PLOT_PARAMS_PARSER is the parser class for PCB_PLOT_PARAMS.
bool m_excludeEdgeLayer
If false always plot (merge) the pcb edge layer on other layers.
static const int gbrDefaultPrecision
bool m_plotPadsOnSilkLayer
Allows pads outlines on silkscreen layer (when pads are also on silk screen)
#define PLOT_LINEWIDTH_MAX
double m_scale
Global scale factor, 1.0 plots a board with its actual size.
bool m_plotReference
Enable plotting of part references.
PlotFormat
Enum PlotFormat is the set of supported output plot formats.
Definition: plotter.h:50
Class OUTPUTFORMATTER is an important interface (abstract class) used to output 8 bit text in a conve...
Definition: richio.h:327
bool m_useGerberProtelExtensions
When plotting gerber files, use a conventional set of Protel extensions instead of ...
bool SetHPGLPenSpeed(int aValue)
int m_scaleSelection
Scale ratio index (UI only)
bool m_negative
Plot in negative color (supported only by some drivers)
bool m_plotFrameRef
True to plot/print frame references.
bool SetHPGLPenDiameter(int aValue)
bool SetLineWidth(int aValue)
This file contains miscellaneous commonly used macros and functions.
bool m_includeGerberNetlistInfo
Include netlist info (only in Gerber X2 format) (chapter ? in revision ?)
bool m_useGerberAttributes
Include attributes from the Gerber X2 format (chapter 5 in revision J2)
bool m_plotInvisibleText
Force plotting of fields marked invisible.
bool m_DXFplotPolygonMode
DXF format: Plot items in outline (polygon) mode In polygon mode, each item to plot is converted to a...
bool m_autoScale
When true set the scale to fit the board in the page.
bool m_A4Output
Autoscale the plot to fit an A4 (landscape?) sheet.
Class LSET is a set of PCB_LAYER_IDs.
PCB_PLOT_PARAMS_PARSER(LINE_READER *aReader)
bool m_subtractMaskFromSilk
On gerbers &#39;scrape&#39; away the solder mask from silkscreen (trim silks)
#define HPGL_PEN_DIAMETER_MAX
double m_fineScaleAdjustY
fine scale adjust Y axis
int g_DrawDefaultLineThickness
Default line thickness in internal units used to draw or plot items using a default thickness line va...
std::string Quotew(const wxString &aWrapee)
Definition: richio.cpp:482
#define HPGL_PEN_DIAMETER_MIN
bool m_plotViaOnMaskLayer
True if vias are drawn on Mask layer (ie untented, exposed by mask)
static const char * getTokenName(T aTok)
Class PCB_PLOT_PARAMS handles plot parameters and options when plotting/printing a board...
bool IsSameAs(const PCB_PLOT_PARAMS &aPcbPlotParams, bool aCompareOnlySavedPrms) const
Compare current settings to aPcbPlotParams, including not saved parameters in brd file...
int m_widthAdjust
This width factor is intended to compensate PS printers/ plotters that do not strictly obey line widt...
bool m_useAuxOrigin
Plot gerbers using auxiliary (drill) origin instead of absolue coordinates.
bool m_createGerberJobFile
generate the auxiliary "job file" in gerber format
void SetPlotMode(EDA_DRAW_MODE_T aPlotMode)
int m_HPGLPenNum
HPGL only: pen number selection(1 to 9)
COLOR4D m_color
Color for plotting the current layer. Provided, but not really used.
LSET m_layerSelection
Set of layers to plot.
void skipCurrent()
Function skipCurrent Skip the current token level, i.e search for the RIGHT parenthesis which closes ...
Board layer functions and definitions.
EDA_DRAW_MODE_T m_plotMode
FILLED or SKETCH selects how to plot filled objects.
#define HPGL_PEN_NUMBER_MIN
#define PLOT_LINEWIDTH_MIN
#define HPGL_PEN_SPEED_MIN
int m_HPGLPenSpeed
HPGL only: pen speed, always in cm/s (1 to 99 cm/s)
Definition: colors.h:45
int parseInt(int aMin, int aMax)
Function parseInt parses an integer and constrains it between two values.
void Format(OUTPUTFORMATTER *aFormatter, int aNestLevel, int aControl=0) const
int PRINTF_FUNC Print(int nestLevel, const char *fmt,...)
Function Print formats and writes text to the output stream.
Definition: richio.cpp:404
static bool setInt(int *aInt, int aValue, int aMin, int aMax)
void Parse(PCB_PLOT_PARAMS *aPcbPlotParams)
void Parse(PCB_PLOT_PARAMS_PARSER *aParser)
PlotTextMode m_textMode
Choose how represent text with PS, PDF and DXF drivers.
int ParseHex(const char *aStart, int aCount)
Function ParseHex understands the output of FmtHex() and replaces this set&#39;s values with those given ...
Definition: lset.cpp:312
PlotFormat m_format
Plot format type (chooses the driver to be used)
DrillMarksType m_drillMarks
Holes can be not plotted, have a small mark or plotted in actual size.
int m_lineWidth
The default line width (used to draw items having no defined width)
int m_HPGLPenDiam
HPGL only: pen diameter in MILS, useful to fill areas.
int m_gerberPrecision
precision of coordinates in Gerber files: accepted 5 or 6 when units are in mm (6 or 7 in inches...