46#define FLASH_OVAL_HOLE 0
61 bool aGenMap,
bool aGenTenting,
REPORTER* aReporter )
72 hole_sets.emplace_back(
F_Cu,
B_Cu,
false,
true );
74 for( std::vector<DRILL_SPAN>::const_iterator it = hole_sets.begin();
75 it != hole_sets.end(); ++it )
86 fn.SetPath( aPlotDirectory );
90 wxString fullFilename = fn.GetFullPath();
92 bool wroteDrillFile =
false;
100 msg.Printf(
_(
"Failed to create file '%s'." ), fullFilename );
108 wroteDrillFile =
true;
112 msg.Printf(
_(
"Created file '%s'." ), fullFilename );
148 fn.SetPath( aPlotDirectory );
150 wxString fullFilename = fn.GetFullPath();
156 msg.Printf(
_(
"Failed to create file '%s'." ), fullFilename );
165 msg.Printf(
_(
"Created file '%s'." ), fullFilename );
207 wxString
text =
"%TF,FileFunction,Other,";
213 text << wxT(
"Capping" );
217 text << wxT(
"Filling" );
221 text << wxT(
"Covering-Back" );
225 text << wxT(
"Covering-Front" );
229 text << wxT(
"Plugging-Back" );
233 text << wxT(
"Plugging-Front" );
237 text << wxT(
"Tenting-Back" );
241 text << wxT(
"Tenting-Front" );
250 text = wxT(
"%TF.FilePolarity,Positive*%" );
254 if( !plotter.
OpenFile( aFullFilename ) )
271 int diameter = hole_descr.m_Hole_Diameter;
276 cont = ! hole_descr.m_Hole_Filled;
279 cont = ! hole_descr.m_Hole_Capped;
282 cont = !hole_descr.m_Hole_Bot_Covered;
283 diameter =
via->GetWidth(
via->BottomLayer() );
286 cont = ! hole_descr.m_Hole_Top_Covered;
287 diameter =
via->GetWidth(
via->TopLayer() );
290 cont = !hole_descr.m_Hole_Bot_Plugged;
293 cont = ! hole_descr.m_Hole_Top_Plugged;
296 cont = ! hole_descr.m_Hole_Bot_Tented;
297 diameter =
via->GetWidth(
via->BottomLayer() );
300 cont = ! hole_descr.m_Hole_Top_Tented;
301 diameter =
via->GetWidth(
via->TopLayer() );
313 plotter.
FlashPadCircle( hole_descr.m_Hole_Pos, diameter, &gbr_metadata );
353 text = wxT(
"%TF.FilePolarity,Positive*%" );
356 if( !plotter.
OpenFile( aFullFilename ) )
364 bool last_item_is_via =
true;
384 if( !last_item_is_via )
390 last_item_is_via =
true;
394 last_item_is_via =
false;
424 wxString ref =
pad->GetParentFootprint()->GetReference();
445 plotter.
ThickSegment( start+hole_pos,
end+hole_pos, width, &gbr_metadata );
465 wxFileName fn =
m_pcb->GetFileName();
468 fn.SetName( fn.GetName() + wxT(
"-" ) + pairName + wxT(
"-backdrill-drl" ) );
479 fn.SetPath( aPlotDirectory );
481 wxString fullFilename = fn.GetFullPath();
488 msg.Printf(
_(
"Failed to create file '%s'." ), fullFilename );
498 msg.Printf(
_(
"Created file '%s'." ), fullFilename );
516 if( size.
x > size.
y )
518 std::swap( size.
x, size.
y );
522 int deltaxy = size.
y - size.
x;
523 aStart =
VECTOR2I( 0, deltaxy / 2 );
544 bool aMerge_PTH_NPTH )
const
549 fname.SetName( fname.GetName() + wxT(
"-drl" ) );
551 return fname.GetFullPath();
567 if( hole_descr.m_Hole_Filled )
572 if( hole_descr.m_Hole_Capped )
577 if( hole_descr.m_Hole_Bot_Covered )
582 if( hole_descr.m_Hole_Top_Covered )
587 if( hole_descr.m_Hole_Bot_Plugged )
592 if( hole_descr.m_Hole_Top_Plugged )
597 if( hole_descr.m_Hole_Bot_Tented )
602 if( hole_descr.m_Hole_Top_Tented )
constexpr EDA_IU_SCALE pcbIUScale
Information pertinent to a Pcbnew printed circuit board.
virtual const wxString getProtectionFileName(const DRILL_SPAN &aSpan, IPC4761_FEATURES aFeature) const
wxString m_drillFileExtension
std::vector< HOLE_INFO > m_holeListBuffer
void buildHolesList(const DRILL_SPAN &aSpan, bool aGenerateNPTH_list)
Create the list of holes and tools for a given board.
DRILL_PRECISION m_precision
GENDRILL_WRITER_BASE(BOARD *aPcb)
std::vector< DRILL_SPAN > getUniqueLayerPairs() const
Get unique layer pairs by examining the micro and blind_buried vias.
const std::string layerPairName(DRILL_LAYER_PAIR aPair) const
bool 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...
int getHolesCount() const
virtual const wxString getDrillFileName(const DRILL_SPAN &aSpan, bool aNPTH, bool aMerge_PTH_NPTH) const
const wxString BuildFileFunctionAttributeString(const DRILL_SPAN &aSpan, TYPE_FILE aHoleType, bool aCompatNCdrill=false) const
virtual void ThickSegment(const VECTOR2I &start, const VECTOR2I &end, int width, void *aData) override
virtual void SetGerberCoordinatesFormat(int aResolution, bool aUseInches=false) override
Selection of Gerber units and resolution (number of digits in mantissa).
virtual void FlashPadCircle(const VECTOR2I &pos, int diametre, void *aData) override
Filled circular flashes are stored as apertures.
virtual void FlashPadOval(const VECTOR2I &aPadPos, const VECTOR2I &aSize, const EDA_ANGLE &aOrient, void *aData) override
virtual void SetViewport(const VECTOR2I &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
virtual bool EndPlot() override
void UseX2format(bool aEnable)
void UseX2NetAttributes(bool aEnable)
virtual void EndBlock(void *aData) override
Define the end of a group of drawing items the group is started by StartBlock().
virtual bool StartPlot(const wxString &pageNumber) override
Write GERBER header to file initialize global variable g_Plot_PlotOutputFile.
void DisableApertMacros(bool aDisable)
Disable Aperture Macro (AM) command, only for broken Gerber Readers.
bool CreateDrillandMapFilesSet(const wxString &aPlotDirectory, bool aGenDrill, bool aGenMap, bool aGenTenting, REPORTER *aReporter=nullptr)
Create the full set of Excellon drill file for the board filenames are computed from the board name,...
bool writeBackdrillLayerPairFile(const wxString &aPlotDirectory, REPORTER *aReporter, const DRILL_SPAN &aSpan)
int createDrillFile(wxString &aFullFilename, bool aIsNpth, const DRILL_SPAN &aSpan)
Create an Excellon drill file.
virtual const wxString getDrillFileName(const DRILL_SPAN &aSpan, bool aNPTH, bool aMerge_PTH_NPTH) const override
void SetFormat(int aRightDigits=6)
Initialize internal parameters to match the given format.
GERBER_WRITER(BOARD *aPcb)
wxFileName getBackdrillLayerPairFileName(const DRILL_SPAN &aSpan) const
int createProtectionFile(const wxString &aFullFilename, IPC4761_FEATURES aFeature, DRILL_LAYER_PAIR aLayerPair)
Create a Gerber X2 file for via protection features.
bool hasViaType(IPC4761_FEATURES aFeature)
test for an existing via having the given feature IPC4761_FEATURES
Handle hole which must be drilled (diameter, position and layers).
BOARD_ITEM * m_ItemParent
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
virtual bool OpenFile(const wxString &aFullFilename)
Open or create the plot file aFullFilename.
virtual void SetCreator(const wxString &aCreator)
void AddLineToHeader(const wxString &aExtraString)
Add a line to the list of free lines to print at the beginning of the file.
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Report a string with a given severity.
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.
static constexpr EDA_ANGLE ANGLE_90
static void convertOblong2Segment(const VECTOR2I &aSize, const EDA_ANGLE &aOrient, VECTOR2I &aStart, VECTOR2I &aEnd)
Classes used in drill files, map files and report files generation.
std::pair< PCB_LAYER_ID, PCB_LAYER_ID > DRILL_LAYER_PAIR
@ PRESSFIT
a PTH with a hole diameter with tight tolerances for press fit pin
@ CASTELLATED
a pad with a castellated through hole
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...
std::vector< FAB_LAYER_COLOR > dummy
DRILL_LAYER_PAIR Pair() const
wxString result
Test unit parsing edge cases and error handling.
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
Casted dyn_cast(From aObject)
A lightweight dynamic downcast.
VECTOR2< int32_t > VECTOR2I