43 #define FLASH_OVAL_HOLE 1 70 hole_sets.emplace_back(
F_Cu,
B_Cu );
72 for( std::vector<DRILL_LAYER_PAIR>::const_iterator it = hole_sets.begin();
73 it != hole_sets.end(); ++it )
77 bool doing_npth = ( it == hole_sets.end() - 1 );
89 fn.SetPath( aPlotDirectory );
93 wxString fullFilename = fn.GetFullPath();
101 msg.Printf(
_(
"Failed to create file '%s'." ), fullFilename );
111 msg.Printf(
_(
"Created file '%s'." ), fullFilename );
130 static void convertOblong2Segment( wxSize aSize,
double aOrient, wxPoint& aStart, wxPoint& aEnd );
160 ? TYPE_FILE::NPTH_FILE
161 : TYPE_FILE::PTH_FILE );
165 text = wxT(
"%TF.FilePolarity,Positive*%" );
168 if( !plotter.
OpenFile( aFullFilename ) )
176 bool last_item_is_via =
true;
189 if( dyn_cast<const PCB_VIA*>( hole_descr.
m_ItemParent ) )
193 if( !last_item_is_via )
199 last_item_is_via =
true;
201 else if( dyn_cast<const PAD*>( hole_descr.
m_ItemParent ) )
203 last_item_is_via =
false;
224 wxString ref =
pad->GetParent()->GetReference();
232 #if FLASH_OVAL_HOLE // set to 1 to use flashed oblong holes, 264 void convertOblong2Segment( wxSize aSize,
double aOrient, wxPoint& aStart, wxPoint& aEnd )
266 wxSize size( aSize );
267 double orient = aOrient;
272 if( size.x > size.y )
274 std::swap( size.x, size.y );
278 int deltaxy = size.y - size.x;
281 int cy = deltaxy / 2;
283 aStart = wxPoint( cx, cy );
284 cx = 0; cy = -deltaxy / 2;
286 aEnd = wxPoint( cx, cy );
303 bool aMerge_PTH_NPTH )
const 308 fname.SetName( fname.GetName() + wxT(
"-drl" ) );
310 return fname.GetFullPath();
BOARD_ITEM * m_ItemParent
virtual const wxString getDrillFileName(DRILL_LAYER_PAIR aPair, bool aNPTH, bool aMerge_PTH_NPTH) const
virtual void SetCreator(const wxString &aCreator)
void UseX2NetAttributes(bool aEnable)
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
virtual void EndBlock(void *aData) override
Define the end of a group of drawing items the group is started by StartBlock().
static constexpr double IU_PER_MM
Mock up a conversion function.
virtual void ThickSegment(const wxPoint &start, const wxPoint &end, int width, OUTLINE_MODE tracemode, void *aData) override
virtual bool OpenFile(const wxString &aFullFilename)
Open or create the plot file aFullFilename.
void CreateMapFilesSet(const wxString &aPlotDirectory, REPORTER *aReporter=nullptr)
Create the full set of map files for the board, in PS, PDF ...
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.
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...
void UseX2format(bool aEnable)
void SetFormat(int aRightDigits=6)
Initialize internal parameters to match the given format.
void AddLineToHeader(const wxString &aExtraString)
Add a line to the list of free lines to print at the beginning of the file.
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.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
virtual bool StartPlot() override
Write GERBER header to file initialize global variable g_Plot_PlotOutputFile.
int getHolesCount() const
Board plot function definition file.
static LIB_SYMBOL * dummy()
Used to draw a dummy shape when a LIB_SYMBOL is not found in library.
T AddAngles(T a1, T2 a2)
Add two angles (keeping the result normalized). T2 is here.
DRILL_PRECISION m_precision
void CreateDrillandMapFilesSet(const wxString &aPlotDirectory, bool aGenDrill, bool aGenMap, REPORTER *aReporter=nullptr)
Create the full set of Excellon drill file for the board filenames are computed from the board name,...
const wxString BuildFileFunctionAttributeString(DRILL_LAYER_PAIR aLayerPair, TYPE_FILE aHoleType, bool aCompatNCdrill=false) const
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
Handle hole which must be drilled (diameter, position and layers).
std::pair< PCB_LAYER_ID, PCB_LAYER_ID > DRILL_LAYER_PAIR
virtual void FlashPadOval(const wxPoint &aPadPos, const wxSize &size, double orient, OUTLINE_MODE trace_mode, void *aData) override
void buildHolesList(DRILL_LAYER_PAIR aLayerPair, bool aGenerateNPTH_list)
Create the list of holes and tools for a given board.
void DisableApertMacros(bool aDisable)
Disable Aperture Macro (AM) command, only for broken Gerber Readers.
Information pertinent to a Pcbnew printed circuit board.
virtual const wxString getDrillFileName(DRILL_LAYER_PAIR aPair, bool aNPTH, bool aMerge_PTH_NPTH) const override
virtual bool EndPlot() override
virtual void SetGerberCoordinatesFormat(int aResolution, bool aUseInches=false) override
Selection of Gerber units and resolution (number of digits in mantissa).
a pad with a castellated through hole
virtual void FlashPadCircle(const wxPoint &pos, int diametre, OUTLINE_MODE trace_mode, void *aData) override
Filled circular flashes are stored as apertures.
Classes used in drill files, map files and report files generation.
GERBER_WRITER(BOARD *aPcb)
wxString m_drillFileExtension
std::vector< HOLE_INFO > m_holeListBuffer
int createDrillFile(wxString &aFullFilename, bool aIsNpth, DRILL_LAYER_PAIR aLayerPair)
Create an Excellon drill file.
Create drill maps and drill reports and drill files.