afkiwers / inventree_kicad

KiCad EDA conform API endpoint for KiCad's parts library tool. This plugin provides metadata only and requires matching symbol and footprint libraries within the KiCad EDA.
MIT License
38 stars 8 forks source link

Allow part selection during metadata import rather than discard part #59

Open atanisoft opened 11 months ago

atanisoft commented 11 months ago

Currently when importing an XML from KiCad if the component does not have a field name starting with "inventree" the component is discarded and not processed. It would be great if we could manually specify the mapping during import for existing PCBs that do not currently have the field data defined. It would also be great if an import summary could be generated after import listing components that were imported (grouped by part) and which could not be imported due to no part match or missing field (grouped by part / ref)

afkiwers commented 11 months ago

I'll split this into two separate issues.

Adding a generic identifier for the part ID is quickly done. However, creating a table etc will probably take a couple of hours.

afkiwers commented 11 months ago

@atanisoft I implemented the id mapping and created a new release.

atanisoft commented 11 months ago

Thanks @afkiwers I pulled in the new release to my docker based instance, changed the key to "mpn" (as a temporary option) and was going to import the XML file. Is there an easy way to follow the process to see that it imported things correctly?

afkiwers commented 11 months ago

No, not at the moment, sorry.

atanisoft commented 11 months ago

might need a small follow up PR for the non-numeric value in a key to lookup by part name rather than only part id (which also can be tracked independently). But that is minor. I can confirm that it works if I manually add a numeric only key value.

afkiwers commented 11 months ago

You mean instead of using the InvenTree part ID use the InvenTree name instead?

atanisoft commented 11 months ago

Yeah, as a fallback for non-numeric or numeric values that don't match as a part-id. As an example, I've got an existing schematic with "mpn" as a key for tracking the manufacturer part number (such as 860010575013, Wurth Electronik 100uF 35V electrolytic cap) which when imported will try to match by part-id and find it doesn't exist but it has an existing part in the system (for this example it's part-id 100)