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 );
179 aFormatter->
Print(
"(pcbplotparams" );
183 aFormatter->
Print(
"(plot_on_all_layers_selection 0x%s)",
239 aFormatter->
Print(
"(outputformat %d)",
static_cast<int>(
m_format ) );
244 aFormatter->
Print(
")" );
250 aParser->
Parse(
this );
411 PCB_PLOT_PARAMS_LEXER( aReader ),
412 m_boardFileVersion( aBoardFileVersion )
418 PCB_PLOT_PARAMS_LEXER( aLine, aSource ),
419 m_boardFileVersion( 0 )
581 newLayers[newLayer] = aLegacyLSET[legacyLayer];
591 while( ( token = NextTok() ) != T_RIGHT )
596 if( token == T_LEFT )
599 if( token == T_pcbplotparams )
602 bool skip_right =
false;
606 case T_layerselection:
608 token = NeedSYMBOLorNUMBER();
610 const std::string& cur = CurStr();
612 if( token == T_NUMBER )
620 else if( cur.find_first_of(
"0x" ) == 0 )
629 legacyLSET.
ParseHex( cur.c_str() + 2, cur.size() - 2 );
640 Expecting(
"integer or hex layerSelection" );
646 case T_plot_on_all_layers_selection:
648 token = NeedSYMBOLorNUMBER();
650 const std::string& cur = CurStr();
652 if( cur.find_first_of(
"0x" ) == 0 )
661 legacyLSET.
ParseHex( cur.c_str() + 2, cur.size() - 2 );
673 Expecting(
"hex plot_on_all_layers_selection" );
679 case T_disableapertmacros:
683 case T_usegerberextensions:
687 case T_usegerberattributes:
691 case T_usegerberadvancedattributes:
695 case T_creategerberjobfile:
699 case T_gerberprecision:
704 case T_dashed_line_dash_ratio:
708 case T_dashed_line_gap_ratio:
724 case T_excludeedgelayer:
746 case T_hpglpennumber:
754 case T_hpglpendiameter:
758 case T_hpglpenoverlay:
763 case T_pdf_front_fp_property_popups:
767 case T_pdf_back_fp_property_popups:
775 case T_pdf_single_document:
779 case T_dxfpolygonmode:
783 case T_dxfimperialunits:
785 : DXF_UNITS::MILLIMETERS;
788 case T_dxfusepcbnewfont:
790 : PLOT_TEXT_MODE::NATIVE;
801 case T_plot_black_and_white:
805 case T_plotinvisibletext:
809 case T_sketchpadsonfab:
813 case T_plotpadnumbers:
821 case T_sketchdnponfab:
825 case T_crossoutdnponfab:
829 case T_subtractmaskfromsilk:
835 parseInt(
static_cast<int>( PLOT_FORMAT::FIRST_FORMAT ),
836 static_cast<int>( PLOT_FORMAT::LAST_FORMAT ) ) );
847 case T_scaleselection:
851 case T_outputdirectory:
852 NeedSYMBOLorNUMBER();
870 T token = NeedSYMBOL();
883 Expecting(
"true, false, yes, or no" );
893 if( token != T_NUMBER )
894 Expecting( T_NUMBER );
896 int val = atoi( CurText() );
900 else if( val > aMax )
911 if( token != T_NUMBER )
912 Expecting( T_NUMBER );
923 while( ( token = NextTok() ) != T_EOF )
925 if( token == T_LEFT )
928 if( token == T_RIGHT )
constexpr EDA_IU_SCALE pcbIUScale
int ParseHex(const std::string &str)
Convert the output of FmtHex() and replaces this set's values with those given in the input string.
BASE_SET & set(size_t pos)
std::string FmtHex() const
Return a hex string showing contents of this set.
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.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
The parser for PCB_PLOT_PARAMS.
void skipCurrent()
Skip the current token level.
PCB_PLOT_PARAMS_PARSER(LINE_READER *aReader, int aBoardFileVersion)
int parseInt(int aMin, int aMax)
Parse an integer and constrains it between two values.
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...
void SetLayerSelection(LSET aSelection)
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.
void SetPlotOnAllLayersSelection(LSET aSelection)
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 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
bool m_PDFSingle
Generate a single PDF file for all layers.
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.
void Format(OUTPUTFORMATTER *aFormatter) const
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)
static const std::map< LEGACY_PCB_LAYER_ID, PCB_LAYER_ID > s_legacyLayerIdMap
#define HPGL_PEN_DIAMETER_MAX
LEGACY_PCB_LAYER_ID
These are the layer IDs from before 5e0abadb23425765e164f49ee2f893e94ddb97fc, and are needed for mapp...
@ LEGACY_UNSELECTED_LAYER
@ LEGACY_PCB_LAYER_ID_COUNT
static const int gbrDefaultPrecision
#define HPGL_PEN_SPEED_MIN
#define HPGL_PEN_NUMBER_MIN
#define SVG_PRECISION_MAX
#define SVG_PRECISION_DEFAULT
LSET remapLegacyLayerLSET(const BASE_SET &aLegacyLSET)
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