74 wxASSERT( aLayerPair.first < aLayerPair.second );
77 if( !aGenerateNPTH_list )
85 int hole_sz =
via->GetDrillValue();
135 for(
PAD*
pad : footprint->Pads() )
139 if( !aGenerateNPTH_list &&
pad->GetAttribute() == PAD_ATTRIB::NPTH )
142 if( aGenerateNPTH_list &&
pad->GetAttribute() != PAD_ATTRIB::NPTH )
146 if(
pad->GetDrillSize().x == 0 )
156 if(
pad->GetProperty() == PAD_PROP::CASTELLATED )
158 else if(
pad->GetProperty() == PAD_PROP::PRESSFIT )
171 if(
pad->GetDrillShape() != PAD_DRILL_SHAPE::CIRCLE &&
pad->GetDrillSizeX() !=
pad->GetDrillSizeY() )
189 bool last_notplated_opt =
false;
236 std::set<DRILL_LAYER_PAIR> unique;
239 for(
int i = 0; i < vias.
GetCount(); ++i )
243 v->
LayerPair( &layer_pair.first, &layer_pair.second );
248 unique.insert( layer_pair );
251 std::vector<DRILL_LAYER_PAIR> ret;
256 ret.push_back( pair );
274 int ly_id = ( aLayer -
B_Cu ) / 2;
283 std::string ret =
layerName( aPair.first );
292 bool aMerge_PTH_NPTH )
const
300 extend = wxT(
"-NPTH" );
304 if( !aMerge_PTH_NPTH )
305 extend = wxT(
"-PTH" );
316 fn.SetName( fn.GetName() + extend );
319 wxString ret = fn.GetFullName();
334 case IPC4761_FEATURES::FILLED:
335 extend << wxT(
"-filling-" );
338 case IPC4761_FEATURES::CAPPED:
339 extend << wxT(
"-capping-" );
342 case IPC4761_FEATURES::COVERED_BACK:
343 extend << wxT(
"-covering-" );
346 case IPC4761_FEATURES::COVERED_FRONT:
347 extend << wxT(
"-covering-" );
350 case IPC4761_FEATURES::PLUGGED_BACK:
351 extend << wxT(
"-plugging-" );
354 case IPC4761_FEATURES::PLUGGED_FRONT:
355 extend << wxT(
"-plugging-" );
358 case IPC4761_FEATURES::TENTED_BACK:
359 extend << wxT(
"-tenting-" );
362 case IPC4761_FEATURES::TENTED_FRONT:
363 extend << wxT(
"-tenting-" );
370 fn.SetName( fn.GetName() + extend );
373 wxString ret = fn.GetFullName();
388 hole_sets.emplace_back(
F_Cu,
B_Cu );
390 for( std::vector<DRILL_LAYER_PAIR>::const_iterator it = hole_sets.begin(); it != hole_sets.end(); ++it )
405 fn.SetPath( aPlotDirectory );
407 fn.SetExt( wxEmptyString );
408 wxString fullfilename = fn.GetFullPath() + wxT(
"-drl_map" );
417 msg.Printf(
_(
"Failed to create file '%s'." ), fullfilename );
427 msg.Printf(
_(
"Created file '%s'." ), fullfilename );
440 bool aCompatNCdrill )
const
447 text = wxT(
"; #@! " );
451 text << wxT(
"TF.FileFunction," );
454 text << wxT(
"NonPlated," );
456 text << wxT(
"MixedPlating," );
458 text << wxT(
"Plated," );
460 int layer1 = aLayerPair.first;
461 int layer2 = aLayerPair.second;
471 layer1 = ( ( layer1 -
B_Cu ) / 2 ) + 1;
476 layer2 = ( ( layer2 -
B_Cu ) / 2) + 1;
478 text << layer1 << wxT(
"," ) << layer2;
485 text << wxT(
",NPTH" );
488 else if( layer1 == toplayer && layer2 == bottomlayer )
489 text << wxT(
",PTH" );
490 else if( layer1 == toplayer || layer2 == bottomlayer )
491 text << wxT(
",Blind" );
493 text << wxT(
",Buried" );
504 bool hasOblong =
false;
505 bool hasDrill =
false;
517 if( hasOblong && hasDrill )
518 text << wxT(
",Mixed" );
520 text << wxT(
",Drill" );
522 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
virtual const wxString getProtectionFileName(DRILL_LAYER_PAIR aPair, IPC4761_FEATURES aFeature) const
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)
Report a string with a given severity.
wxString GetDefaultPlotExtension(PLOT_FORMAT aFormat)
Return 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)