06-11-2012 10:43 AM
What is the best way to repeat a group of interface elements N times?
Right now I am using an array of clusters, but that does not work very well because the property nodes are all identical for each element in an array. In this case different scales and range restrictions are needed on the different elements. I understand it is feasible to manually code equivilent behavior, but it seems a bit of a cludge. Is there a "right way" to do this?
Solved! Go to Solution.
06-11-2012 10:48 AM
A little more detail would be needed. Is N fixed, do you have to show all N at once.
Often the best solution is to decouple the data from the user interface, that is to store the data as an array of clustres but present the data to the user for interaction as a single element or a cluster of clusters of a fixed window of elements populated from the array.
06-11-2012 10:48 AM
From what yo have posted I'll suggest using a sub-panel to host the details that are unique. Users selects which widget to poke at and the sub-panel for that type of widget is shown.
Ben
06-11-2012 10:51 AM
Hi,
I'm not too sure what you want to improve, an array of cluster seems to be a good solution in some cases. Are you trying to improve the code behind or more the user interface?
Can you show your fornt panel and if needed also the code behind that you'd want to improve?
I'm not too sure what you mean with the"identical property nodes"...
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
06-11-2012 11:52 AM
I'm not too sure what you mean with the"identical property nodes"...
At least as I understand it the properties of all elements in an array are the same. So if you set the increment property on a numeric control in an array, then it will apply it to all the numerics. I need to be able to initialize slides, numerics and other controls with different increments, min values and max values.
N is fixed once the VI is initialized. It will load in the data from a configuration file. I do not need to show them all at once, but it would be nice to show several. The array of clusters with the side scrollbar looks right in that sense. Ill try playing around with clusters of clusters for display with the array backend I think that may be the right way to go.
Is N fixed, do you have to show all N at once.
06-11-2012 12:30 PM
" I do not need to show them all at once, but it would be nice to show several. "
This may be the key. Separate the storage and internal usage of the data from the display as Paul said. Use the best option for each and convert as necessary.
An array of clusters may be the best internal storage. Include controls for the initial values, scales, and limits as needed.
Set up the User interface in a way that makes sense for what the users will be doing. Use property nodes to set the scales and increments. Perhpas add a string indicator so you can let the user know which group is active. Other options include listboxes and sub-panels as Ben mentioned.
Lynn