INTI-CMNB / KiBot

KiCad automation utility
GNU Affero General Public License v3.0
550 stars 65 forks source link

Use of custom fields defined only in the PCB (not just in the schematic) #650

Closed set-soft closed 1 month ago

set-soft commented 1 month ago

Discussed in https://github.com/INTI-CMNB/KiBot/discussions/648

Originally posted by **Wol** July 29, 2024 I'm wanting to see if I'm doing something wrong or if there's a feature missing from KiBot here: I'm currently using the "JLCPCB Rotation Offset" field on my footprints to configure an override for a footprint rotation. It's a 'LED_WS2812B-2020_PLCC4_2.0x2.0mm' footprint which KiBot, in misc.py, provides an override of 90*, however this is showing up incorrectly in JLC's previewer (which is a separate issue!), so I've had to duplicate the footprint and rename it to stop this override, and instead wanted to try applying my own override using the `JLCPCB Rotation Offset` field on my footprint. The issue I was finding is that KiBot isn't loading the fields on the footprint from the pcb file, but instead loads them from the symbol in the schematic instead. When doing PCBs, I place fields specific to the footprint and PCB assembly I will only apply in the PCB editor, and I very very rarely will do a "Update Schematic from PCB" command to bring assembly fields back into the schematic. I guess the question is: should KiBot be loading the fields for a component from both the schematic and pcb, rather than just the schematic, or is it a standard process to do a "Update Schematic from PCB" command after editing something in the PCB? Seems a bit of a weird process though to me to do a PCB fabrication change, but then also have to port those changes to the schematic first for them to work. Would be great if KiBot could merge both fields from the symbol and footprint into the "component"!
set-soft commented 1 month ago

Hi @Wol !

The above patch adds this. A global option can be used to disable it. I tested it using a rotation in a field found only in the PCB. Can you check if this solves your problem?

P.S. a second patch solves some issues you could find when the PCB is outdated

Wol commented 1 month ago

Perfect! I'll try pulling those into our KiCi based gitlab scripts and see if I can get that working.

Cheers :)