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 #include <board_design_settings.h>
31 
32 
33 #define PLOT_LINEWIDTH_MIN ( 0.02 * IU_PER_MM ) // min value for default line thickness
34 #define PLOT_LINEWIDTH_MAX ( 2 * IU_PER_MM ) // max value for default line thickness
35 #define PLOT_LINEWIDTH_DEFAULT ( DEFAULT_TEXT_WIDTH * IU_PER_MM )
36 #define HPGL_PEN_DIAMETER_MIN 0
37 #define HPGL_PEN_DIAMETER_MAX 100.0 // Unit = mil
38 #define HPGL_PEN_SPEED_MIN 1 // this param is always in cm/s
39 #define HPGL_PEN_SPEED_MAX 99 // this param is always in cm/s
40 #define HPGL_PEN_NUMBER_MIN 1
41 #define HPGL_PEN_NUMBER_MAX 16
42 
43 
49 
50 // default trailing digits in Gerber coordinates, when units are mm
51 // This is also the max usable precision (i.e. internal Pcbnew Units)
52 static const int gbrDefaultPrecision = 6;
53 
54 
55 using namespace PCBPLOTPARAMS_T;
56 
57 
58 static const char* getTokenName( T aTok )
59 {
60  return PCB_PLOT_PARAMS_LEXER::TokenName( aTok );
61 }
62 
63 
64 static bool setInt( int* aTarget, int aValue, int aMin, int aMax )
65 {
66  int temp = aValue;
67 
68  if( aValue < aMin )
69  temp = aMin;
70  else if( aValue > aMax )
71  temp = aMax;
72 
73  *aTarget = temp;
74  return (temp == aValue);
75 }
76 
77 
78 static bool setDouble( double* aTarget, double aValue, double aMin, double aMax )
79 {
80  double temp = aValue;
81 
82  if( aValue < aMin )
83  temp = aMin;
84  else if( aValue > aMax )
85  temp = aMax;
86 
87  *aTarget = temp;
88  return (temp == aValue);
89 }
90 
91 // PCB_PLOT_PARAMS
92 
94 {
95  m_useGerberProtelExtensions = false;
96  m_useGerberAttributes = false;
97  m_includeGerberNetlistInfo = false;
98  m_createGerberJobFile = false;
99  m_gerberPrecision = gbrDefaultPrecision;
100  m_excludeEdgeLayer = true;
101  m_lineWidth = g_DrawDefaultLineThickness;
102  m_plotFrameRef = false;
103  m_plotViaOnMaskLayer = false;
104  m_plotMode = FILLED;
105  m_DXFplotPolygonMode = true;
106  m_useAuxOrigin = false;
107  m_HPGLPenNum = 1;
108  m_HPGLPenSpeed = 20; // this param is always in cm/s
109  m_HPGLPenDiam = 15; // in mils
110  m_negative = false;
111  m_A4Output = false;
112  m_plotReference = true;
113  m_plotValue = true;
114  m_plotInvisibleText = false;
115  m_plotPadsOnSilkLayer = false;
116  m_subtractMaskFromSilk = false;
117  m_format = PLOT_FORMAT_GERBER;
118  m_mirror = false;
119  m_drillMarks = SMALL_DRILL_SHAPE;
120  m_autoScale = false;
121  m_scale = 1.0;
122  m_scaleSelection = 1;
123  m_fineScaleAdjustX = 1.0;
124  m_fineScaleAdjustY = 1.0;
125  m_widthAdjust = 0.;
126  m_outputDirectory.clear();
127  m_color = BLACK;
128  m_textMode = PLOTTEXTMODE_DEFAULT;
129  m_layerSelection = LSET( 7, F_SilkS, B_SilkS, F_Mask, B_Mask,
131  | LSET::AllCuMask();
132  // This parameter controls if the NPTH pads will be plotted or not
133  // it is a "local" parameter
134  m_skipNPTH_Pads = false;
135 }
136 
138 {
139  // Currently geber files use mm.
140  // accepted precision is only 6 (max value, this is the resolution of Pcbnew)
141  // or 5, min value for professional boards, when 6 creates problems
142  // to board makers.
143 
144  m_gerberPrecision = aPrecision == gbrDefaultPrecision-1 ? gbrDefaultPrecision-1 :
146 }
147 
148 
149 // PLEASE NOTE: only plot dialog options are processed
151  int aNestLevel, int aControl ) const
152 {
153  const char* falseStr = getTokenName( T_false );
154  const char* trueStr = getTokenName( T_true );
155 
156  aFormatter->Print( aNestLevel, "(%s\n", getTokenName( T_pcbplotparams ) );
157 
158  aFormatter->Print( aNestLevel+1, "(%s 0x%s)\n", getTokenName( T_layerselection ),
159  m_layerSelection.FmtHex().c_str() );
160 
161  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberextensions ),
162  m_useGerberProtelExtensions ? trueStr : falseStr );
163 
164  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberattributes ),
165  GetUseGerberAttributes() ? trueStr : falseStr );
166 
167  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberadvancedattributes ),
168  GetIncludeGerberNetlistInfo() ? trueStr : falseStr );
169 
170  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_creategerberjobfile ),
171  GetCreateGerberJobFile() ? trueStr : falseStr );
172 
173  if( m_gerberPrecision != gbrDefaultPrecision ) // save this option only if it is not the default value,
174  // to avoid incompatibility with older Pcbnew version
175  aFormatter->Print( aNestLevel+1, "(%s %d)\n",
176  getTokenName( T_gerberprecision ), m_gerberPrecision );
177 
178  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_excludeedgelayer ),
179  m_excludeEdgeLayer ? trueStr : falseStr );
180  aFormatter->Print( aNestLevel+1, "(%s %f)\n", getTokenName( T_linewidth ),
181  m_lineWidth / IU_PER_MM );
182  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotframeref ),
183  m_plotFrameRef ? trueStr : falseStr );
184  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_viasonmask ),
185  m_plotViaOnMaskLayer ? trueStr : falseStr );
186  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_mode ),
187  GetPlotMode() == SKETCH ? 2 : 1 ); // Value 0 (LINE mode) no more used
188  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_useauxorigin ),
189  m_useAuxOrigin ? trueStr : falseStr );
190  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpennumber ),
191  m_HPGLPenNum );
192 
193  // Obsolete parameter, pen speed is no more managed, because hpgl format
194  // is now an export format, and for this, pen speed has no meaning
195  // aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpenspeed ),
196  // m_HPGLPenSpeed );
197 
198  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpenspeed ),
199  m_HPGLPenSpeed );
200  aFormatter->Print( aNestLevel+1, "(%s %f)\n", getTokenName( T_hpglpendiameter ),
201  m_HPGLPenDiam );
202  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psnegative ),
203  m_negative ? trueStr : falseStr );
204  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psa4output ),
205  m_A4Output ? trueStr : falseStr );
206  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotreference ),
207  m_plotReference ? trueStr : falseStr );
208  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotvalue ),
209  m_plotValue ? trueStr : falseStr );
210  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotinvisibletext ),
211  m_plotInvisibleText ? trueStr : falseStr );
212  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_padsonsilk ),
213  m_plotPadsOnSilkLayer ? trueStr : falseStr );
214  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_subtractmaskfromsilk ),
215  m_subtractMaskFromSilk ? trueStr : falseStr );
216  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_outputformat ),
217  m_format );
218  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_mirror ),
219  m_mirror ? trueStr : falseStr );
220  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_drillshape ),
221  m_drillMarks );
222  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_scaleselection ),
223  m_scaleSelection );
224  aFormatter->Print( aNestLevel+1, "(%s \"%s\")", getTokenName( T_outputdirectory ),
225  (const char*) m_outputDirectory.utf8_str() );
226  aFormatter->Print( 0, ")\n" );
227 }
228 
229 
231 {
232  aParser->Parse( this );
233 }
234 
235 
236 bool PCB_PLOT_PARAMS::IsSameAs( const PCB_PLOT_PARAMS &aPcbPlotParams, bool aCompareOnlySavedPrms ) const
237 {
238  if( m_layerSelection != aPcbPlotParams.m_layerSelection )
239  return false;
240  if( m_useGerberProtelExtensions != aPcbPlotParams.m_useGerberProtelExtensions )
241  return false;
242  if( m_useGerberAttributes != aPcbPlotParams.m_useGerberAttributes )
243  return false;
244  if( m_useGerberAttributes && m_includeGerberNetlistInfo != aPcbPlotParams.m_includeGerberNetlistInfo )
245  return false;
246  if( m_createGerberJobFile != aPcbPlotParams.m_createGerberJobFile )
247  return false;
248  if( m_gerberPrecision != aPcbPlotParams.m_gerberPrecision )
249  return false;
250  if( m_excludeEdgeLayer != aPcbPlotParams.m_excludeEdgeLayer )
251  return false;
252  if( m_lineWidth != aPcbPlotParams.m_lineWidth )
253  return false;
254  if( m_plotFrameRef != aPcbPlotParams.m_plotFrameRef )
255  return false;
256  if( m_plotViaOnMaskLayer != aPcbPlotParams.m_plotViaOnMaskLayer )
257  return false;
258  if( m_plotMode != aPcbPlotParams.m_plotMode )
259  return false;
260  if( !aCompareOnlySavedPrms )
261  {
262  if( m_DXFplotPolygonMode != aPcbPlotParams.m_DXFplotPolygonMode )
263  return false;
264  }
265  if( m_useAuxOrigin != aPcbPlotParams.m_useAuxOrigin )
266  return false;
267  if( m_HPGLPenNum != aPcbPlotParams.m_HPGLPenNum )
268  return false;
269  if( m_HPGLPenSpeed != aPcbPlotParams.m_HPGLPenSpeed )
270  return false;
271  if( m_HPGLPenDiam != aPcbPlotParams.m_HPGLPenDiam )
272  return false;
273  if( m_negative != aPcbPlotParams.m_negative )
274  return false;
275  if( m_A4Output != aPcbPlotParams.m_A4Output )
276  return false;
277  if( m_plotReference != aPcbPlotParams.m_plotReference )
278  return false;
279  if( m_plotValue != aPcbPlotParams.m_plotValue )
280  return false;
281  if( m_plotInvisibleText != aPcbPlotParams.m_plotInvisibleText )
282  return false;
283  if( m_plotPadsOnSilkLayer != aPcbPlotParams.m_plotPadsOnSilkLayer )
284  return false;
285  if( m_subtractMaskFromSilk != aPcbPlotParams.m_subtractMaskFromSilk )
286  return false;
287  if( m_format != aPcbPlotParams.m_format )
288  return false;
289  if( m_mirror != aPcbPlotParams.m_mirror )
290  return false;
291  if( m_drillMarks != aPcbPlotParams.m_drillMarks )
292  return false;
293  if( m_scaleSelection != aPcbPlotParams.m_scaleSelection )
294  return false;
295  if( m_autoScale != aPcbPlotParams.m_autoScale )
296  return false;
297  if( m_scale != aPcbPlotParams.m_scale )
298  return false;
299  if( m_fineScaleAdjustX != aPcbPlotParams.m_fineScaleAdjustX )
300  return false;
301  if( m_fineScaleAdjustY != aPcbPlotParams.m_fineScaleAdjustY )
302  return false;
303  if( m_widthAdjust != aPcbPlotParams.m_widthAdjust )
304  return false;
305  if( !aCompareOnlySavedPrms )
306  {
307  if( m_color != aPcbPlotParams.m_color )
308  return false;
309  }
310  if( m_textMode != aPcbPlotParams.m_textMode )
311  return false;
312  if( !m_outputDirectory.IsSameAs( aPcbPlotParams.m_outputDirectory ) )
313  return false;
314 
315  return true;
316 }
317 
318 
320 {
321  return setDouble( &m_HPGLPenDiam, aValue, HPGL_PEN_DIAMETER_MIN, HPGL_PEN_DIAMETER_MAX );
322 }
323 
324 
326 {
327  return setInt( &m_HPGLPenSpeed, aValue, HPGL_PEN_SPEED_MIN, HPGL_PEN_SPEED_MAX );
328 }
329 
330 
332 {
333  return setInt( &m_lineWidth, aValue, PLOT_LINEWIDTH_MIN, PLOT_LINEWIDTH_MAX );
334 }
335 
336 // PCB_PLOT_PARAMS_PARSER
337 
339  PCB_PLOT_PARAMS_LEXER( aReader )
340 {
341 }
342 
343 
344 PCB_PLOT_PARAMS_PARSER::PCB_PLOT_PARAMS_PARSER( char* aLine, const wxString& aSource ) :
345  PCB_PLOT_PARAMS_LEXER( aLine, aSource )
346 {
347 }
348 
349 
351 {
352  T token;
353 
354  while( ( token = NextTok() ) != T_RIGHT )
355  {
356  if( token == T_EOF)
357  Unexpected( T_EOF );
358 
359  if( token == T_LEFT )
360  token = NextTok();
361 
362  if( token == T_pcbplotparams )
363  continue;
364 
365  bool skip_right = false;
366 
367  switch( token )
368  {
369  case T_layerselection:
370  {
371  token = NeedSYMBOLorNUMBER();
372 
373  const std::string& cur = CurStr();
374 
375  if( token == T_NUMBER ) // pretty 3 format had legacy Cu stack.
376  {
377  // unsigned legacy_mask = atol( cur.c_str() );
378 
379  /* It's not possible to convert a legacy Cu layer number to a new
380  Cu layer number without knowing the number or total Cu layers
381  in the legacy board. We do not have that information here.
382  So simply set all layers ON. User can turn them off in the UI.
383  This is one of the superiorities of the new Cu sequence.
384  aPcbPlotParams->m_layerSelection = LEGACY_PLUGIN::leg_mask2new( cu_count, legacy_mask );
385  */
386 
387  // sorry, use the UI once to fix:
388  aPcbPlotParams->m_layerSelection = LSET( 2, F_SilkS, B_SilkS) | LSET::AllCuMask();
389  }
390  else if( cur.find_first_of( "0x" ) == 0 ) // pretty ver. 4.
391  {
392  // skip the leading 2 0x bytes.
393  aPcbPlotParams->m_layerSelection.ParseHex( cur.c_str()+2, cur.size()-2 );
394  }
395  else
396  Expecting( "integer or hex layerSelection" );
397  }
398  break;
399 
400  case T_usegerberextensions:
401  aPcbPlotParams->m_useGerberProtelExtensions = parseBool();
402  break;
403 
404  case T_usegerberattributes:
405  aPcbPlotParams->m_useGerberAttributes = parseBool();
406  break;
407 
408  case T_usegerberadvancedattributes:
409  aPcbPlotParams->m_includeGerberNetlistInfo = parseBool();
410  break;
411 
412  case T_creategerberjobfile:
413  aPcbPlotParams->m_createGerberJobFile = parseBool();
414  break;
415 
416  case T_gerberprecision:
417  aPcbPlotParams->m_gerberPrecision =
419  break;
420 
421  case T_psa4output:
422  aPcbPlotParams->m_A4Output = parseBool();
423  break;
424 
425  case T_excludeedgelayer:
426  aPcbPlotParams->m_excludeEdgeLayer = parseBool();
427  break;
428 
429  case T_linewidth:
430  {
431  // Due to a bug, this (minor) parameter was saved in biu
432  // and now is saved in mm
433  // If the read value is outside bounds, force a default value
434  double tmp = parseDouble();
435  if( !aPcbPlotParams->SetLineWidth( KiROUND( tmp * IU_PER_MM ) ) )
436  aPcbPlotParams->SetLineWidth( PLOT_LINEWIDTH_DEFAULT );
437  }
438  break;
439 
440  case T_plotframeref:
441  aPcbPlotParams->m_plotFrameRef = parseBool();
442  break;
443 
444  case T_viasonmask:
445  aPcbPlotParams->m_plotViaOnMaskLayer = parseBool();
446  break;
447 
448  case T_mode:
449  aPcbPlotParams->SetPlotMode( parseInt( 0, 2 ) > 1 ? SKETCH : FILLED );
450  break;
451 
452  case T_useauxorigin:
453  aPcbPlotParams->m_useAuxOrigin = parseBool();
454  break;
455 
456  case T_hpglpennumber:
457  aPcbPlotParams->m_HPGLPenNum = parseInt( HPGL_PEN_NUMBER_MIN,
459  break;
460 
461  case T_hpglpenspeed:
462  aPcbPlotParams->m_HPGLPenSpeed = parseInt( HPGL_PEN_SPEED_MIN,
464  break;
465 
466  case T_hpglpendiameter:
467  aPcbPlotParams->m_HPGLPenDiam = parseDouble();
468  break;
469 
470  case T_hpglpenoverlay:
471  // No more used. juste here for compatibility with old versions
473  break;
474 
475  case T_pscolor:
476  NeedSYMBOL(); // This actually was never used...
477  break;
478 
479  case T_psnegative:
480  aPcbPlotParams->m_negative = parseBool();
481  break;
482 
483  case T_plotreference:
484  aPcbPlotParams->m_plotReference = parseBool();
485  break;
486 
487  case T_plotvalue:
488  aPcbPlotParams->m_plotValue = parseBool();
489  break;
490 
491  case T_plotinvisibletext:
492  aPcbPlotParams->m_plotInvisibleText = parseBool();
493  break;
494 
495  case T_padsonsilk:
496  aPcbPlotParams->m_plotPadsOnSilkLayer= parseBool();
497  break;
498 
499  case T_subtractmaskfromsilk:
500  aPcbPlotParams->m_subtractMaskFromSilk = parseBool();
501  break;
502 
503  case T_outputformat:
504  aPcbPlotParams->m_format = static_cast<PlotFormat>(
506  break;
507 
508  case T_mirror:
509  aPcbPlotParams->m_mirror = parseBool();
510  break;
511 
512  case T_drillshape:
513  aPcbPlotParams->m_drillMarks = static_cast<PCB_PLOT_PARAMS::DrillMarksType>
514  ( parseInt( 0, 2 ) );
515  break;
516 
517  case T_scaleselection:
518  aPcbPlotParams->m_scaleSelection = parseInt( 0, 4 );
519  break;
520 
521  case T_outputdirectory:
522  NeedSYMBOLorNUMBER(); // a dir name can be like a number
523  aPcbPlotParams->m_outputDirectory = FROM_UTF8( CurText() );
524  break;
525 
526  default:
527  skipCurrent(); // skip unknown or outdated plot parameter
528  skip_right = true; // the closing right token is already read.
529  break;
530  }
531 
532  if( ! skip_right )
533  NeedRIGHT();
534  }
535 }
536 
537 
539 {
540  T token = NeedSYMBOL();
541 
542  if( token != T_false && token != T_true )
543  Expecting( "true|false" );
544 
545  return token == T_true;
546 }
547 
548 
549 int PCB_PLOT_PARAMS_PARSER::parseInt( int aMin, int aMax )
550 {
551  T token = NextTok();
552 
553  if( token != T_NUMBER )
554  Expecting( T_NUMBER );
555 
556  int val = atoi( CurText() );
557 
558  if( val < aMin )
559  val = aMin;
560  else if( val > aMax )
561  val = aMax;
562 
563  return val;
564 }
565 
566 
568 {
569  T token = NextTok();
570 
571  if( token != T_NUMBER )
572  Expecting( T_NUMBER );
573 
574  double val = strtod( CurText(), NULL );
575 
576  return val;
577 }
578 
579 
581 {
582  int curr_level = 0;
583  T token;
584 
585  while( ( token = NextTok() ) != T_EOF )
586  {
587  if( token == T_LEFT )
588  curr_level--;
589 
590  if( token == T_RIGHT )
591  {
592  curr_level++;
593 
594  if( curr_level > 0 )
595  return;
596  }
597  }
598 }
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
static bool setDouble(double *aTarget, double aValue, double aMin, double aMax)
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)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:120
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.
double m_HPGLPenDiam
HPGL only: pen diameter in MILS, useful to fill areas However, it is in mm in hpgl files...
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...
static bool setInt(int *aTarget, int aValue, int aMin, int aMax)
#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)
bool SetHPGLPenDiameter(double aValue)
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
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_gerberPrecision
precision of coordinates in Gerber files: accepted 5 or 6 when units are in mm (6 or 7 in inches...