Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Featurerequest: Virtual Parameters #70

Open
TimGoll opened this issue Feb 1, 2024 · 17 comments
Open

Featurerequest: Virtual Parameters #70

TimGoll opened this issue Feb 1, 2024 · 17 comments
Labels
enhancement New feature or request

Comments

@TimGoll
Copy link

TimGoll commented Feb 1, 2024

I'm not 100% sure if this is the right place to ask. Maybe this should be directed at inventree itself. But I try it here first anyway.

I'm using this tool to import LCSC parts into inventree. I'm not sure that this is the best way to do it, but this is how I do it right now.

It works really good, but it adds stuff such as the Supplier Part Number to the supplier tab. Which makes sense if you look at it that way. However I'm unable to get this value in KiCad and I'd like to have the LCSC Part # as a parameter in KiCad so the exported BOM works to order the PCBs.

The easiest solution for me would be to edit the aforementioned tool. But I'm wondering if you could add to your addon some sort of virtual parameter that adds the LCSC part number (or any MPN for that matter) to the KiCad parameters.

Maybe something in this menu:
image

Sorry for the rambling and feel free to close if this is out of scope for this addon!

@afkiwers
Copy link
Owner

afkiwers commented Feb 1, 2024

Could you send through some screenshots of the data you want in kicad?

@TimGoll
Copy link
Author

TimGoll commented Feb 1, 2024

Mainly this one:

image

But it probably needs a different name so that the KiCad JLC Plugin accepts it. Here's a list of the names that are accepted so it would probably be best to be able to define it in the UI.

Also the name / value are something that I'm not that much of a fan of:
image

I set the value to the part value (which is fine, even though I'd like it to be shortened automatically to 2u2 for example; but I can do that by modifying the import tool I guess), but the name is a bit annoying. The name is fine in inventree, in fact I think it is even a good name, but it is confusing in KiCad imho. I'd like it to be something like 100n_0402_LCSC or so - but without modifying the actual name in InvenTree.

Again, I'm not sure if this is in scope for this addon or if this is even something anyone would want from it. Maybe this is just my weird way of using it. But as a general feedback, this is something that bothers me.

@TimGoll
Copy link
Author

TimGoll commented Feb 1, 2024

I'd like to also add that the last point is only something I'd want for basic parts such as capacitors. Because I'll have quite a lot of them in the list and it would make it easier to find them in KiCad if their name was less cryptic.

So if this is something you'd like to add, then it is something that should be in the categories settings

@afkiwers
Copy link
Owner

afkiwers commented Feb 1, 2024

The plugin should only provide "non-volatile" data to KiCad to keep the schematic simple and consistent over time. Let's say your supplier is shutting down and you would need a new one, KiCad would still display the old supplier unless updated.

InvenTree got the facilities to cater for that.

@TimGoll
Copy link
Author

TimGoll commented Feb 2, 2024

So I guess it comes down to me being unfamiliar with InvenTree

@afkiwers
Copy link
Owner

afkiwers commented Feb 2, 2024

We actually work the other way around. We import BOMs from KiCad into InvenTree part assembly BOMs which then shows you what's in stock and what's missing. Then you can create a purchase order for a specific distributor and upload that as csv file almost straight into your cart. Has been working like a treat so far.

I think there are actually plugins in the work which will automate that even more.

@TimGoll
Copy link
Author

TimGoll commented Feb 2, 2024

Looking forward to it! This is still all a bit new to me and I have yet to learn what is coming. Is there somewhere a resource for stuff like this? So I can read into it more? Because this list seems to be a bit out of date

@afkiwers
Copy link
Owner

afkiwers commented Feb 6, 2024

The InvenTree's docs are quite good I think. It's just a lot to go through.

It helps to have a look at InvenTree's demo server. It's pretty cool what it can do.

@afkiwers afkiwers added enhancement New feature or request wontfix This will not be worked on labels Feb 14, 2024
@afkiwers afkiwers removed the wontfix This will not be worked on label Mar 1, 2024
@afkiwers
Copy link
Owner

afkiwers commented Mar 2, 2024

@TimGoll just letting you know that I am currently looking into adding this feature.

@TimGoll
Copy link
Author

TimGoll commented May 28, 2024

awesome, I'm looking forward to it

@ondras12345
Copy link

I have a problem that could potentially also be solved by something like virtual parameters / templates.
I have an electrolytic capacitor in InvenTree, and it has separate parameters for capacitance and rated voltage. However, I'd like the value shown in KiCad to be {capacitance} / {rated_voltage}.

@TimGoll
Copy link
Author

TimGoll commented Dec 2, 2024

@afkiwers Any updates on this? We finally came around setting up our inventree server and I'm trying to figure out what the best practices would be. Right now I'd like to use something like virtual parameters. You however suggested a different approach that I did not yet figure out.

@afkiwers
Copy link
Owner

afkiwers commented Dec 2, 2024

Hi Tim, Unfortunately I don't really have a lot of time to work on that plugin at the moment. Sorry about that.

@TimGoll
Copy link
Author

TimGoll commented Dec 2, 2024

Hi Tim, Unfortunately I don't really have a lot of time to work on that plugin at the moment. Sorry about that.

Understandable. Thank you!

@TimGoll
Copy link
Author

TimGoll commented Dec 5, 2024

My team manager is open to chip in a few of my dev hours to implement such a feature. Could you line out how you'd do it, so that it matches your ideas. Thanks!

@afkiwers
Copy link
Owner

afkiwers commented Dec 6, 2024

Hi Tim, I am happy for you to lead this one.

Here is probably the best place to discuss your ideas. In general, as long as it doesn't disturb any of the other features I'm open to whatever helps you.

@TimGoll
Copy link
Author

TimGoll commented Dec 9, 2024

Okay, here's what I think would work:

  • handle it the same way footprint mappings are handled, so that each footprint type can have its own virtual params
  • define a parameter name (which is then added in KiCad to the part) and link it to a variable that is on the object (like the MPN in the suppliers tab)

Not sure yet on where to start, if you have any pointers I'm open to that. Otherwise I will look through your code and see how you did things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants