From c107695278f36322de722e1ed97c7023d0732515 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Tue, 5 Mar 2024 09:48:55 -0300 Subject: [PATCH] [BoardView] Skip footprints with no pads not just REF** See whitequark/kicad-boardview#14 --- CHANGELOG.md | 2 ++ kibot/out_boardview.py | 12 ++++++------ tests/reference/5_1_7/glasgow-boardview.brd | 3 +-- tests/reference/6_0_8/glasgow-boardview.brd | 3 +-- tests/reference/7_0_6/glasgow-boardview.brd | 3 +-- tests/reference/8_0_0/glasgow-boardview.brd | 3 +-- 6 files changed, 12 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 960fa533..8f14572b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - KiRi: continue even on corrupted schematics (#583) - Variants: avoid W045 on nameless pads. Assuming they are on purpose and not real pads. (See #584) +- BoardView: Skip footprints with no pads (not just REF**) + (whitequark/kicad-boardview#14) ### Fixed - Netlist generation problems with components on the PCB but not in schematic. diff --git a/kibot/out_boardview.py b/kibot/out_boardview.py index e081a1ae..9676fef7 100644 --- a/kibot/out_boardview.py +++ b/kibot/out_boardview.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2021-2022 Salvador E. Tropea -# Copyright (c) 2021-2022 Instituto Nacional de TecnologĂ­a Industrial -# Copyright (c) 2018-2020 @whitequark -# License: GPL-3.0 +# Copyright (c) 2021-2024 Salvador E. Tropea +# Copyright (c) 2021-2024 Instituto Nacional de TecnologĂ­a Industrial +# Copyright (c) 2018-2024 @whitequark +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) # Adapted from: https://github.com/whitequark/kicad-boardview import re @@ -16,9 +16,9 @@ logger = log.get_logger() def skip_module(module, tp=False): - refdes = module.GetReference() - if refdes == "REF**": + if module.GetPadCount() == 0: return True + refdes = module.Reference().GetText() if tp and not refdes.startswith("TP"): return True if not tp and refdes.startswith("TP"): diff --git a/tests/reference/5_1_7/glasgow-boardview.brd b/tests/reference/5_1_7/glasgow-boardview.brd index ec30c225..a00fff57 100644 --- a/tests/reference/5_1_7/glasgow-boardview.brd +++ b/tests/reference/5_1_7/glasgow-boardview.brd @@ -299,7 +299,7 @@ NETS: 227 226 /IO_Banks/IO_Buffer_B/VDAC 227 /IO_Banks/IO_Buffer_A/VDAC -PARTS: 245 +PARTS: 244 C1 2515 3887 2634 3962 0 2 C10 2643 3895 2718 3958 2 2 C11 2399 1192 2492 1153 4 1 @@ -437,7 +437,6 @@ MK1 1926 358 2325 -42 455 1 MK2 1926 1972 2325 1572 464 1 MK3 4761 1972 5159 1572 473 1 MK4 4761 358 5159 -42 482 1 -NONO_HANA 2221 2696 3588 3767 491 2 R1 2909 675 2968 600 491 1 R10 3584 917 3659 858 493 1 R11 2303 746 2364 671 495 1 diff --git a/tests/reference/6_0_8/glasgow-boardview.brd b/tests/reference/6_0_8/glasgow-boardview.brd index 8814ed89..9fecd292 100644 --- a/tests/reference/6_0_8/glasgow-boardview.brd +++ b/tests/reference/6_0_8/glasgow-boardview.brd @@ -299,7 +299,7 @@ NETS: 227 226 /IO_Banks/IO_Buffer_B/VDAC 227 /IO_Banks/IO_Buffer_A/VDAC -PARTS: 245 +PARTS: 244 C1 2515 3887 2634 3963 0 2 C10 2643 3895 2718 3959 2 2 C11 2399 1192 2492 1153 4 1 @@ -437,7 +437,6 @@ MK1 1926 364 2325 -42 455 1 MK2 1926 1978 2325 1572 464 1 MK3 4761 1978 5159 1572 473 1 MK4 4761 364 5159 -42 482 1 -NONO_HANA 2221 2685 3588 3768 491 2 R1 2906 675 2968 600 491 1 R10 3584 919 3659 858 493 1 R11 2303 746 2364 671 495 1 diff --git a/tests/reference/7_0_6/glasgow-boardview.brd b/tests/reference/7_0_6/glasgow-boardview.brd index f549b1ad..0fa341d2 100644 --- a/tests/reference/7_0_6/glasgow-boardview.brd +++ b/tests/reference/7_0_6/glasgow-boardview.brd @@ -299,7 +299,7 @@ NETS: 227 226 /IO_Banks/IO_Buffer_B/VDAC 227 /IO_Banks/IO_Buffer_A/VDAC -PARTS: 245 +PARTS: 244 C1 2515 3887 2634 3962 0 2 C10 2643 3895 2718 3958 2 2 C11 2399 1192 2492 1153 4 1 @@ -437,7 +437,6 @@ MK1 1926 363 2325 -42 455 1 MK2 1926 1977 2325 1572 464 1 MK3 4761 1977 5159 1572 473 1 MK4 4761 363 5159 -42 482 1 -NONO_HANA 2221 2686 3588 3766 491 2 R1 2907 675 2968 600 491 1 R10 3584 918 3659 858 493 1 R11 2303 746 2363 671 495 1 diff --git a/tests/reference/8_0_0/glasgow-boardview.brd b/tests/reference/8_0_0/glasgow-boardview.brd index b1458786..b3bf9c29 100644 --- a/tests/reference/8_0_0/glasgow-boardview.brd +++ b/tests/reference/8_0_0/glasgow-boardview.brd @@ -303,7 +303,7 @@ NETS: 227 226 /IO_Banks/IO_Buffer_B/VDAC 227 /IO_Banks/IO_Buffer_A/VDAC -PARTS: 245 +PARTS: 244 C1 2515 3887 2634 3962 0 2 C10 2643 3895 2718 3958 2 2 C11 2399 1192 2492 1153 4 1 @@ -441,7 +441,6 @@ MK1 1926 363 2325 -42 455 1 MK2 1926 1977 2325 1572 464 1 MK3 4761 1977 5159 1572 473 1 MK4 4761 363 5159 -42 482 1 -NONO_HANA 2221 2686 3588 3766 491 2 R1 2907 675 2968 600 491 1 R10 3584 918 3659 858 493 1 R11 2303 746 2363 671 495 1