DRC: check current footprint against symbol's footprint filters and warn user
Description
This is a feature suggestion.
Sometimes, there are situations where the footprint of a symbol is assigned by clicking on the symbol, edit, and looking manually for a footprint. To give an example, one can (stupidly, like me) make a 'typo/mistake' and assign a footprint 223 instead of the correct one 263. There are no warnings as both footprints have the same number of pins. Then the board is sent to manufacturing and when you start the soldering and you are almost done, then you notice the (unluckily last) component obviously does not fit and you have to restart from scratch the PCB design, manufacturing, soldering...
I know that it would have been better to check twice myself, and to use the Assign Footprints Tool with the lib filters, instead of clicking on the symbol and scrolling myself for it. However, I would still like to suggest a feature to warn the user when he is doing mistakes, as KiCad has enough information to conclude that the footprint is not part of the footprint filters.
I was thinking of two mechanisms of warning the user of this:
- At eeschema level, with maybe a red background colour of the field, like a 'formula validator'.
- At pcbnew level, with an extra checkbox in the DRC menu, that allows to test footprints against the filters defined in the corresponding symbols
These warnings should be done only if the symbol has footprint filters defined at all (and for the DRC, if the checkbox is enabled).
Steps to reproduce
- Open eeschema
- add symbol ua7805
- type E
- click on footprint field
- click on footprint library icon
- choose SOT-223-3_TabPin2 instead of the correct one TO-263-3_TabPin2
- No warnings are issued
- If you edit library symbol, you see that the chosen one does not match any of the footprint filters
KiCad Version
Application: Eeschema
Version: 5.99.0-unknown-5c309f0fe~104~ubuntu18.04.1, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.58.0 OpenSSL/1.1.1 zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Platform: Linux 4.15.0-123-generic x86_64, 64 bit, Little endian, wxGTK, ,
Build Info:
Date: Nov 10 2020 12:03:11
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.22
Boost: 1.65.1
OCE: 6.9.1
Curl: 7.58.0
ngspice: 33
Compiler: GCC 7.5.0 with C++ ABI 1011
Build settings:
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=ON
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
KICAD_SCRIPTING_ACTION_MENU=ON
KICAD_USE_OCE=ON
KICAD_SPICE=ON