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
36 stars 7 forks source link

Question on using the plugin - where is footprint info stored? #96

Closed StormTrooper closed 5 months ago

StormTrooper commented 5 months ago

Been using KiCad and Inventree for a while now and just discovered this plugin which looks very useful.

I've followed the installation document and managed to install the plugin (v1.4.1) with KiCad 8.0.2. Setup the API/categories etc and in the symbol library I can see the list of parts.

So far so good.

One thing I'm not following is where do you setup the symbol and footprint information for the part. I get the Inventree has no way to know what the symbol and footprint will be and this has to be manually entered for each part.

image

Where do I do this though. I don't see anywhere in the part where this information can be entered?

image

Am I correct in thinking the footprint info be stored in Inventree?

afkiwers commented 5 months ago

Hi @StormTrooper,

The plugin looks for parameters. An example below. image

You can define which parameters are used in several places. For a generic assignment you can use the plugin settings. Please note that there is a bug in inventree which means it won't display the name only the ID. If you click on it though it will show you the names. image

If you want to specify a specific value or footprint parameter for a certain category, you can do that inside the admin panel. This will override the generic plugin settings. image

StormTrooper commented 5 months ago

Thanks for the details. That's the bit I was missing.

Added the missing parameters to KiCad and then setup the plugin to use those parameters.

Working perfectly now.

StormTrooper commented 5 months ago

@afkiwers I thought I had it all working, but one thing that is confusing me.

In Inventree I've got a part setup as follows:

image

When placing the part in KiCad I get the IPN | Value:

image

What do I need to change to just display the value. (100k) Played around with a few settings but not having any luck.

image

afkiwers commented 5 months ago

Did you enable Include IPN in the settings? It looks like it's set to include and show in schematic

Can you share a screenshot of the part's fields in KiCad?

StormTrooper commented 5 months ago

image

image

image

image

afkiwers commented 5 months ago

InvenTree is providing that to the plugin. Have a look under InvenTree settings->part->'Part Name Display Format' and play with that format. You probably have to get rid of some of the formatting.

Sorry, I don't have access to my computer at the moment just got my phone which makes it a bit harder to quickly check stuff on my side.

afkiwers commented 5 months ago

What's displayed as part name at the top in InvenTree when opening the parts page?

StormTrooper commented 5 months ago

Thanks, looks like it's the formatting. If part.ipn exists then display it. Currently set to:

{{ part.IPN if part.IPN }}{{ ' | ' if part.IPN }}{{ part.name }}{{ ' | ' if part.revision }}{{ part.revision if part.revision }}

So will also display revision if set.

The part name is displayed as RES-100K-0805 | 100k in Inventree. I'll modify the formatting.

StormTrooper commented 5 months ago

Changed it to {{ part.name }} which fixes the issue.

Made a note of the old setting in case something breaks down the line which expects that format.

afkiwers commented 5 months ago

Fantastic!

That's just a display thing and should not break anything.