Pcbnew: Array tool should not number NPTHs

Devolve the logic as to whether a pad should be numbered or not
to a pad utility function. Add a very simplistic test for this
function (demonstrating how to test BOARD_ITEMs in general).

Fixes: lp:1804787
* https://bugs.launchpad.net/kicad/+bug/1804787
This commit is contained in:
John Beard
2019-01-06 07:55:49 -08:00
committed by Seth Hillbrand
parent 81bac449d3
commit ec91329da0
6 changed files with 182 additions and 1 deletions
+3 -1
View File
@@ -27,7 +27,9 @@
*/
#include "array_creator.h"
#include <board_commit.h>
#include <pad_naming.h>
#include <dialogs/dialog_create_array.h>
@@ -108,7 +110,7 @@ void ARRAY_CREATOR::Invoke()
{
D_PAD* pad = static_cast<D_PAD*>( new_item );
if( !pad->IsAperturePad() )
if( PAD_NAMING::PadCanHaveName( *pad ) )
pad->SetName( array_opts->GetItemNumber( ptN ) );
}
}