KiCad PCB EDA Suite
|
#include <plotters/plotter.h>
#include <pcbplot.h>
#include <base_units.h>
#include <lset.h>
#include <locale_io.h>
#include <reporter.h>
#include <board.h>
#include <board_design_settings.h>
#include <plotcontroller.h>
#include <pcb_plot_params.h>
#include <wx/ffile.h>
#include <dialog_plot.h>
#include <build_version.h>
#include <gbr_metadata.h>
#include <render_settings.h>
Go to the source code of this file.
Functions | |
const wxString | GetGerberProtelExtension (int aLayer) |
const wxString | GetGerberFileFunctionAttribute (const BOARD *aBoard, int aLayer) |
Return the "file function" attribute for aLayer, as defined in the Gerber file format specification J1 (chapter 5). | |
static const wxString | GetGerberFilePolarityAttribute (int aLayer) |
static wxString & | makeStringCompatX1 (wxString &aText, bool aUseX1CompatibilityMode) |
static void | replaceReservedCharsField (wxString &aMsg) |
void | AddGerberX2Header (PLOTTER *aPlotter, const BOARD *aBoard, bool aUseX1CompatibilityMode) |
Calculate some X2 attributes as defined in the Gerber file format specification J4 (chapter 5) and add them the to the gerber file header. | |
void | AddGerberX2Attribute (PLOTTER *aPlotter, const BOARD *aBoard, int aLayer, bool aUseX1CompatibilityMode) |
Calculate some X2 attributes as defined in the Gerber file format specification and add them to the gerber file header. | |
void | BuildPlotFileName (wxFileName *aFilename, const wxString &aOutputDir, const wxString &aSuffix, const wxString &aExtension) |
Complete a plot filename. | |
void AddGerberX2Attribute | ( | PLOTTER * | aPlotter, |
const BOARD * | aBoard, | ||
int | aLayer, | ||
bool | aUseX1CompatibilityMode | ||
) |
Calculate some X2 attributes as defined in the Gerber file format specification and add them to the gerber file header.
TF.GenerationSoftware TF.CreationDate TF.ProjectId TF.FileFunction TF.FilePolarity
aPlotter | is the current plotter. |
aBoard | is the board, needed to extract some info. |
aLayer | is the layer number to create the attribute for. |
aUseX1CompatibilityMode | set to false to generate X2 attributes, true to use X1 compatibility (X2 attributes added as structured comments, starting by "G04 #@! " followed by the X2 attribute. |
Definition at line 360 of file pcbplot.cpp.
References AddGerberX2Header(), PLOTTER::AddLineToHeader(), GetGerberFileFunctionAttribute(), GetGerberFilePolarityAttribute(), makeStringCompatX1(), and text.
Referenced by StartPlotBoard().
void AddGerberX2Header | ( | PLOTTER * | aPlotter, |
const BOARD * | aBoard, | ||
bool | aUseX1CompatibilityMode = false |
||
) |
Calculate some X2 attributes as defined in the Gerber file format specification J4 (chapter 5) and add them the to the gerber file header.
TF.GenerationSoftware TF.CreationDate TF.ProjectId file format attribute is not added
aPlotter | is the current plotter. |
aBoard | is the board, needed to extract some info. |
aUseX1CompatibilityMode | set to false to generate X2 attributes, true to use X1 compatibility (X2 attributes added as structured comments, starting by "G04 #@! " followed by the X2 attribute |
Definition at line 294 of file pcbplot.cpp.
References PLOTTER::AddLineToHeader(), ExpandTextVars(), GBR_NC_STRING_FORMAT_X1, GBR_NC_STRING_FORMAT_X2, GbrMakeCreationDateAttributeString(), GbrMakeProjectGUIDfromString(), BOARD_DESIGN_SETTINGS::GetAuxOrigin(), GetBuildVersion(), BOARD::GetDesignSettings(), BOARD::GetFileName(), BOARD::GetPlotOptions(), BOARD::GetProject(), TITLE_BLOCK::GetRevision(), BOARD::GetTitleBlock(), PCB_PLOT_PARAMS::GetUseAuxOrigin(), makeStringCompatX1(), replaceReservedCharsField(), text, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by AddGerberX2Attribute(), GERBER_WRITER::createDrillFile(), PLACEFILE_GERBER_WRITER::CreatePlaceFile(), and GENDRILL_WRITER_BASE::genDrillMapFile().
void BuildPlotFileName | ( | wxFileName * | aFilename, |
const wxString & | aOutputDir, | ||
const wxString & | aSuffix, | ||
const wxString & | aExtension | ||
) |
Complete a plot filename.
It forces the output directory, adds a suffix to the name, and sets the specified extension. The suffix is usually the layer name and replaces illegal file name character in the suffix with an underscore character.
aFilename | is the file name to initialize that contains the base filename. |
aOutputDir | is the path. |
aSuffix | is the suffix to add to the base filename. |
aExtension | is the file extension. |
Definition at line 379 of file pcbplot.cpp.
Referenced by DIALOG_EXPORT_SVG::ExportSVGFile(), PCBNEW_JOBS_HANDLER::JobExportGerbers(), PLOT_CONTROLLER::OpenPlotfile(), and DIALOG_PLOT::Plot().
const wxString GetGerberFileFunctionAttribute | ( | const BOARD * | aBoard, |
int | aLayer | ||
) |
Return the "file function" attribute for aLayer, as defined in the Gerber file format specification J1 (chapter 5).
The returned string includes the "%TF.FileFunction" attribute prefix and the "*%" suffix.
aBoard | is the board, needed to get the total count of copper layers. |
aLayer | is the layer number to create the attribute for. |
Definition at line 82 of file pcbplot.cpp.
References B_Adhes, B_Cu, B_Fab, B_Mask, B_Paste, B_SilkS, Cmts_User, Dwgs_User, Eco1_User, Eco2_User, Edge_Cuts, F_Adhes, F_Cu, F_Fab, F_Mask, F_Paste, F_SilkS, BOARD::GetCopperLayerCount(), BOARD::GetLayerType(), IsCopperLayer(), LT_MIXED, LT_POWER, LT_SIGNAL, and ToLAYER_ID().
Referenced by AddGerberX2Attribute().
|
static |
Definition at line 210 of file pcbplot.cpp.
References B_Adhes, B_Mask, B_Paste, B_SilkS, F_Adhes, F_Mask, F_Paste, F_SilkS, and IsCopperLayer().
Referenced by AddGerberX2Attribute().
const wxString GetGerberProtelExtension | ( | int | aLayer | ) |
Definition at line 43 of file pcbplot.cpp.
References B_Adhes, B_Cu, B_Mask, B_Paste, B_SilkS, Cmts_User, Dwgs_User, Eco1_User, Eco2_User, Edge_Cuts, F_Adhes, F_Cu, F_Mask, F_Paste, F_SilkS, and IsCopperLayer().
Referenced by PCBNEW_JOBS_HANDLER::JobExportGerbers(), PLOT_CONTROLLER::OpenPlotfile(), and DIALOG_PLOT::Plot().
|
static |
Definition at line 271 of file pcbplot.cpp.
Referenced by AddGerberX2Attribute(), and AddGerberX2Header().
|
static |
Definition at line 286 of file pcbplot.cpp.
Referenced by AddGerberX2Header().