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 );
177 int aNestLevel,
int aControl )
const
179 aFormatter->
Print( aNestLevel,
"(pcbplotparams\n" );
181 aFormatter->
Print( aNestLevel+1,
"(layerselection 0x%s)\n",
184 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 );
427 PCB_PLOT_PARAMS_LEXER( aReader )
433 PCB_PLOT_PARAMS_LEXER( aLine, aSource )
442 while( ( token = NextTok() ) != T_RIGHT )
447 if( token == T_LEFT )
450 if( token == T_pcbplotparams )
453 bool skip_right =
false;
457 case T_layerselection:
459 token = NeedSYMBOLorNUMBER();
461 const std::string& cur = CurStr();
463 if( token == T_NUMBER )
471 else if( cur.find_first_of(
"0x" ) == 0 )
478 Expecting(
"integer or hex layerSelection" );
484 case T_plot_on_all_layers_selection:
486 token = NeedSYMBOLorNUMBER();
488 const std::string& cur = CurStr();
490 if( cur.find_first_of(
"0x" ) == 0 )
498 Expecting(
"hex plot_on_all_layers_selection" );
504 case T_disableapertmacros:
508 case T_usegerberextensions:
512 case T_usegerberattributes:
516 case T_usegerberadvancedattributes:
520 case T_creategerberjobfile:
524 case T_gerberprecision:
529 case T_dashed_line_dash_ratio:
533 case T_dashed_line_gap_ratio:
549 case T_excludeedgelayer:
571 case T_hpglpennumber:
579 case T_hpglpendiameter:
583 case T_hpglpenoverlay:
588 case T_pdf_front_fp_property_popups:
592 case T_pdf_back_fp_property_popups:
600 case T_dxfpolygonmode:
604 case T_dxfimperialunits:
606 : DXF_UNITS::MILLIMETERS;
609 case T_dxfusepcbnewfont:
611 : PLOT_TEXT_MODE::NATIVE;
622 case T_plotinvisibletext:
626 case T_sketchpadsonfab:
630 case T_plotpadnumbers:
638 case T_sketchdnponfab:
642 case T_crossoutdnponfab:
646 case T_subtractmaskfromsilk:
652 parseInt(
static_cast<int>( PLOT_FORMAT::FIRST_FORMAT ),
653 static_cast<int>( PLOT_FORMAT::LAST_FORMAT ) ) );
664 case T_scaleselection:
668 case T_outputdirectory:
669 NeedSYMBOLorNUMBER();
687 T token = NeedSYMBOL();
700 Expecting(
"true, false, yes, or no" );
710 if( token != T_NUMBER )
711 Expecting( T_NUMBER );
713 int val = atoi( CurText() );
717 else if( val > aMax )
728 if( token != T_NUMBER )
729 Expecting( T_NUMBER );
740 while( ( token = NextTok() ) != T_EOF )
742 if( token == T_LEFT )
745 if( token == T_RIGHT )
constexpr EDA_IU_SCALE pcbIUScale
BASE_SET & set(size_t pos)
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)
bool m_crossoutDNPFPsOnFabLayers
double m_dashedLineGapRatio
std::optional< bool > m_plotViaOnMaskLayer
bool m_hideDNPFPsOnFabLayers
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
Deprecated; only used for reading legacy files.
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
bool m_sketchDNPFPsOnFabLayers
double GetDashedLineDashRatio() const
void SetSvgPrecision(unsigned aPrecision)
DRILL_MARKS m_drillMarks
Plot pad numbers when sketching pads on fab layers.
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.
OUTLINE_MODE GetPlotMode() const
LSET m_layerSelection
Plot format type (chooses the driver to be used)
bool m_plotPadNumbers
FILLED or SKETCH for filled objects.
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