68 bool aGenerateNPTH_list )
75 wxASSERT( aLayerPair.first < aLayerPair.second );
78 if( ! aGenerateNPTH_list )
86 int hole_sz =
via->GetDrillValue();
125 for(
PAD*
pad : footprint->Pads() )
129 if( !aGenerateNPTH_list &&
pad->GetAttribute() == PAD_ATTRIB::NPTH )
132 if( aGenerateNPTH_list &&
pad->GetAttribute() != PAD_ATTRIB::NPTH )
136 if(
pad->GetDrillSize().x == 0 )
142 ? HOLE_ATTRIBUTE::HOLE_MECHANICAL
143 : HOLE_ATTRIBUTE::HOLE_PAD;
151 if(
pad->GetDrillShape() != PAD_DRILL_SHAPE::CIRCLE &&
152 pad->GetDrillSizeX() !=
pad->GetDrillSizeY() )
172 bool last_notplated_opt =
false;
219 std::set<DRILL_LAYER_PAIR> unique;
222 for(
int i = 0; i < vias.
GetCount(); ++i )
226 v->
LayerPair( &layer_pair.first, &layer_pair.second );
231 unique.insert( layer_pair );
234 std::vector<DRILL_LAYER_PAIR> ret;
239 ret.push_back( pair );
257 int ly_id = ( aLayer -
B_Cu ) / 2;
266 std::string ret =
layerName( aPair.first );
275 bool aMerge_PTH_NPTH )
const
282 extend = wxT(
"-NPTH" );
285 if( !aMerge_PTH_NPTH )
286 extend = wxT(
"-PTH" );
297 fn.SetName( fn.GetName() + extend );
300 wxString ret = fn.GetFullName();
315 hole_sets.emplace_back(
F_Cu,
B_Cu );
317 for( std::vector<DRILL_LAYER_PAIR>::const_iterator it = hole_sets.begin();
318 it != hole_sets.end(); ++it )
333 fn.SetPath( aPlotDirectory );
335 fn.SetExt( wxEmptyString );
336 wxString fullfilename = fn.GetFullPath() + wxT(
"-drl_map" );
345 msg.Printf(
_(
"Failed to create file '%s'." ), fullfilename );
355 msg.Printf(
_(
"Created file '%s'." ), fullfilename );
368 bool aCompatNCdrill )
const
375 text = wxT(
"; #@! " );
379 text << wxT(
"TF.FileFunction," );
382 text << wxT(
"NonPlated," );
384 text << wxT(
"MixedPlating," );
386 text << wxT(
"Plated," );
388 int layer1 = aLayerPair.first;
389 int layer2 = aLayerPair.second;
399 layer1 = ( ( layer1 -
B_Cu ) / 2 ) + 1;
404 layer2 = ( ( layer2 -
B_Cu ) / 2) + 1;
406 text << layer1 << wxT(
"," ) << layer2;
413 text << wxT(
",NPTH" );
418 else if( layer1 == toplayer && layer2 == bottomlayer )
419 text << wxT(
",PTH" );
420 else if( layer1 == toplayer || layer2 == bottomlayer )
421 text << wxT(
",Blind" );
423 text << wxT(
",Buried" );
434 bool hasOblong =
false;
435 bool hasDrill =
false;
447 if( hasOblong && hasDrill )
448 text << wxT(
",Mixed" );
450 text << wxT(
",Drill" );
452 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)