12-27-2021 02:46 PM
I have many hundreds of classes in memory, maybe a thousand or more. It's extremely cumbersome to find the parent for inheritance in the drop down list. Is there any easier way to find the parent in the list when creating or editing a class?
12-27-2021 08:38 PM
Maybe there is. There is a tree that lists the classes in properties when you set the inheritance. You can also view the inheritance of classes in the project. Do you have a screen shot of what you are doing?
12-28-2021 12:11 PM
Here's an image of the new class dialog and what I mean. You see the size of that scrollbar in the parent class pane? I can't even filter by name or anything, I have to scroll through this looking for the class of interest, and if it's layered a few layers inside of the heirarchy/lvlibs its tough to figure out where it's going to land in the list alphabetically.
12-28-2021 02:40 PM
Ok I see what you are talking about and yes, that sucks. I do not know of another way to set inheritance besides dealing with that tree of LV objects. Maybe not exactly what you want but you can set the parent class programatically, see this post.
I like to put prefixes in my class names so it reads like: A_my_base_class.lvclass then when I inherit I make a B_child_class.lvclass that inherits from A_my_base_class.lvclass
I keep each base and inherited classes in a lvlib so when you view them in the project explorer it gives them some kind of order, also it makes it easier to view when assigning a parent class.
12-28-2021 04:02 PM
Thank you, that's a really useful forum post and it occurs to me that someone has already probably written some sort of a script/labview extension that I can use to make this easier.
As to your A_ B_ way of doing it, doesn't that become a nightmare if you're refactoring your code and potentially changing the inheritance tree?
12-28-2021 05:26 PM
As to your A_ B_ way of doing it, doesn't that become a nightmare if you're refactoring your code and potentially changing the inheritance tree?
Well it could be but I keep my inheritance tree very flat and do more composition so refactoring is usually not a problem. The A_ naming convention is just so I can quickly see the inheritance level of a VI in the project manager without having to look at the hierarchy. If I move a VI to a new parent, I update the prefix. I never ever go past C_ this is my current project.