05-06-2014 10:16 AM
Hello,
i have a panel with 80 integer-indicators.
Then i have as input-parameter a string-array[1..80] where each indice has a comma-separated list of numeric-values 1..80
The content of each indice is the position of an indicator on the panel.
So it is possible that each inidice has only one value or one indice has all values.
One value can only appear once.
Not all values must be used. If unused it it not shown,
Now i want to dynamically align the inidicators as they appear in the array
For example
[1] = 1,2,3,4,5,6,7,8,9,10
[2] = 15,12,13,14,11
[3] = 53,20,34
[4] = 61,62,63,64,75,76,77,78,79,80
[5]..[80]
Depending on the content it should now align the content of [1] in line1, and content of [2] in line two and so on.
The unused values are hidden or outside of visible window.
How can this dynamically be done?
Thx for help
05-06-2014 10:23 AM
alligning should be done of indicators (placement in UI) or the text (inside the indicators)?
it will be helpfull if you provide a screenshot or .vi that shows both present and expected way of allignment (placing it manually)
thanks
phani
05-06-2014 10:40 AM - edited 05-06-2014 10:45 AM
I want to align the placement on the UI.
Attached a screenshot that shows 80 indicators and the string-array.
05-06-2014 11:24 AM
You will need to use property nodes for each of your indicators to set the Position Property.
I would create an array of references so that you have a means of programmatically looping through each indicator reference in the array to set the position of that particular indicator.
I would also use arrays to come up with a list of X positions to define where each column begins, and a list of Y positions to define where each row begins.
Then cycle through your numbers, determine which row and column they woud be in, and write the respective values out of the Xposition and Ypostion arrays to the indicator's position property.
Alternatively, I would just use a table control and write the values into the respective row and column of the array that makes up the table.
05-06-2014 11:31 AM
I would seriously consider Raven's Fan' second approach. (Use a table)
When I hear things like "I have 80 indicators...." I question how scaleable the solution might be. On ther other hand it is certainly possible to move indicators possitions as explained. but, you might not really want to.
05-07-2014 01:56 AM
Can you give me a hint what a "table control" is? If its easier than the array-solution...
05-07-2014 08:15 AM
Look at your Front Panel Palettes under List, Table, & Tree.
05-07-2014 08:59 AM
Ah, ok. I also thought about a 2D-array instead of indicators but the problem in the arry or table is that i dont have the labels as on indicators.
I need to see the value-number of the indicator. In the array or table i only have the value.
05-07-2014 11:17 AM
I don't understand how useful it is to have 80 numerics that are all labelled Numeric #. But it is your app.
If you need to have separate indicators with labels, then go with the first method I described to how to programmatically set the position of the indicators.
05-08-2014 02:25 AM
This is only an example with label-name "Numeric 1..80". Later there will be different names.