49        else if( aLayer == 
B_Cu )
 
   58        case B_Adhes:       
return wxT( 
"gba" );
 
   59        case F_Adhes:       
return wxT( 
"gta" );
 
   61        case B_Paste:       
return wxT( 
"gbp" );
 
   62        case F_Paste:       
return wxT( 
"gtp" );
 
   64        case B_SilkS:       
return wxT( 
"gbo" );
 
   65        case F_SilkS:       
return wxT( 
"gto" );
 
   67        case B_Mask:        
return wxT( 
"gbs" );
 
   68        case F_Mask:        
return wxT( 
"gts" );
 
   76        default:            
return wxT( 
"gbr" );
 
 
   90        attrib = wxT( 
"Glue,Top" );
 
   94        attrib = wxT( 
"Glue,Bot" );
 
   98        attrib = wxT( 
"Legend,Top" );
 
  102        attrib = wxT( 
"Legend,Bot" );
 
  106        attrib = wxT( 
"Soldermask,Top" );
 
  110        attrib = wxT( 
"Soldermask,Bot" );
 
  114        attrib = wxT( 
"Paste,Top" );
 
  118        attrib = wxT( 
"Paste,Bot" );
 
  125        attrib = wxT( 
"Profile,NP" );
 
  129        attrib = wxT( 
"OtherDrawing,Comment" );
 
  133        attrib = wxT( 
"Other,Comment" );
 
  137        attrib = wxT( 
"Other,ECO1" );
 
  141        attrib = wxT( 
"Other,ECO2" );
 
  146        attrib = wxT( 
"AssemblyDrawing,Bot" );
 
  151        attrib = wxT( 
"AssemblyDrawing,Top" );
 
  159        attrib = wxT( 
"Copper,L1,Top" );
 
  167            int ly_id = ( ( aLayer - 
B_Cu ) / 2 ) + 1;
 
  168            attrib.Printf( wxT( 
"Copper,L%d,Inr" ), ly_id );
 
  171            attrib.Printf( wxT( 
"Other,User" ), aLayer+1 );
 
  189            attrib += wxT( 
",Signal" );
 
  192            attrib += wxT( 
",Plane" );
 
  195            attrib += wxT( 
",Mixed" );
 
  204    fileFct.Printf( wxT( 
"%%TF.FileFunction,%s*%%" ), attrib );
 
 
  254    wxString filePolarity;
 
  257        filePolarity = wxT( 
"%TF.FilePolarity,Positive*%" );
 
  259        filePolarity = wxT( 
"%TF.FilePolarity,Negative*%" );
 
 
  273    if( aUseX1CompatibilityMode )
 
  275        aText.Replace( wxT( 
"%" ), wxEmptyString );
 
  276        aText.Prepend( wxT( 
"G04 #@! " ) );
 
 
  288    aMsg.Replace( wxT( 
"," ), wxT( 
"_" ) );         
 
  289    aMsg.Replace( wxT( 
"*" ), wxT( 
"\\u002A" ) );
 
  290    aMsg.Replace( wxT( 
"%" ), wxT( 
"\\u0025" ) );
 
 
  318    wxString msg = fn.GetFullName();
 
  335    text.Printf( wxT( 
"%%TF.ProjectId,%s,%s,%s*%%" ), msg.ToAscii(), guid, rev.ToAscii() );
 
  349    wxString registration_id = wxT( 
"Original" );
 
  353        registration_id.Printf( wxT( 
"PX%xPY%x" ), auxOrigin.
x, auxOrigin.
y );
 
  355    text.Printf( wxT( 
"%%TF.SameCoordinates,%s*%%" ), registration_id.GetData() );
 
 
  361                           bool aUseX1CompatibilityMode )
 
  374    if( !
text.IsEmpty() )
 
 
  380                        const wxString& aSuffix, 
const wxString& aExtension )
 
 
  420                                    const wxString& aSheetName, 
const wxString& aSheetPath )
 
  432    std::function<bool( wxString* )> textResolver =
 
  433            [&]( wxString* token ) -> 
bool 
  436                return m_board->ResolveTextVar( token, 0 );
 
  443    wxFileName   outputDir = wxFileName::DirName( outputDirName );
 
  444    wxString     boardFilename = 
m_board->GetFileName();
 
  446    wxString     layerName = 
m_board->GetLayerName( layer );
 
  467                                    m_plotFile.GetFullPath(), aSheetName, aSheetPath );
 
 
LAYER_T
The allowed types of layers, same as Specctra DSN spec.
 
wxString GetBuildVersion()
Get the full KiCad version string.
 
const VECTOR2I & GetAuxOrigin() const
 
Information pertinent to a Pcbnew printed circuit board.
 
LAYER_T GetLayerType(PCB_LAYER_ID aLayer) const
Return the type of the copper layer given by aLayer.
 
