07-12-2012 10:31 AM
In my main VI , I have a cluster that is nested a few layers deep. The main VI will modify the cluster and write the cluster to a file for 1000 times (the modification is different each time). I want to give the user the ability to select which element in the cluster to modify, but I don't want to show the cluster to the user, since the cluster is confusing. Would it be possible to ask the user to specify the name of the element? How do I do this? What's the best way? Thanks!
07-12-2012 10:41 AM
I would find some other more UI friendly way of showing th einformation to the user. A table perhaps. A tree. I would avoid making the user know the names of the elements and asking them to supply that. Separate your inner processing from your UI. Make the UI easy to understand for the user. Since I have no idea what your cluster is or what you are trying to do it is difficult to give you any more concrete advice.
07-12-2012 11:52 AM
Try investigating XControls
you can make the datatype of the xcontrol your cluster and then have the freedom to make the user interface user friendly
07-12-2012 12:26 PM
This program is going to be for engineering only. At the moment, I am the only person who would use it, so supplying the element names of the cluster is not a big deal. Attached is an approach that I thought of, but it will require me to create a lot of cases and a combo box with a lot of slection, since the real program is more complext than the example. Is there a better way?
07-12-2012 12:43 PM
I think that what you demonstrate is the best approach. It's boring to set up but easy to modify later if you need to add or delete an element, the intent is clear, and the code isn't complicated. Theoretically you can flatten the cluster to a string, parse out the right section of the string, modify it, insert it back into the flattened string, and unflatten it back to a cluster, but it will take longer and be much harder to debug than the simple solution.
07-12-2012 12:48 PM
07-12-2012 12:57 PM
XControl would be cool, but after I learned about it, I also learned to stay away from it . It is a lot of work if I don't absolutely need it.
07-12-2012 12:58 PM
Looking at the example code, what recommendation do you have on the UI?
07-12-2012 01:20 PM
I would probably typedef all o fyour cluster and then use th ering control like you have. However, I would have a control for each type of cluster that you have and based on the value of th ering control show/hide the appropriate controls. Use the actual cluster type as your input.
07-12-2012 01:40 PM
Here is a down and dirty version of an XControl that will edit a cluster
there are plenty of improvements that can be made in the xcontrol itself but it demonstrates the idea