46#define FLASH_OVAL_HOLE 0
61 bool aGenMap,
bool aGenTenting,
REPORTER* aReporter )
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 );
126 { IPC4761_FEATURES::FILLED, IPC4761_FEATURES::CAPPED,
127 IPC4761_FEATURES::COVERED_BACK, IPC4761_FEATURES::COVERED_FRONT,
128 IPC4761_FEATURES::PLUGGED_BACK, IPC4761_FEATURES::PLUGGED_FRONT,
129 IPC4761_FEATURES::TENTED_BACK, IPC4761_FEATURES::TENTED_FRONT } )
133 if( feature == IPC4761_FEATURES::TENTED_BACK
134 || feature == IPC4761_FEATURES::TENTED_FRONT )
141 fn.SetPath( aPlotDirectory );
143 wxString fullFilename = fn.GetFullPath();
149 msg.Printf(
_(
"Failed to create file '%s'." ), fullFilename );
158 msg.Printf(
_(
"Created file '%s'." ), fullFilename );
201 wxString
text =
"%TF,FileFunction,Other,";
206 case IPC4761_FEATURES::CAPPED:
207 text << wxT(
"Capping" );
210 case IPC4761_FEATURES::FILLED:
211 text << wxT(
"Filling" );
214 case IPC4761_FEATURES::COVERED_BACK:
215 text << wxT(
"Covering-Back" );
218 case IPC4761_FEATURES::COVERED_FRONT:
219 text << wxT(
"Covering-Front" );
222 case IPC4761_FEATURES::PLUGGED_BACK:
223 text << wxT(
"Plugging-Back" );
226 case IPC4761_FEATURES::PLUGGED_FRONT:
227 text << wxT(
"Plugging-Front" );
230 case IPC4761_FEATURES::TENTED_BACK:
231 text << wxT(
"Tenting-Back" );
234 case IPC4761_FEATURES::TENTED_FRONT:
235 text << wxT(
"Tenting-Front" );
244 text = wxT(
"%TF.FilePolarity,Positive*%" );
248 if( !plotter.
OpenFile( aFullFilename ) )
257 if( !dyn_cast<const PCB_VIA*>( hole_descr.m_ItemParent ) )
262 const PCB_VIA*
via = dyn_cast<const PCB_VIA*>( hole_descr.m_ItemParent );
265 int diameter = hole_descr.m_Hole_Diameter;
269 case IPC4761_FEATURES::FILLED:
270 cont = ! hole_descr.m_Hole_Filled;
272 case IPC4761_FEATURES::CAPPED:
273 cont = ! hole_descr.m_Hole_Capped;
275 case IPC4761_FEATURES::COVERED_BACK:
276 cont = !hole_descr.m_Hole_Bot_Covered;
277 diameter =
via->GetWidth(
via->BottomLayer() );
279 case IPC4761_FEATURES::COVERED_FRONT:
280 cont = ! hole_descr.m_Hole_Top_Covered;
281 diameter =
via->GetWidth(
via->TopLayer() );
283 case IPC4761_FEATURES::PLUGGED_BACK:
284 cont = !hole_descr.m_Hole_Bot_Plugged;
286 case IPC4761_FEATURES::PLUGGED_FRONT:
287 cont = ! hole_descr.m_Hole_Top_Plugged;
289 case IPC4761_FEATURES::TENTED_BACK:
290 cont = ! hole_descr.m_Hole_Bot_Tented;
291 diameter =
via->GetWidth(
via->BottomLayer() );
293 case IPC4761_FEATURES::TENTED_FRONT:
294 cont = ! hole_descr.m_Hole_Top_Tented;
295 diameter =
via->GetWidth(
via->TopLayer() );
347 text = wxT(
"%TF.FilePolarity,Positive*%" );
350 if( !plotter.
OpenFile( aFullFilename ) )
358 bool last_item_is_via =
true;
371 if( dyn_cast<const PCB_VIA*>( hole_descr.
m_ItemParent ) )
375 if( !last_item_is_via )
381 last_item_is_via =
true;
383 else if( dyn_cast<const PAD*>( hole_descr.
m_ItemParent ) )
385 last_item_is_via =
false;
388 if(
pad->GetProperty() == PAD_PROP::CASTELLATED )
410 wxString ref =
pad->GetParentFootprint()->GetReference();
459 if( size.
x > size.
y )
461 std::swap( size.
x, size.
y );
465 int deltaxy = size.
y - size.
x;
466 aStart =
VECTOR2I( 0, deltaxy / 2 );
487 bool aMerge_PTH_NPTH )
const
492 fname.SetName( fname.GetName() + wxT(
"-drl" ) );
494 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
virtual const wxString getProtectionFileName(DRILL_LAYER_PAIR aPair, IPC4761_FEATURES aFeature) const
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.
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,...
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.
void SetFormat(int aRightDigits=6)
Initialize internal parameters to match the given format.
GERBER_WRITER(BOARD *aPcb)
int createProtectionFile(const wxString &aFullFilename, IPC4761_FEATURES aFeature, DRILL_LAYER_PAIR aLayerPair)
Create a Gerber X2 file for via protection 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 & 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