Usage of the description field?

Hi,

Are there any plans to make the description field in the library entries more useful in the future release? I don’t see the information in the description appear anywhere in the project other than the place where I write it initially or maybe I am missing something? When chosing the device in the schematic it is good that there is a category tree and a search bar. It helps. I usually write extra information from the datasheet in order to identify the device and also make a decision upon it in my choice. I can open any time the datasheet for this but in some cases it’s enough a short description.

I would like to give an example. From the picture below please tell me which device is the regulator? Which one is the buck boost converter? Which one is the switch? And so on. I will definitely not know after a month after finishing the project. And this list is at the moment short!

Some suggestions would be to solve this through a tooltip, a second column in the list or a droplist when hovering over it. I can encode the description in the name, but this is not what I want to do, obviously!

What is your suggestion?

Thanks,
Horia

P.S. I like what you are doing with this project. Keep on the good work!

1 Like

Hi,

I’m glad to hear you like LibrePCB :slight_smile:

You’re right, the description field was mainly added to allow collecting that information, but it is not yet used much in the application. It is planned to display it at more places but I don’t know yet in detail where and how.

Are you mainly talking about the library editor or also other places in the application?

In the library editor we could consider displaying it in the library content list which I’m currently rewriting completely. I gave it a quick shot:

I think that can be useful indeed but for many elements it also leads to very redundant information. I’m not 100% convinced yet :thinking:

Yes, it looks ugly when you have a lot of elements that are generic and have an extra description that says the same thing. It’s redundant, like you also said. I was talking mainly about devices that bear the name of their MPN. This is where the description is useful. I would start to find an efficient solution for the library and then implement it in the schematic. In the schematic this would be useful when reviewing it. For example, the description of the devices would need then to somehow pop up when hovered on the devices. HorizonEDA implemented this well.

I would programatically differentiate between generics and atoms (devices defined by MPN)

Until now no one got it completly right. Kicad is focusing more on generics, Horizon and EasyEDA is more focused on atoms. The truth is, you need both, generics and atoms. The library management system needs to cover both in order for the system to be efficient. I think that LibrePCB is pretty damn close or at least I have my hopes high.

I have deviated a little bit from the topic. In short, a description is needed only where needed.

Regards,
Horia

I agree, but LibrePCB doesn’t know which name is an MPN and which is generic. And honestly I don’t want to introduce a field “element is generic” as it would make the library concept more complex (and more cumbersome to create them) with very little benefit.

For devices we could detect it (if there are MPNs assigned, it is a concrete device) but not for symbols, components and packages.

Maybe some day we will find a good solution for it. For now it could even be better to always display it (despite it might be redundant) instead of never displaying it.

That should actually be easy to implement. All the information is available and here we don’t need to distinguish between generic devices or concrete devices.

All in all there needs to be way to inform the user about what that object or entry, is. This should be done without tweeking to much the structure of the system. Usually you encode this in the name like you did in the above picture and like most of us, I assume. The drawback is that it adds redundancy. The positive is that you do not need to change the structure of your system. I personally dislike it , but it is an established practice, a reminisence from the early C++ days. One can also enforce this through library conventions. At the moment it is a user choice in every CAD system. This is ok and works fine. Although, it is not a good design practice to rely on the discipline of the user.

For symbols, components and packages you need just to find your way in the library. Out of my experience you do not need this info anywhere else. The two columns list in your picture works just fine. Empty strings are ignored. So no need to write a description if you do not need it. This is already in the current version. My initial concern was about what do you do with this information? How do you display it to the user in a meaningful way? I think we covered some ideas even if these are present in other CADs. Some of them still work fine and some of them need to be modernized.

Regards,
Horia

If you have a better idea, please let me know. As I also mentioned, I’m not fully convinced either. But I don’t have a better idea yet. It’s always hard to find good concepts.

I have gave it a thought and I can suggest the following.

