86 hole_sets.emplace_back(
F_Cu,
B_Cu );
88 for( std::vector<DRILL_LAYER_PAIR>::const_iterator it = hole_sets.begin();
89 it != hole_sets.end(); ++it )
105 fn.SetPath( aPlotDirectory );
109 wxString fullFilename = fn.GetFullPath();
111 FILE* file = wxFopen( fullFilename, wxT(
"w" ) );
113 if( file ==
nullptr )
117 msg.Printf(
_(
"Failed to create file '%s'." ), fullFilename );
127 msg.Printf(
_(
"Created file '%s'" ), fullFilename );
132 TYPE_FILE file_type = TYPE_FILE::PTH_FILE;
139 file_type = TYPE_FILE::MIXED_FILE;
140 else if( doing_npth )
141 file_type = TYPE_FILE::NPTH_FILE;
167 fprintf(
m_file,
"; #@! TA.AperFunction,Plated,PTH,ViaDrill\n" );
171 fprintf(
m_file,
"; #@! TA.AperFunction,Plated,Buried,ViaDrill\n" );
175 fprintf(
m_file,
"; #@! TA.AperFunction,Plated,PTH,ComponentDrill\n" );
179 fprintf(
m_file,
"; #@! TA.AperFunction,NonPlated,NPTH,ComponentDrill\n" );
183 fprintf(
m_file,
"; #@! TD\n" );
195 int diam, holes_count;
196 int x0, y0, xf, yf, xc, yc;
211#if USE_ATTRIB_FOR_HOLES
229 int tool_reference = -2;
241 fprintf(
m_file,
"T%d\n", tool_reference );
273 fprintf(
m_file,
"T%d\n", tool_reference );
320 for(
int kk = 0; line[kk] != 0; kk++ )
332 fputs(
"M15\nG01",
m_file );
368 if( aLeftDigits <= 0 )
371 if( aRightDigits <= 0 )
399 xs.Printf( wxT(
"%.3f" ), aCoordX );
400 ys.Printf( wxT(
"%.3f" ), aCoordY );
405 xs.Printf( wxT(
"%.4f" ), aCoordX );
406 ys.Printf( wxT(
"%.4f" ), aCoordY );
410 while( xs.Last() ==
'0' )
413 if( xs.Last() ==
'.' )
416 while( ys.Last() ==
'0' )
419 if( ys.Last() ==
'.' )
428 aCoordX *= 10; aCoordY *= 10;
431 sprintf( aLine,
"X%dY%d\n",
KiROUND( aCoordX ),
KiROUND( aCoordY ) );
448 xs.Printf( wxT(
"%0*d" ), xpad,
KiROUND( aCoordX ) );
449 ys.Printf( wxT(
"%0*d" ), ypad,
KiROUND( aCoordY ) );
451 size_t j = xs.Len() - 1;
453 while( xs[j] ==
'0' && j )
458 while( ys[j] ==
'0' && j )
468 aCoordX *= 10; aCoordY *= 10;
477 xs.Printf( wxT(
"%0*d" ), xpad,
KiROUND( aCoordX ) );
478 ys.Printf( wxT(
"%0*d" ), ypad,
KiROUND( aCoordY ) );
496 msg = wxT(
"; FORMAT={" );
506 msg << wxT(
"/ absolute / " );
518 const wxString zero_fmt[4] =
521 wxT(
"suppress leading zeros" ),
522 wxT(
"suppress trailing zeros" ),
535 msg = wxT(
"; #@! TF.GenerationSoftware,Kicad,Pcbnew," );
544 fputs(
"FMAT,2\n",
m_file );
574 fputs(
"T0\nM30\n",
m_file );
constexpr EDA_IU_SCALE pcbIUScale
wxString GetBuildVersion()
Get the full KiCad version string.
Information pertinent to a Pcbnew printed circuit board.
wxString GetPrecisionString()
void SetFormat(bool aMetric, ZEROS_FMT aZerosFmt=DECIMAL_FORMAT, int aLeftDigits=0, int aRightDigits=0)
Initialize internal parameters to match the given format.
bool m_useRouteModeForOval
void writeEXCELLONHeader(DRILL_LAYER_PAIR aLayerPair, TYPE_FILE aHolesType)
Print the DRILL file header.
void writeHoleAttribute(HOLE_ATTRIBUTE aAttribute)
Write a comment string giving the hole attribute.
EXCELLON_WRITER(BOARD *aPcb)
int createDrillFile(FILE *aFile, DRILL_LAYER_PAIR aLayerPair, TYPE_FILE aHolesType)
Create an Excellon drill file.
void writeCoordinates(char *aLine, double aCoordX, double aCoordY)
Create a line like according to the selected format.
void writeEXCELLONEndOfFile()
void CreateDrillandMapFilesSet(const wxString &aPlotDirectory, bool aGenDrill, bool aGenMap, REPORTER *aReporter=nullptr)
Create the full set of Excellon drill file for the board.
Create drill maps and drill reports and drill files.
std::vector< DRILL_LAYER_PAIR > getUniqueLayerPairs() const
Get unique layer pairs by examining the micro and blind_buried vias.
virtual const wxString getDrillFileName(DRILL_LAYER_PAIR aPair, bool aNPTH, bool aMerge_PTH_NPTH) const
void buildHolesList(DRILL_LAYER_PAIR aLayerPair, bool aGenerateNPTH_list)
Create the list of holes and tools for a given board.
void CreateMapFilesSet(const wxString &aPlotDirectory, REPORTER *aReporter=nullptr)
Create the full set of map files for the board, in PS, PDF ... format (use SetMapFileFormat() to sele...
const wxString BuildFileFunctionAttributeString(DRILL_LAYER_PAIR aLayerPair, TYPE_FILE aHoleType, bool aCompatNCdrill=false) const
wxString m_drillFileExtension
std::vector< HOLE_INFO > m_holeListBuffer
DRILL_PRECISION m_precision
std::vector< DRILL_TOOL > m_toolListBuffer
int getHolesCount() const
Handle hole which must be drilled (diameter, position and layers).
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & ReportTail(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Places the report at the end of the list, for objects that support report ordering.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
Classes used in drill files, map files and report files generation.
std::pair< PCB_LAYER_ID, PCB_LAYER_ID > DRILL_LAYER_PAIR
const std::string DrillFileExtension
This file contains miscellaneous commonly used macros and functions.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Plot settings, and plotting engines (PostScript, Gerber, HPGL and DXF)
std::vector< FAB_LAYER_COLOR > dummy
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition of file extensions used in Kicad.