TITLE_BLOCK & GetTitleBlock()
 
int GetCopperLayerCount() const
 
const wxString & GetFileName() const
 
const PCB_PLOT_PARAMS & GetPlotOptions() const
 
PROJECT * GetProject() const
 
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
 
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
 
static void BuildPlotFileName(wxFileName *aFilename, const wxString &aOutputDir, const wxString &aSuffix, const wxString &aExtension)
Complete a plot filename.
 
bool GetUseAuxOrigin() const
 
wxString GetOutputDirectory() const
 
void SetFormat(PLOT_FORMAT aFormat)
 
Base plotter engine class.
 
void AddLineToHeader(const wxString &aExtraString)
Add a line to the list of free lines to print at the beginning of the file.
 
~PLOT_CONTROLLER()
Ensure that the last plot is closed.
 
bool PlotLayer()
Plot a single layer on the current plotfile m_plotLayer is the layer to plot.
 
PLOT_CONTROLLER(BOARD *aBoard)
Batch plotter constructor, nothing interesting here.
 
void SetColorMode(bool aColorMode)
Choose color or bland and white plot mode.
 
bool OpenPlotfile(const wxString &aSuffix, PLOT_FORMAT aFormat, const wxString &aSheetName=wxEmptyString, const wxString &aSheetPath=wxEmptyString)
Open a new plotfile; works as a factory for plotter objects/.
 
bool PlotLayers(const LSEQ &aLayerSequence)
Plot a sequence of board layer IDs in the given order.
 
PLOTTER * m_plotter
This is the plotter object; it starts NULL and become instantiated when a plotfile is.
 
PCB_PLOT_PARAMS & GetPlotOptions()
Accessor to the plot parameters and options.
 
void ClosePlot()
Close the current plot, nothing happens if it isn't open.
 
const wxString & GetRevision() const
 
const wxString ExpandEnvVarSubstitutions(const wxString &aString, const PROJECT *aProject)
Replace any environment variable & text variable references with their values.
 
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject, int aFlags)
 
bool EnsureFileDirectoryExists(wxFileName *aTargetFullFileName, const wxString &aBaseFilename, REPORTER *aReporter)
Make aTargetFullFileName absolute and create the path of this file if it doesn't yet exist.
 
wxString GetDefaultPlotExtension(PLOT_FORMAT aFormat)
Return the default plot extension for a format.
 
bool IsCopperLayer(int aLayerId)
Test whether a layer is a copper layer.
 
size_t CopperLayerToOrdinal(PCB_LAYER_ID aLayer)
Converts KiCad copper layer enum to an ordinal between the front and back layers.
 
PCB_LAYER_ID
A quick note on layer IDs:
 
PCB_LAYER_ID ToLAYER_ID(int aLayer)
 
const wxString GetGerberProtelExtension(int aLayer)
 
static wxString & makeStringCompatX1(wxString &aText, bool aUseX1CompatibilityMode)
 
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 ad...
 
const wxString GetGerberFileFunctionAttribute(const BOARD *aBoard, int aLayer)
Return the "file function" attribute for aLayer, as defined in the Gerber file format specification J...
 
static void replaceReservedCharsField(wxString &aMsg)
 
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 g...
 
void BuildPlotFileName(wxFileName *aFilename, const wxString &aOutputDir, const wxString &aSuffix, const wxString &aExtension)
Complete a plot filename.
 
static const wxString GetGerberFilePolarityAttribute(int aLayer)
 
PLOTTER * StartPlotBoard(BOARD *aBoard, const PCB_PLOT_PARAMS *aPlotOpts, int aLayer, const wxString &aLayerName, const wxString &aFullFileName, const wxString &aSheetName, const wxString &aSheetPath, const wxString &aPageName=wxT("1"), const wxString &aPageNumber=wxEmptyString, const int aPageCount=1)
Open a new plotfile using the options (and especially the format) specified in the options and prepar...
 
void PlotBoardLayers(BOARD *aBoard, PLOTTER *aPlotter, const LSEQ &aLayerSequence, const PCB_PLOT_PARAMS &aPlotOptions)
Plot a sequence of board layer IDs.
 
void PlotInteractiveLayer(BOARD *aBoard, PLOTTER *aPlotter, const PCB_PLOT_PARAMS &aPlotOpt)
Plot interactive items (hypertext links, properties, etc.).
 
void PlotOneBoardLayer(BOARD *aBoard, PLOTTER *aPlotter, PCB_LAYER_ID aLayer, const PCB_PLOT_PARAMS &aPlotOpt, bool isPrimaryLayer)
Plot one copper or technical layer.
 
PLOT_FORMAT
The set of supported output plot formats.
 
VECTOR2< int32_t > VECTOR2I