46#define FLASH_OVAL_HOLE 0
74 hole_sets.emplace_back(
F_Cu,
B_Cu );
76 for( std::vector<DRILL_LAYER_PAIR>::const_iterator it = hole_sets.begin();
77 it != hole_sets.end(); ++it )
81 bool doing_npth = ( it == hole_sets.end() - 1 );
93 fn.SetPath( aPlotDirectory );
97 wxString fullFilename = fn.GetFullPath();
105 msg.Printf(
_(
"Failed to create file '%s'." ), fullFilename );
116 msg.Printf(
_(
"Created file '%s'." ), fullFilename );
171 text = wxT(
"%TF.FilePolarity,Positive*%" );
174 if( !plotter.
OpenFile( aFullFilename ) )
182 bool last_item_is_via =
true;
195 if( dyn_cast<const PCB_VIA*>( hole_descr.
m_ItemParent ) )
199 if( !last_item_is_via )
205 last_item_is_via =
true;
207 else if( dyn_cast<const PAD*>( hole_descr.
m_ItemParent ) )
209 last_item_is_via =
false;
212 if(
pad->GetProperty() == PAD_PROP::CASTELLATED )
230 wxString ref =
pad->GetParentFootprint()->GetReference();
279 if( size.
x > size.
y )
281 std::swap( size.
x, size.
y );
285 int deltaxy = size.
y - size.
x;
286 aStart =
VECTOR2I( 0, deltaxy / 2 );
307 bool aMerge_PTH_NPTH )
const
312 fname.SetName( fname.GetName() + wxT(
"-drl" ) );
314 return fname.GetFullPath();
constexpr EDA_IU_SCALE pcbIUScale
Information pertinent to a Pcbnew printed circuit 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.
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
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 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, OUTLINE_MODE trace_mode, void *aData) override
Filled circular flashes are stored as apertures.
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)
virtual void FlashPadOval(const VECTOR2I &aPadPos, const VECTOR2I &aSize, const EDA_ANGLE &aOrient, OUTLINE_MODE aTraceMode, void *aData) override
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 void ThickSegment(const VECTOR2I &start, const VECTOR2I &end, int width, OUTLINE_MODE tracemode, void *aData) override
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.
virtual const wxString getDrillFileName(DRILL_LAYER_PAIR aPair, bool aNPTH, bool aMerge_PTH_NPTH) const override
int createDrillFile(wxString &aFullFilename, bool aIsNpth, DRILL_LAYER_PAIR aLayerPair)
Create an Excellon drill file.
bool 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,...
void SetFormat(int aRightDigits=6)
Initialize internal parameters to match the given format.
GERBER_WRITER(BOARD *aPcb)
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 & 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.
static constexpr EDA_ANGLE ANGLE_90
std::pair< PCB_LAYER_ID, PCB_LAYER_ID > DRILL_LAYER_PAIR
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.
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
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.
VECTOR2< int32_t > VECTOR2I