67 bool aGenerateNPTH_list )
74 wxASSERT( aLayerPair.first < aLayerPair.second );
77 if( ! aGenerateNPTH_list )
85 int hole_sz =
via->GetDrillValue();
124 for(
PAD*
pad : footprint->Pads() )
128 if( !aGenerateNPTH_list &&
pad->GetAttribute() == PAD_ATTRIB::NPTH )
131 if( aGenerateNPTH_list &&
pad->GetAttribute() != PAD_ATTRIB::NPTH )
135 if(
pad->GetDrillSize().x == 0 )
141 ? HOLE_ATTRIBUTE::HOLE_MECHANICAL
142 : HOLE_ATTRIBUTE::HOLE_PAD;
150 if(
pad->GetDrillShape() != PAD_DRILL_SHAPE::CIRCLE &&
151 pad->GetDrillSizeX() !=
pad->GetDrillSizeY() )
171 bool last_notplated_opt =
false;
218 std::set<DRILL_LAYER_PAIR> unique;
221 for(
int i = 0; i < vias.
GetCount(); ++i )
225 v->
LayerPair( &layer_pair.first, &layer_pair.second );
230 unique.insert( layer_pair );
233 std::vector<DRILL_LAYER_PAIR> ret;
238 ret.push_back( pair );
261 std::string ret =
layerName( aPair.first );
270 bool aMerge_PTH_NPTH )
const
277 extend = wxT(
"-NPTH" );
280 if( !aMerge_PTH_NPTH )
281 extend = wxT(
"-PTH" );
292 fn.SetName( fn.GetName() + extend );
295 wxString ret = fn.GetFullName();
310 hole_sets.emplace_back(
F_Cu,
B_Cu );
312 for( std::vector<DRILL_LAYER_PAIR>::const_iterator it = hole_sets.begin();
313 it != hole_sets.end(); ++it )
328 fn.SetPath( aPlotDirectory );
330 fn.SetExt( wxEmptyString );
331 wxString fullfilename = fn.GetFullPath() + wxT(
"-drl_map" );
340 msg.Printf(
_(
"Failed to create file '%s'." ), fullfilename );
350 msg.Printf(
_(
"Created file '%s'." ), fullfilename );
363 bool aCompatNCdrill )
const
370 text = wxT(
"; #@! " );
374 text << wxT(
"TF.FileFunction," );
377 text << wxT(
"NonPlated," );
379 text << wxT(
"MixedPlating," );
381 text << wxT(
"Plated," );
383 int layer1 = aLayerPair.first;
384 int layer2 = aLayerPair.second;
395 text << layer1 << wxT(
"," ) << layer2;
402 text << wxT(
",NPTH" );
407 else if( layer1 == toplayer && layer2 == bottomlayer )
408 text << wxT(
",PTH" );
409 else if( layer1 == toplayer || layer2 == bottomlayer )
410 text << wxT(
",Blind" );
412 text << wxT(
",Buried" );
423 bool hasOblong =
false;
424 bool hasDrill =
false;
436 if( hasOblong && hasDrill )
437 text << wxT(
",Mixed" );
439 text << wxT(
",Drill" );
441 text << wxT(
",Rout" );
int GetCopperLayerCount() const
const FOOTPRINTS & Footprints() const
const TRACKS & Tracks() const
const wxString & GetFileName() const
int GetCount() const
Return the number of objects in the list.
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
bool genDrillMapFile(const wxString &aFullFileName, PLOT_FORMAT aFormat)
Plot a map of drill marks for holes.
std::vector< DRILL_TOOL > m_toolListBuffer
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...
const std::string layerName(PCB_LAYER_ID aLayer) const
int getHolesCount() const
Handle hole which must be drilled (diameter, position and layers).
PCB_LAYER_ID m_Hole_Bottom_Layer
PCB_LAYER_ID m_Hole_Top_Layer
HOLE_ATTRIBUTE m_HoleAttribute
BOARD_ITEM * m_ItemParent
Collect all BOARD_ITEM objects of a given set of KICAD_T type(s).
void Collect(BOARD_ITEM *aBoard, const std::vector< KICAD_T > &aTypes)
Collect BOARD_ITEM objects using this class's Inspector method, which does the collection.
void LayerPair(PCB_LAYER_ID *top_layer, PCB_LAYER_ID *bottom_layer) const
Return the 2 layers used by the via (the via actually uses all layers between these 2 layers)
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.
wxString GetDefaultPlotExtension(PLOT_FORMAT aFormat)
Returns the default plot extension for a format.
static constexpr EDA_ANGLE ANGLE_0
static bool cmpHoleSorting(const HOLE_INFO &a, const HOLE_INFO &b)
helper classes to handle hole info for drill files generators.
#define USE_ATTRIB_FOR_HOLES
std::pair< PCB_LAYER_ID, PCB_LAYER_ID > DRILL_LAYER_PAIR
PCB_LAYER_ID
A quick note on layer IDs:
int StrPrintf(std::string *result, const char *format,...)
This is like sprintf() but the output is appended to a std::string instead of to a character array.
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)