In order to distinguish if the entry is generic or specific one can look at the name of the entry. By entry I mean Symbol, Component, Package and Device. We know that the MPNs are not standardized in the sense that they have different structures encompassing different infos about the device in their alpha numerics, like voltage rating, package type etc. On the other hand, what is fixed about the MPN is that it is always an alpha numeric with capital letters, no spaces and with or withouth dashes. The generic parts are usually words with the first letter of the word usually being capital letter and the others being lowercase letters, the name may or may not contain whitespaces and the first word in most of the cases is not a number. This is the structure in 95% of the cases. The rest of 5% are either really special cases, which I didn’t encounter yet, or sloppines of the user in naming things, which should be ignored. This structure can be also mentioned in the library conventions of LibrePCB but if you really design HW for a living this structure is already there. The packages can be also generic. The generic ones are usually mechanical stuff, like holes or so, and the special ones are defined by the IPC-7351 standard, again alphanumeric, caps, zero dashes or one dash, no whitespaces and one or more underscores. This mentioned structure can be exploited in the code.

I don’t know how you organized your code. Until now I didn’t looked into it. I assume that you defined a class for each entity and you also used inheritance. It’s my guess. Altough I see that Rust has different philosophy of dealing with classes and objects, other than C++. Anyhow, what I suggest is to define a filter function that checks the name entered by the user and assigns an attribute of that class that will say if the object is generic or not. This could be a boolean flag or a string. This attribute can be queried in the program and decisions can be made upon it like for example displaying the description or not. Later, the usage can be extended. The function is a method of the class, in the best case, of the upper class. The function can be also global and the return value is the response if generic or not but, I don’t suggest this because with global functions things will tend to be messy and may produce code overhead. Don’t know in this case. I need to be deep in the code to make the decision. For checking the name you can use regex or language API and you only need to check the above mentioned points. For example, a non generic device is a string with capital letters, numbers and no withespaces and 0 or more dashes, the latter being a weak argument. This can be refined during the test phase. The function should be kept simple and, even if not needed later, one can remove it easily from the code. This will be transparent for the user. The user should never know if the device is generic or special. It’s an intrinsic attribute of the entry. All of this should be manged by the program in the background.

A side note. You can include what you mentioned above like checking if the MPN list of the device has an entry. This will refine the filtering but be careful with this. If you look at my device list posted above, I have entries called “Resistor 0603 (0201)” and “Capacitor 0603 (0201)”. These may look generic but it contains some concrete MPNs for some resistor and capacitor values. In the end these two entries are generic. I did this because I don’t want to define for each resitor and capacitor value a new device. They have the same package and symbol. It is redundant and will only create clutter in my device list. I also need the MPNs for assembly. I know it is contrary to the convention but conventions are not always preactical. You also may notice that the names are the ones from the base lib. I had my hopes that by naming it like in the base lib it will inherit the attributes from there. What it did instead, it it created an entry whith the same name and I see them in the place device list in the schematic as duplicates. Yeah, nice try :wink:. I saw the post where it states that in order to edit the base libs you need to create a local copy of them. This smells like trouble for me. Inheritance is the most efficient way. There should be only one golden source and no duplicates. This is another topic for another post.

I hope this make sense or it should be inspirational at least. I am open for comments :slight_smile:.

Best,
Horia

Thanks for your comment. Actually I also had that idea (mainly to consider names as MPNs if they are all uppercase and without spaces) but it didn’t work well enough. Spaces cannot be used as criteria because usually we name devices like “TI LM193N” so most devices are specific even when there is a space.

I gave it another try now by taking only the last word of the names into account. If it is all uppercase and at least 5 characters long, I consider it as an MPN and thus a concrete device. But it still fails in many cases:

So I’m not sure if this is good enough. But I didn’t consider more properties yet (like if a device has MPNs assigned of if a component is marked as schematic-only, or allow lowercase “x” in names) so at least some improvements can still be made.

I got your point. I will not disregard it tough. At the moment, I don’t have any ideas o how to improve on it. I will have to test it, like you did, in order to get a feeling of it. Thanks for trying it out. I will come back to this topic when I will have something better.

Regards,
Horia