80 bool aGenDrill,
bool aGenMap,
90 hole_sets.emplace_back(
F_Cu,
B_Cu );
92 for( std::vector<DRILL_LAYER_PAIR>::const_iterator it = hole_sets.begin();
93 it != hole_sets.end(); ++it )
108 fn.SetPath( aPlotDirectory );
112 wxString fullFilename = fn.GetFullPath();
114 FILE* file = wxFopen( fullFilename, wxT(
"w" ) );
120 msg.Printf(
_(
"** Unable to create %s **\n" ), fullFilename );
129 msg.Printf(
_(
"Create file %s\n" ), fullFilename );
145 bool aGenerateNPTH_list )
149 int diam, holes_count;
150 int x0, y0, xf, yf, xc, yc;
160 #ifdef WRITE_PTH_NPTH_COMMENT 172 #ifdef WRITE_PTH_NPTH_COMMENT 175 writePTHcomment =
false;
176 fprintf(
m_file,
";TYPE=PLATED\n" );
181 writeNPTHcomment =
false;
182 fprintf(
m_file,
";TYPE=NON_PLATED\n" );
198 int tool_reference = -2;
210 fprintf(
m_file,
"T%d\n", tool_reference );
241 fprintf(
m_file,
"T%d\n", tool_reference );
288 for(
int kk = 0; line[kk] != 0; kk++ )
300 fputs(
"M15\nG01",
m_file );
338 if( aLeftDigits <= 0 )
341 if( aRightDigits <= 0 )
369 xs.Printf( wxT(
"%.3f" ), aCoordX );
370 ys.Printf( wxT(
"%.3f" ), aCoordY );
375 xs.Printf( wxT(
"%.4f" ), aCoordX );
376 ys.Printf( wxT(
"%.4f" ), aCoordY );
380 while( xs.Last() ==
'0' )
383 if( xs.Last() ==
'.' )
386 while( ys.Last() ==
'0' )
389 if( ys.Last() ==
'.' )
398 aCoordX *= 10; aCoordY *= 10;
401 sprintf( aLine,
"X%dY%d\n",
KiROUND( aCoordX ),
KiROUND( aCoordY ) );
418 xs.Printf( wxT(
"%0*d" ), xpad,
KiROUND( aCoordX ) );
419 ys.Printf( wxT(
"%0*d" ), ypad,
KiROUND( aCoordY ) );
421 size_t j = xs.Len() - 1;
423 while( xs[j] ==
'0' && j )
428 while( ys[j] ==
'0' && j )
438 aCoordX *= 10; aCoordY *= 10;
447 xs.Printf( wxT(
"%0*d" ), xpad,
KiROUND( aCoordX ) );
448 ys.Printf( wxT(
"%0*d" ), ypad,
KiROUND( aCoordY ) );
456 bool aGenerateNPTH_list)
477 msg <<
"/ absolute / ";
489 const wxString zero_fmt[4] =
492 "suppress leading zeros",
493 "suppress trailing zeros",
506 msg =
"; #@! TF.GenerationSoftware,Kicad,Pcbnew,";
519 fputs(
"FMAT,2\n",
m_file );
549 fputs(
"T0\nM30\n",
m_file );
virtual const wxString getDrillFileName(DRILL_LAYER_PAIR aPair, bool aNPTH, bool aMerge_PTH_NPTH) const
Plot settings, and plotting engines (PostScript, Gerber, HPGL and DXF)
void writeEXCELLONEndOfFile()
wxString GetPrecisionString()
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
static constexpr double IU_PER_MM
Mock up a conversion function.
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
int createDrillFile(FILE *aFile, DRILL_LAYER_PAIR aLayerPair, bool aGenerateNPTH_list)
Function CreateDrillFile Creates an Excellon drill file.
void writeEXCELLONHeader(DRILL_LAYER_PAIR aLayerPair, bool aGenerateNPTH_list)
std::vector< DRILL_LAYER_PAIR > getUniqueLayerPairs() const
Get unique layer pairs by examining the micro and blind_buried vias.
void RotatePoint(int *pX, int *pY, double angle)
A pure virtual class used to derive REPORTER objects from.
void CreateMapFilesSet(const wxString &aPlotDirectory, REPORTER *aReporter=NULL)
Function CreateMapFilesSet Creates the full set of map files for the board, in PS,...
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
int getHolesCount() const
void SetFormat(bool aMetric, ZEROS_FMT aZerosFmt=DECIMAL_FORMAT, int aLeftDigits=0, int aRightDigits=0)
Function SetFormat Initialize internal parameters to match the given format.
Board plot function definition file.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
std::vector< DRILL_TOOL > m_toolListBuffer
void writeCoordinates(char *aLine, double aCoordX, double aCoordY)
EXCELLON_WRITER(BOARD *aPcb)
wxString GetBuildVersion()
Get the full KiCad version string.
DRILL_PRECISION m_precision
Definition of file extensions used in Kicad.
bool m_useRouteModeForOval
std::pair< PCB_LAYER_ID, PCB_LAYER_ID > DRILL_LAYER_PAIR
const wxString BuildFileFunctionAttributeString(DRILL_LAYER_PAIR aLayerPair, bool aIsNpth, bool aCompatNCdrill=false) const
void buildHolesList(DRILL_LAYER_PAIR aLayerPair, bool aGenerateNPTH_list)
Function BuildHolesList Create the list of holes and tools for a given board The list is sorted by in...
void CreateDrillandMapFilesSet(const wxString &aPlotDirectory, bool aGenDrill, bool aGenMap, REPORTER *aReporter=NULL)
Function CreateDrillandMapFilesSet Creates the full set of Excellon drill file for the board filename...
Information pertinent to a Pcbnew printed circuit board.
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Classes used in drill files, map files and report files generation.
wxString m_drillFileExtension
std::vector< HOLE_INFO > m_holeListBuffer
const std::string DrillFileExtension
GENDRILL_WRITER_BASE is a class to create drill maps and drill report, and a helper class to created ...