36#define PLOT_LINEWIDTH_DEFAULT ( DEFAULT_TEXT_WIDTH * IU_PER_MM )
38#define HPGL_PEN_DIAMETER_MIN 0
39#define HPGL_PEN_DIAMETER_MAX 100.0
40#define HPGL_PEN_SPEED_MIN 1
41#define HPGL_PEN_SPEED_MAX 99
42#define HPGL_PEN_NUMBER_MIN 1
43#define HPGL_PEN_NUMBER_MAX 16
45#define SVG_PRECISION_MIN 3U
46#define SVG_PRECISION_MAX 6U
47#define SVG_PRECISION_DEFAULT 4
55using namespace PCBPLOTPARAMS_T;
60 return PCB_PLOT_PARAMS_LEXER::TokenName( aTok );
64static bool setInt(
int* aTarget,
int aValue,
int aMin,
int aMax )
70 else if( aValue > aMax )
74 return ( temp == aValue );
78static bool setDouble(
double* aTarget,
double aValue,
double aMin,
double aMax )
84 else if( aValue > aMax )
88 return ( temp == aValue );
174 int aNestLevel,
int aControl )
const
176 aFormatter->
Print( aNestLevel,
"(pcbplotparams\n" );
178 aFormatter->
Print( aNestLevel+1,
"(layerselection 0x%s)\n",
181 aFormatter->
Print( aNestLevel+1,
"(plot_on_all_layers_selection 0x%s)\n",
253 aFormatter->
Print( aNestLevel+1,
"(outputformat %d)\n",
static_cast<int>(
m_format ) );
257 aFormatter->
Print( aNestLevel+1,
"(outputdirectory \"%s\")",
259 aFormatter->
Print( 0,
"\n" );
260 aFormatter->
Print( aNestLevel,
")\n" );
266 aParser->
Parse(
this );
418 PCB_PLOT_PARAMS_LEXER( aReader )
424 PCB_PLOT_PARAMS_LEXER( aLine, aSource )
433 while( ( token = NextTok() ) != T_RIGHT )
438 if( token == T_LEFT )
441 if( token == T_pcbplotparams )
444 bool skip_right =
false;
448 case T_layerselection:
450 token = NeedSYMBOLorNUMBER();
452 const std::string& cur = CurStr();
454 if( token == T_NUMBER )
462 else if( cur.find_first_of(
"0x" ) == 0 )
469 Expecting(
"integer or hex layerSelection" );
475 case T_plot_on_all_layers_selection:
477 token = NeedSYMBOLorNUMBER();
479 const std::string& cur = CurStr();
481 if( cur.find_first_of(
"0x" ) == 0 )
489 Expecting(
"hex plot_on_all_layers_selection" );
495 case T_disableapertmacros:
499 case T_usegerberextensions:
503 case T_usegerberattributes:
507 case T_usegerberadvancedattributes:
511 case T_creategerberjobfile:
515 case T_gerberprecision:
520 case T_dashed_line_dash_ratio:
524 case T_dashed_line_gap_ratio:
540 case T_excludeedgelayer:
562 case T_hpglpennumber:
570 case T_hpglpendiameter:
574 case T_hpglpenoverlay:
579 case T_pdf_front_fp_property_popups:
583 case T_pdf_back_fp_property_popups:
591 case T_dxfpolygonmode:
595 case T_dxfimperialunits:
597 : DXF_UNITS::MILLIMETERS;
600 case T_dxfusepcbnewfont:
602 : PLOT_TEXT_MODE::NATIVE;
613 case T_plotreference:
625 case T_plotinvisibletext:
629 case T_sketchpadsonfab:
633 case T_subtractmaskfromsilk:
639 parseInt(
static_cast<int>( PLOT_FORMAT::FIRST_FORMAT ),
640 static_cast<int>( PLOT_FORMAT::LAST_FORMAT ) ) );
651 case T_scaleselection:
655 case T_outputdirectory:
656 NeedSYMBOLorNUMBER();
674 T token = NeedSYMBOL();
687 Expecting(
"true, false, yes, or no" );
697 if( token != T_NUMBER )
698 Expecting( T_NUMBER );
700 int val = atoi( CurText() );
704 else if( val > aMax )
715 if( token != T_NUMBER )
716 Expecting( T_NUMBER );
727 while( ( token = NextTok() ) != T_EOF )
729 if( token == T_LEFT )
732 if( token == T_RIGHT )
constexpr EDA_IU_SCALE pcbIUScale
double parseDouble()
Parse the current token as an ASCII numeric string with possible leading whitespace into a double pre...
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
LSET is a set of PCB_LAYER_IDs.
int ParseHex(const char *aStart, int aCount)
Convert the output of FmtHex() and replaces this set's values with those given in the input string.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
std::string FmtHex() const
Return a hex string showing contents of this LSEQ.
The parser for PCB_PLOT_PARAMS.
void skipCurrent()
Skip the current token level.
int parseInt(int aMin, int aMax)
Parse an integer and constrains it between two values.
PCB_PLOT_PARAMS_PARSER(LINE_READER *aReader)
double parseDouble()
Parse a double precision floating point number.
void Parse(PCB_PLOT_PARAMS *aPcbPlotParams)
Parameters and options when plotting/printing a board.
bool m_sketchPadsOnFabLayers
Plots pads outlines on fab layers.
int m_HPGLPenNum
HPGL only: pen number selection(1 to 9)
double m_dashedLineGapRatio
int m_gerberPrecision
Precision of coordinates in Gerber: accepted 5 or 6 when units are in mm, 6 or 7 in inches (but Pcbne...
std::shared_ptr< COLOR_SETTINGS > m_default_colors
Pointer to color settings to be used for plotting.
OUTLINE_MODE m_plotMode
Used to disable NPTH pads plotting on copper layers.
bool m_A4Output
In polygon mode, each item to plot is converted to a polygon and all polygons are merged.
int m_scaleSelection
Scale ratio index (UI only)
PLOT_TEXT_MODE m_textMode
Holes can be not plotted, have a small mark, or be plotted in actual size.
bool m_plotValue
Enable plotting of part values.
wxString m_outputDirectory
Output directory for plot files (usually relative to the board file)
bool m_PDFMetadata
Generate PDF metadata for SUBJECT and AUTHOR.
bool m_autoScale
Autoscale the plot to fit an A4 (landscape?) sheet.
bool m_useGerberProtelExtensions
On gerbers 'scrape' away the solder mask from silkscreen (trim silks)
int m_HPGLPenSpeed
HPGL only: pen speed, always in cm/s (1 to 99 cm/s)
bool GetCreateGerberJobFile() const
bool m_useAuxOrigin
Plot gerbers using auxiliary (drill) origin instead of absolute coordinates.
double m_scale
When true set the scale to fit the board in the page.
int m_widthAdjust
Compensation for PS printers/plotters that do not strictly obey line width settings.
bool SetHPGLPenDiameter(double aValue)
bool m_PDFFrontFPPropertyPopups
Generate PDF property popup menus for footprints.
double m_fineScaleAdjustX
Compensation for printer scale errors (and therefore.
LSET m_plotOnAllLayersSelection
double m_dashedLineDashRatio
void Format(OUTPUTFORMATTER *aFormatter, int aNestLevel, int aControl=0) const
void SetGerberPrecision(int aPrecision)
bool m_blackAndWhite
Plot in negative color (supported only by some drivers)
bool SetHPGLPenSpeed(int aValue)
bool m_plotInvisibleText
Force plotting of fields marked invisible.
bool m_createGerberJobFile
generate the auxiliary "job file" in gerber format
bool m_plotReference
Enable plotting of part references.
double m_fineScaleAdjustY
expected to be very near 1.0).
double m_HPGLPenDiam
HPGL only: pen diameter in MILS, useful to fill areas However, it is in mm in hpgl files.
bool m_gerberDisableApertMacros
Disable aperture macros in Gerber format (only for broken Gerber readers).
void Parse(PCB_PLOT_PARAMS_PARSER *aParser)
bool m_subtractMaskFromSilk
True if vias are drawn on Mask layer (ie untented, exposed by mask)
COLOR_SETTINGS * m_colors
bool GetUseGerberX2format() const
bool m_mirror
Global scale factor, 1.0 plots a board at actual size.
bool IsSameAs(const PCB_PLOT_PARAMS &aPcbPlotParams) const
Compare current settings to aPcbPlotParams, including not saved parameters in brd file.
bool m_includeGerberNetlistInfo
Include netlist info (only in Gerber X2 format) (chapter ? in revision ?)
unsigned m_svgPrecision
Precision of coordinates in SVG: accepted 3 - 6; 6 is the internal resolution of Pcbnew.
bool GetIncludeGerberNetlistInfo() const
void SetPlotMode(OUTLINE_MODE aPlotMode)
double GetDashedLineGapRatio() const
bool m_PDFBackFPPropertyPopups
on front and/or back of board
double GetDashedLineDashRatio() const
void SetSvgPrecision(unsigned aPrecision)
DRILL_MARKS m_drillMarks
FILLED or SKETCH for filled objects.
bool m_useGerberX2format
Include attributes from the Gerber X2 format (chapter 5 in revision J2)
bool m_negative
Mirror the plot around the X axis.
bool m_plotDrawingSheet
Plot in black and white only.
bool m_plotViaOnMaskLayer
OUTLINE_MODE GetPlotMode() const
LSET m_layerSelection
Plot format type (chooses the driver to be used)
static bool setDouble(double *aResult, double aValue, double aMin, double aMax)
static bool setInt(int *aResult, int aValue, int aMin, int aMax)
static const char * getTokenName(T aTok)
#define HPGL_PEN_NUMBER_MAX
static bool setDouble(double *aTarget, double aValue, double aMin, double aMax)
#define SVG_PRECISION_MIN
#define HPGL_PEN_SPEED_MAX
static bool setInt(int *aTarget, int aValue, int aMin, int aMax)
#define HPGL_PEN_DIAMETER_MIN
static const char * getTokenName(T aTok)
#define HPGL_PEN_DIAMETER_MAX
static const int gbrDefaultPrecision
#define HPGL_PEN_SPEED_MIN
#define HPGL_PEN_NUMBER_MIN
#define SVG_PRECISION_MAX
#define SVG_PRECISION_DEFAULT
DRILL_MARKS
Plots and prints can show holes in pads and vias 3 options are available:
PLOT_FORMAT
The set of supported output plot formats.
wxString From_UTF8(const char *cstring)
constexpr int mmToIU(double mm) const
constexpr T Clamp(const T &lower, const T &value, const T &upper)
Limit value within the range lower <= value <= upper.