KiCad PCB EDA Suite
pcb_plot_params.cpp
Go to the documentation of this file.
1 
2 /*
3  * This program source code file is part of KiCad, a free EDA CAD application.
4  *
5  * Copyright (C) 1992-2015 KiCad Developers, see change_log.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 //#include <wx/wx.h>
26 #include <pcb_plot_params_parser.h>
27 #include <pcb_plot_params.h>
29 #include <plot_common.h>
30 #include <macros.h>
31 #include <convert_to_biu.h>
32 
33 
34 #define PLOT_LINEWIDTH_MIN (0.02*IU_PER_MM) // min value for default line thickness
35 #define PLOT_LINEWIDTH_MAX (2*IU_PER_MM) // max value for default line thickness
36 #define PLOT_LINEWIDTH_DEFAULT (0.15*IU_PER_MM) // def. value for default line thickness
37 #define HPGL_PEN_DIAMETER_MIN 0
38 #define HPGL_PEN_DIAMETER_MAX 100 // Unit = mil
39 #define HPGL_PEN_SPEED_MIN 1 // this param is always in cm/s
40 #define HPGL_PEN_SPEED_MAX 99 // this param is always in cm/s
41 #define HPGL_PEN_NUMBER_MIN 1
42 #define HPGL_PEN_NUMBER_MAX 16
43 
44 
50 
51 // default trailing digits in Gerber coordinates, when units are mm
52 // This is also the max usable precision (i.e. internal Pcbnew Units)
53 static const int gbrDefaultPrecision = 6;
54 
55 
56 using namespace PCBPLOTPARAMS_T;
57 
58 
59 static const char* getTokenName( T aTok )
60 {
61  return PCB_PLOT_PARAMS_LEXER::TokenName( aTok );
62 }
63 
64 
65 static bool setInt( int* aInt, int aValue, int aMin, int aMax )
66 {
67  int temp = aValue;
68 
69  if( aValue < aMin )
70  temp = aMin;
71  else if( aValue > aMax )
72  temp = aMax;
73 
74  *aInt = temp;
75  return (temp == aValue);
76 }
77 
78 // PCB_PLOT_PARAMS
79 
81 {
82  m_useGerberProtelExtensions = false;
83  m_useGerberAttributes = false;
84  m_includeGerberNetlistInfo = false;
85  m_createGerberJobFile = false;
86  m_gerberPrecision = gbrDefaultPrecision;
87  m_excludeEdgeLayer = true;
88  m_lineWidth = g_DrawDefaultLineThickness;
89  m_plotFrameRef = false;
90  m_plotViaOnMaskLayer = false;
91  m_plotMode = FILLED;
92  m_DXFplotPolygonMode = true;
93  m_useAuxOrigin = false;
94  m_HPGLPenNum = 1;
95  m_HPGLPenSpeed = 20; // this param is always in cm/s
96  m_HPGLPenDiam = 15; // in mils
97  m_negative = false;
98  m_A4Output = false;
99  m_plotReference = true;
100  m_plotValue = true;
101  m_plotInvisibleText = false;
102  m_plotPadsOnSilkLayer = false;
103  m_subtractMaskFromSilk = false;
104  m_format = PLOT_FORMAT_GERBER;
105  m_mirror = false;
106  m_drillMarks = SMALL_DRILL_SHAPE;
107  m_autoScale = false;
108  m_scale = 1.0;
109  m_scaleSelection = 1;
110  m_fineScaleAdjustX = 1.0;
111  m_fineScaleAdjustY = 1.0;
112  m_widthAdjust = 0.;
113  m_outputDirectory.clear();
114  m_color = BLACK;
115  m_textMode = PLOTTEXTMODE_DEFAULT;
116  m_layerSelection = LSET( 2, F_SilkS, B_SilkS) | LSET::AllCuMask();
117 
118  // This parameter controls if the NPTH pads will be plotted or not
119  // it is a "local" parameter
120  m_skipNPTH_Pads = false;
121 }
122 
124 {
125  // Currently geber files use mm.
126  // accepted precision is only 6 (max value, this is the resolution of Pcbnew)
127  // or 5, min value for professional boards, when 6 creates problems
128  // to board makers.
129 
130  m_gerberPrecision = aPrecision == gbrDefaultPrecision-1 ? gbrDefaultPrecision-1 :
132 }
133 
134 
135 // PLEASE NOTE: only plot dialog options are processed
137  int aNestLevel, int aControl ) const
138 {
139  const char* falseStr = getTokenName( T_false );
140  const char* trueStr = getTokenName( T_true );
141 
142  aFormatter->Print( aNestLevel, "(%s\n", getTokenName( T_pcbplotparams ) );
143 
144  aFormatter->Print( aNestLevel+1, "(%s 0x%s)\n", getTokenName( T_layerselection ),
145  m_layerSelection.FmtHex().c_str() );
146 
147  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberextensions ),
148  m_useGerberProtelExtensions ? trueStr : falseStr );
149 
150  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberattributes ), trueStr );
151 
152  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberadvancedattributes ), trueStr );
153 
154  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_creategerberjobfile ), trueStr );
155 
156  if( m_gerberPrecision != gbrDefaultPrecision ) // save this option only if it is not the default value,
157  // to avoid incompatibility with older Pcbnew version
158  aFormatter->Print( aNestLevel+1, "(%s %d)\n",
159  getTokenName( T_gerberprecision ), m_gerberPrecision );
160 
161  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_excludeedgelayer ),
162  m_excludeEdgeLayer ? trueStr : falseStr );
163  aFormatter->Print( aNestLevel+1, "(%s %f)\n", getTokenName( T_linewidth ),
164  m_lineWidth / IU_PER_MM );
165  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotframeref ),
166  m_plotFrameRef ? trueStr : falseStr );
167  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_viasonmask ),
168  m_plotViaOnMaskLayer ? trueStr : falseStr );
169  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_mode ),
170  GetPlotMode() == SKETCH ? 2 : 1 ); // Value 0 (LINE mode) no more used
171  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_useauxorigin ),
172  m_useAuxOrigin ? trueStr : falseStr );
173  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpennumber ),
174  m_HPGLPenNum );
175 
176  // Obsolete parameter, pen speed is no more managed, because hpgl format
177  // is now an export format, and for this, pen speed has no meaning
178  // aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpenspeed ),
179  // m_HPGLPenSpeed );
180 
181  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpenspeed ),
182  m_HPGLPenSpeed );
183  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpendiameter ),
184  m_HPGLPenDiam );
185  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psnegative ),
186  m_negative ? trueStr : falseStr );
187  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psa4output ),
188  m_A4Output ? trueStr : falseStr );
189  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotreference ),
190  m_plotReference ? trueStr : falseStr );
191  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotvalue ),
192  m_plotValue ? trueStr : falseStr );
193  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotinvisibletext ),
194  m_plotInvisibleText ? trueStr : falseStr );
195  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_padsonsilk ),
196  m_plotPadsOnSilkLayer ? trueStr : falseStr );
197  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_subtractmaskfromsilk ),
198  m_subtractMaskFromSilk ? trueStr : falseStr );
199  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_outputformat ),
200  m_format );
201  aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_mirror ),
202  m_mirror ? trueStr : falseStr );
203  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_drillshape ),
204  m_drillMarks );
205  aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_scaleselection ),
206  m_scaleSelection );
207  aFormatter->Print( aNestLevel+1, "(%s %s)", getTokenName( T_outputdirectory ),
208  aFormatter->Quotew( m_outputDirectory ).c_str() );
209  aFormatter->Print( 0, ")\n" );
210 }
211 
212 
214 {
215  aParser->Parse( this );
216 }
217 
218 
219 bool PCB_PLOT_PARAMS::IsSameAs( const PCB_PLOT_PARAMS &aPcbPlotParams, bool aCompareOnlySavedPrms ) const
220 {
221  if( m_layerSelection != aPcbPlotParams.m_layerSelection )
222  return false;
223  if( m_useGerberProtelExtensions != aPcbPlotParams.m_useGerberProtelExtensions )
224  return false;
225  if( m_useGerberAttributes != aPcbPlotParams.m_useGerberAttributes )
226  return false;
227  if( m_useGerberAttributes && m_includeGerberNetlistInfo != aPcbPlotParams.m_includeGerberNetlistInfo )
228  return false;
229  if( m_createGerberJobFile != aPcbPlotParams.m_createGerberJobFile )
230  return false;
231  if( m_gerberPrecision != aPcbPlotParams.m_gerberPrecision )
232  return false;
233  if( m_excludeEdgeLayer != aPcbPlotParams.m_excludeEdgeLayer )
234  return false;
235  if( m_lineWidth != aPcbPlotParams.m_lineWidth )
236  return false;
237  if( m_plotFrameRef != aPcbPlotParams.m_plotFrameRef )
238  return false;
239  if( m_plotViaOnMaskLayer != aPcbPlotParams.m_plotViaOnMaskLayer )
240  return false;
241  if( m_plotMode != aPcbPlotParams.m_plotMode )
242  return false;
243  if( !aCompareOnlySavedPrms )
244  {
245  if( m_DXFplotPolygonMode != aPcbPlotParams.m_DXFplotPolygonMode )
246  return false;
247  }
248  if( m_useAuxOrigin != aPcbPlotParams.m_useAuxOrigin )
249  return false;
250  if( m_HPGLPenNum != aPcbPlotParams.m_HPGLPenNum )
251  return false;
252  if( m_HPGLPenSpeed != aPcbPlotParams.m_HPGLPenSpeed )
253  return false;
254  if( m_HPGLPenDiam != aPcbPlotParams.m_HPGLPenDiam )
255  return false;
256  if( m_negative != aPcbPlotParams.m_negative )
257  return false;
258  if( m_A4Output != aPcbPlotParams.m_A4Output )
259  return false;
260  if( m_plotReference != aPcbPlotParams.m_plotReference )
261  return false;
262  if( m_plotValue != aPcbPlotParams.m_plotValue )
263  return false;
264  if( m_plotInvisibleText != aPcbPlotParams.m_plotInvisibleText )
265  return false;
266  if( m_plotPadsOnSilkLayer != aPcbPlotParams.m_plotPadsOnSilkLayer )
267  return false;
268  if( m_subtractMaskFromSilk != aPcbPlotParams.m_subtractMaskFromSilk )
269  return false;
270  if( m_format != aPcbPlotParams.m_format )
271  return false;
272  if( m_mirror != aPcbPlotParams.m_mirror )
273  return false;
274  if( m_drillMarks != aPcbPlotParams.m_drillMarks )
275  return false;
276  if( m_scaleSelection != aPcbPlotParams.m_scaleSelection )
277  return false;
278  if( m_autoScale != aPcbPlotParams.m_autoScale )
279  return false;
280  if( m_scale != aPcbPlotParams.m_scale )
281  return false;
282  if( m_fineScaleAdjustX != aPcbPlotParams.m_fineScaleAdjustX )
283  return false;
284  if( m_fineScaleAdjustY != aPcbPlotParams.m_fineScaleAdjustY )
285  return false;
286  if( m_widthAdjust != aPcbPlotParams.m_widthAdjust )
287  return false;
288  if( !aCompareOnlySavedPrms )
289  {
290  if( m_color != aPcbPlotParams.m_color )
291  return false;
292  }
293  if( m_textMode != aPcbPlotParams.m_textMode )
294  return false;
295  if( !m_outputDirectory.IsSameAs( aPcbPlotParams.m_outputDirectory ) )
296  return false;
297 
298  return true;
299 }
300 
301 
303 {
304  return setInt( &m_HPGLPenDiam, aValue, HPGL_PEN_DIAMETER_MIN, HPGL_PEN_DIAMETER_MAX );
305 }
306 
307 
309 {
310  return setInt( &m_HPGLPenSpeed, aValue, HPGL_PEN_SPEED_MIN, HPGL_PEN_SPEED_MAX );
311 }
312 
313 
315 {
316  return setInt( &m_lineWidth, aValue, PLOT_LINEWIDTH_MIN, PLOT_LINEWIDTH_MAX );
317 }
318 
319 // PCB_PLOT_PARAMS_PARSER
320 
322  PCB_PLOT_PARAMS_LEXER( aReader )
323 {
324 }
325 
326 
327 PCB_PLOT_PARAMS_PARSER::PCB_PLOT_PARAMS_PARSER( char* aLine, const wxString& aSource ) :
328  PCB_PLOT_PARAMS_LEXER( aLine, aSource )
329 {
330 }
331 
332 
334 {
335  T token;
336 
337  while( ( token = NextTok() ) != T_RIGHT )
338  {
339  if( token == T_EOF)
340  Unexpected( T_EOF );
341 
342  if( token == T_LEFT )
343  token = NextTok();
344 
345  if( token == T_pcbplotparams )
346  continue;
347 
348  bool skip_right = false;
349 
350  switch( token )
351  {
352  case T_layerselection:
353  {
354  token = NeedSYMBOLorNUMBER();
355 
356  const std::string& cur = CurStr();
357 
358  if( token == T_NUMBER ) // pretty 3 format had legacy Cu stack.
359  {
360  // unsigned legacy_mask = atol( cur.c_str() );
361 
362  /* It's not possible to convert a legacy Cu layer number to a new
363  Cu layer number without knowing the number or total Cu layers
364  in the legacy board. We do not have that information here.
365  So simply set all layers ON. User can turn them off in the UI.
366  This is one of the superiorities of the new Cu sequence.
367  aPcbPlotParams->m_layerSelection = LEGACY_PLUGIN::leg_mask2new( cu_count, legacy_mask );
368  */
369 
370  // sorry, use the UI once to fix:
371  aPcbPlotParams->m_layerSelection = LSET( 2, F_SilkS, B_SilkS) | LSET::AllCuMask();
372  }
373  else if( cur.find_first_of( "0x" ) == 0 ) // pretty ver. 4.
374  {
375  // skip the leading 2 0x bytes.
376  aPcbPlotParams->m_layerSelection.ParseHex( cur.c_str()+2, cur.size()-2 );
377  }
378  else
379  Expecting( "integer or hex layerSelection" );
380  }
381  break;
382 
384  aPcbPlotParams->m_useGerberProtelExtensions = parseBool();
385  break;
386 
388  aPcbPlotParams->m_useGerberAttributes = parseBool();
389  break;
390 
392  aPcbPlotParams->m_includeGerberNetlistInfo = parseBool();
393  break;
394 
396  aPcbPlotParams->m_createGerberJobFile = parseBool();
397  break;
398 
399  case T_gerberprecision:
400  aPcbPlotParams->m_gerberPrecision =
402  break;
403 
404  case T_psa4output:
405  aPcbPlotParams->m_A4Output = parseBool();
406  break;
407 
408  case T_excludeedgelayer:
409  aPcbPlotParams->m_excludeEdgeLayer = parseBool();
410  break;
411 
412  case T_linewidth:
413  {
414  // Due to a bug, this (minor) parameter was saved in biu
415  // and now is saved in mm
416  // If the read value is outside bounds, force a default value
417  double tmp = parseDouble();
418  if( !aPcbPlotParams->SetLineWidth( KiROUND( tmp * IU_PER_MM ) ) )
419  aPcbPlotParams->SetLineWidth( PLOT_LINEWIDTH_DEFAULT );
420  }
421  break;
422 
423  case T_plotframeref:
424  aPcbPlotParams->m_plotFrameRef = parseBool();
425  break;
426 
427  case T_viasonmask:
428  aPcbPlotParams->m_plotViaOnMaskLayer = parseBool();
429  break;
430 
431  case T_mode:
432  aPcbPlotParams->SetPlotMode( parseInt( 0, 2 ) > 1 ? SKETCH : FILLED );
433  break;
434 
435  case T_useauxorigin:
436  aPcbPlotParams->m_useAuxOrigin = parseBool();
437  break;
438 
439  case T_hpglpennumber:
440  aPcbPlotParams->m_HPGLPenNum = parseInt( HPGL_PEN_NUMBER_MIN,
442  break;
443 
444  case T_hpglpenspeed:
445  aPcbPlotParams->m_HPGLPenSpeed = parseInt( HPGL_PEN_SPEED_MIN,
447  break;
448 
449  case T_hpglpendiameter:
450  aPcbPlotParams->m_HPGLPenDiam = parseInt( HPGL_PEN_DIAMETER_MIN,
452  break;
453 
454  case T_hpglpenoverlay:
455  // No more used. juste here for compatibility with old versions
457  break;
458 
459  case T_pscolor:
460  NeedSYMBOL(); // This actually was never used...
461  break;
462 
463  case T_psnegative:
464  aPcbPlotParams->m_negative = parseBool();
465  break;
466 
467  case T_plotreference:
468  aPcbPlotParams->m_plotReference = parseBool();
469  break;
470 
471  case T_plotvalue:
472  aPcbPlotParams->m_plotValue = parseBool();
473  break;
474 
475  case T_plotinvisibletext:
476  aPcbPlotParams->m_plotInvisibleText = parseBool();
477  break;
478 
479  case T_padsonsilk:
480  aPcbPlotParams->m_plotPadsOnSilkLayer= parseBool();
481  break;
482 
484  aPcbPlotParams->m_subtractMaskFromSilk = parseBool();
485  break;
486 
487  case T_outputformat:
488  aPcbPlotParams->m_format = static_cast<PlotFormat>(
490  break;
491 
492  case T_mirror:
493  aPcbPlotParams->m_mirror = parseBool();
494  break;
495 
496  case T_drillshape:
497  aPcbPlotParams->m_drillMarks = static_cast<PCB_PLOT_PARAMS::DrillMarksType>
498  ( parseInt( 0, 2 ) );
499  break;
500 
501  case T_scaleselection:
502  aPcbPlotParams->m_scaleSelection = parseInt( 0, 4 );
503  break;
504 
505  case T_outputdirectory:
506  NeedSYMBOL();
507  aPcbPlotParams->m_outputDirectory = FROM_UTF8( CurText() );
508  break;
509 
510  default:
511  skipCurrent(); // skip unknown or outdated plot parameter
512  skip_right = true; // the closing right token is already read.
513  break;
514  }
515 
516  if( ! skip_right )
517  NeedRIGHT();
518  }
519 }
520 
521 
523 {
524  T token = NeedSYMBOL();
525 
526  if( token != T_false && token != T_true )
527  Expecting( "true|false" );
528 
529  return token == T_true;
530 }
531 
532 
533 int PCB_PLOT_PARAMS_PARSER::parseInt( int aMin, int aMax )
534 {
535  T token = NextTok();
536 
537  if( token != T_NUMBER )
538  Expecting( T_NUMBER );
539 
540  int val = atoi( CurText() );
541 
542  if( val < aMin )
543  val = aMin;
544  else if( val > aMax )
545  val = aMax;
546 
547  return val;
548 }
549 
550 
552 {
553  T token = NextTok();
554 
555  if( token != T_NUMBER )
556  Expecting( T_NUMBER );
557 
558  double val = strtod( CurText(), NULL );
559 
560  return val;
561 }
562 
563 
565 {
566  int curr_level = 0;
567  T token;
568 
569  while( ( token = NextTok() ) != T_EOF )
570  {
571  if( token == T_LEFT )
572  curr_level--;
573 
574  if( token == T_RIGHT )
575  {
576  curr_level++;
577 
578  if( curr_level > 0 )
579  return;
580  }
581  }
582 }
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:646
#define HPGL_PEN_NUMBER_MAX
PCBPLOTPARAMS_T::T NeedSYMBOLorNUMBER()
Function NeedSYMBOLorNUMBER calls NextTok() and then verifies that the token read in satisfies bool I...
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.
PlotFormat
Enum PlotFormat is the set of supported output plot formats.
Definition: plot_common.h:49
bool m_excludeEdgeLayer
If false always plot (merge) the pcb edge layer on other layers.
void Unexpected(int aTok)
Function Unexpected throws an IO_ERROR exception with an input file specific error message...
Definition: dsnlexer.cpp:369
static const int gbrDefaultPrecision
bool m_plotPadsOnSilkLayer
Allows pads outlines on silkscreen layer (when pads are also on silk screen)
const std::string & CurStr()
Function CurStr returns a reference to current token in std::string form.
Definition: dsnlexer.h:488
#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.
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)
Class PCB_PLOT_PARAMS_LEXER is an automatically generated class using the TokenList2DnsLexer.cmake technology, based on keywords provided by file: /home/kicad/workspace/kicad-doxygen/common/pcb_plot_params.keywords.
int m_scaleSelection
Scale ratio index (UI only)
PCBPLOTPARAMS_T::T NeedSYMBOL()
Function NeedSYMBOL calls NextTok() and then verifies that the token read in satisfies bool IsSymbol(...
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.
PCBPLOTPARAMS_T::T NextTok()
Function NextTok returns the next token found in the input file or T_EOF when reaching the end of fil...
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 'scrape' 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 const char * TokenName(PCBPLOTPARAMS_T::T aTok)
Function TokenName returns the name of the token in ASCII form.
Common plot library Plot settings, and plotting engines (Postscript, Gerber, HPGL and DXF) ...
std::string Quotew(const wxString &aWrapee)
Definition: richio.cpp:486
#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)
void Expecting(int aTok)
Function Expecting throws an IO_ERROR exception with an input file specific error message...
Definition: dsnlexer.cpp:353
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...
C++ does not put enum values in separate namespaces unless the enum itself is in a separate namespace...
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)
T
enum T contains all this lexer's tokens.
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
void NeedRIGHT()
Function NeedRIGHT calls NextTok() and then verifies that the token read in is a DSN_RIGHT.
Definition: dsnlexer.cpp:401
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:408
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's values with those given ...
Definition: lset.cpp:285
const char * CurText()
Function CurText returns a pointer to the current token's text.
Definition: dsnlexer.h:479
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...