yaqwsx / KiKit

Automation tools for KiCAD
https://yaqwsx.github.io/KiKit
MIT License
1.49k stars 200 forks source link

OpenPNP ignore footprints not in pos file #691

Closed lifeisafractal closed 3 months ago

lifeisafractal commented 3 months ago

The naturalComponentKey() method will fail on non-annotated footprints (i.e. REF***). This can happens when adding a graphical footprint in the PCB without it being in the schematic (which will commonly be marked as Not In schematic and Exclude from position file).

This commit ignores footprints that are excluded from the position file as they will have no bearing on the OpenPNP pos file process, and they might cause the process to fail for the reasons explained above.

lifeisafractal commented 3 months ago

I just force pushed up for a couple reasons:

  1. I didn't actually use the filtered footprint list in the next line (copy-paste error)
  2. I added a system test for this. I modified one of the existing project resources to include a non-annotated footprint. I confirmed the test fails w/o my fix, and passes with.
lifeisafractal commented 3 months ago

I thought this would be a quick one, but I think it's worth the effort to add a test for it. I don't have the time at the moment to dig into this, but I'll be able to get back to it later. I'm converting this PR to a draft for the moment and will re-open it when I get things working.