![]() |
KiCad PCB EDA Suite
|
#include <plotter.h>
#include <pcbplot.h>
#include <base_units.h>
#include <locale_io.h>
#include <reporter.h>
#include <board.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 (LAYER_NUM aLayer) |
Function GetGerberProtelExtension. More... | |
const wxString | GetGerberFileFunctionAttribute (const BOARD *aBoard, LAYER_NUM aLayer) |
Function GetGerberFileFunctionAttribute Returns the "file function" attribute for aLayer, as defined in the Gerber file format specification J1 (chapter 5). More... | |
static const wxString | GetGerberFilePolarityAttribute (LAYER_NUM aLayer) |
static wxString & | makeStringCompatX1 (wxString &aText, bool aUseX1CompatibilityMode) |
void | AddGerberX2Header (PLOTTER *aPlotter, const BOARD *aBoard, bool aUseX1CompatibilityMode) |
Calculates 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. More... | |
void | AddGerberX2Attribute (PLOTTER *aPlotter, const BOARD *aBoard, LAYER_NUM aLayer, bool aUseX1CompatibilityMode) |
Calculates 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. More... | |
void | BuildPlotFileName (wxFileName *aFilename, const wxString &aOutputDir, const wxString &aSuffix, const wxString &aExtension) |
Function BuildPlotFileName (helper function) Complete a plot filename: forces the output directory, add a suffix to the name and sets the specified extension the suffix is usually the layer name replaces not allowed chars in suffix by '_'. More... | |
void AddGerberX2Attribute | ( | PLOTTER * | aPlotter, |
const BOARD * | aBoard, | ||
LAYER_NUM | aLayer, | ||
bool | aUseX1CompatibilityMode | ||
) |
Calculates 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 | = the current plotter. |
aBoard | = the board, needed to extract some info |
aLayer | = the layer number to create the attribute for |
aUseX1CompatibilityMode | = 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 350 of file pcbplot.cpp.
References AddGerberX2Header(), PLOTTER::AddLineToHeader(), GetGerberFileFunctionAttribute(), GetGerberFilePolarityAttribute(), and makeStringCompatX1().
Referenced by StartPlotBoard().
void AddGerberX2Header | ( | PLOTTER * | aPlotter, |
const BOARD * | aBoard, | ||
bool | aUseX1CompatibilityMode = false |
||
) |
Calculates 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 | = the current plotter. |
aBoard | = the board, needed to extract some info |
aUseX1CompatibilityMode | = 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 279 of file pcbplot.cpp.
References PLOTTER::AddLineToHeader(), ExpandTextVars(), GBR_NC_STRING_FORMAT_X1, GBR_NC_STRING_FORMAT_X2, GbrMakeCreationDateAttributeString(), GbrMakeProjectGUIDfromString(), GetBuildVersion(), BOARD::GetDesignSettings(), BOARD::GetFileName(), BOARD::GetPlotOptions(), BOARD::GetProject(), TITLE_BLOCK::GetRevision(), BOARD::GetTitleBlock(), PCB_PLOT_PARAMS::GetUseAuxOrigin(), BOARD_DESIGN_SETTINGS::m_AuxOrigin, and makeStringCompatX1().
Referenced by AddGerberX2Attribute(), GERBER_WRITER::createDrillFile(), and PLACEFILE_GERBER_WRITER::CreatePlaceFile().
void BuildPlotFileName | ( | wxFileName * | aFilename, |
const wxString & | aOutputDir, | ||
const wxString & | aSuffix, | ||
const wxString & | aExtension | ||
) |
Function BuildPlotFileName (helper function) Complete a plot filename: forces the output directory, add a suffix to the name and sets the specified extension the suffix is usually the layer name replaces not allowed chars in suffix by '_'.
aFilename | = the wxFileName to initialize Contains the base filename |
aOutputDir | = the path |
aSuffix | = the suffix to add to the base filename |
aExtension | = the file extension |
Definition at line 369 of file pcbplot.cpp.
Referenced by DIALOG_EXPORT_SVG::ExportSVGFile(), PLOT_CONTROLLER::OpenPlotfile(), and DIALOG_PLOT::Plot().
Function GetGerberFileFunctionAttribute Returns 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 | = the board, needed to get the total count of copper layers |
aLayer | = the layer number to create the attribute for |
Definition at line 86 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 208 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 | ( | LAYER_NUM | aLayer | ) |
Function GetGerberProtelExtension.
Definition at line 45 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, Format(), and IsCopperLayer().
Referenced by PLOT_CONTROLLER::OpenPlotfile(), and DIALOG_PLOT::Plot().
|
static |
Definition at line 267 of file pcbplot.cpp.
Referenced by AddGerberX2Attribute(), and AddGerberX2Header().