From 3af65936c1795b2164a80d7f144a538469b818f8 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 29 Nov 2021 16:44:45 +0000 Subject: [PATCH] Don't consider heatsink, castellated or fiducial pads for THT vs SMD. Also fixes a bug where the Footprint Checker's marker list wasn't cleared correctly from the last run. Fixes https://gitlab.com/kicad/code/kicad/issues/9821 --- pcbnew/dialogs/dialog_footprint_checker.cpp | 4 +++- pcbnew/footprint.cpp | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/pcbnew/dialogs/dialog_footprint_checker.cpp b/pcbnew/dialogs/dialog_footprint_checker.cpp index 094df71f76..5091146250 100644 --- a/pcbnew/dialogs/dialog_footprint_checker.cpp +++ b/pcbnew/dialogs/dialog_footprint_checker.cpp @@ -96,6 +96,8 @@ void DIALOG_FOOTPRINT_CHECKER::runChecks() FOOTPRINT* footprint = board->GetFirstFootprint(); wxString msg; + SetMarkersProvider( new BOARD_DRC_ITEMS_PROVIDER( board ) ); + deleteAllMarkers(); if( !footprint ) @@ -150,7 +152,7 @@ void DIALOG_FOOTPRINT_CHECKER::runChecks() footprint->CheckFootprintTHPadNoHoles( &tstHoleInTHPad ); m_checksRun = true; - SetMarkersProvider( new BOARD_DRC_ITEMS_PROVIDER( m_frame->GetBoard() ) ); + SetMarkersProvider( new BOARD_DRC_ITEMS_PROVIDER( board ) ); refreshEditor(); } diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index fe0222f1a3..3a7801c724 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -657,14 +657,32 @@ int FOOTPRINT::GetLikelyAttribute() const for( PAD* pad : m_pads ) { + switch( pad->GetProperty() ) + { + case PAD_PROP::FIDUCIAL_GLBL: + case PAD_PROP::FIDUCIAL_LOCAL: + continue; + + case PAD_PROP::HEATSINK: + case PAD_PROP::CASTELLATED: + continue; + + case PAD_PROP::NONE: + case PAD_PROP::BGA: + case PAD_PROP::TESTPOINT: + break; + } + switch( pad->GetAttribute() ) { case PAD_ATTRIB::PTH: tht_count++; break; + case PAD_ATTRIB::SMD: smd_count++; break; + default: break; }