TousstNicolas / JLC2KiCad_lib

JLC2KICAD_lib is a python script that generate a component library (schematic, footprint and 3D model ) for KiCad from the JLCPCB/easyEDA library.
MIT License
228 stars 41 forks source link

--append_numbers flag to append numbers to part names in library #15

Closed Kamoool closed 2 years ago

Kamoool commented 2 years ago

Hello, I have added --append_numbers flag to append part numbers to names in the library. That helps a little bit when searching in the library, because of working on part numbers. I have changed the LCSC number property to be hidden by default because IMHO it's not really needed straight away on the schematic. Also, I have added a Name property that will keep the name of the component without the LCSC part number.

TousstNicolas commented 2 years ago

Hi, Thank you for your PR, I will take a look at it and test it, and if there is no issue, I will merge.

TousstNicolas commented 2 years ago

Is there a reason you use the property "Name" over "Value" to display ? It is a detail, but this is the first thing I noticed because KiCad display the "Name" field in a different color than "Value" (which is what all other components use). After that, a small rebase to clean and it should be good.

Kamoool commented 2 years ago

Value in Kicad is used in general as a name in the library to search for components. When the new flag is used it is appended with C...... number, then using the filter in the schematic library you can find the part with either C.... number and part name as well. I have added the Name property that is hidden when --append_numbers flag is not used and shown (Value is hidden) when the flag is used to show only part name, without C number, on the schematic.

TousstNicolas commented 2 years ago

If it is only used to be able to search it using the Cxx number, it is easier to use the "keywords" property, which is here for this exact purpose.

Kamoool commented 2 years ago

I didn't know about that, then I'll create a new PR with keywords filled with C.... values because using keywords property defeats the purpose of this PR. I think it also shouldn't need an additional flag and should be done by default, what do you think about that?

TousstNicolas commented 2 years ago

yes I agree, it can be done by default. I will add handle it, will be easier than opening a new PR for that small change.