02-20-2009 10:16 AM
Hey Everyone,
I am writing a large vi where front panel space is becoming a limitation. One of the elements that I want to display is a 2-D array of boolean indicators (rectangular LEDs). Is there any way to dynamically resize the elements in the array so that regardless of the number of elements, the entire array is always visible and has a constant footprint. For example, say the array is 8 x 8 elements, and takes up 160x160 pixels on the front panel so each element is roughly 20x20 pixels. Then the number of elements shifts to 4x4. I want the display to stay 160x160 pixels, but the size of each element to double to 40x40 pixels. Is this possible?
Thanks all,
Matt
Solved! Go to Solution.
02-20-2009 10:26 AM
Me again.
Forgot to note, using LabVIEW 8.2 FDS. So, no Xcontrols for me.
M
02-20-2009 10:27 AM
On the FP right click on just the element in the array (make sure you have not clciked on the whole array) and choose create reference or property node. The bounds should let you specify the size down to a certain minimum. For booleand from the clasic palette they can be made smaller than the modern versions since they don't have a border.
Ben
02-20-2009 10:38 AM
Why don't you covert the boolean array to 0,1 and use an intensity graph instead? Set the scaled to autoscale and the rest should fall into place.
Else you could use two property nodes. One for the element (button size) and one for the array container (numrows, numcolumns). See attached quick draft.
02-20-2009 10:41 AM
Ben wrote:The bounds should let you specify the size down to a certain minimum.
Ben, "bounds" is read only. Only "button size" will work. See my demo above.
02-20-2009 10:46 AM
Thanks Ben,
I was just missing the right property. I was looking at "Bounds", which is read only. Didn't see the "Button Size" property.
02-20-2009 10:52 AM
The intensity graph solution is probably a bit simpler. Here's an example. (The advantage is that the bounds of the graph remain completely static).
02-20-2009 01:58 PM
So thank you for two great ideas/examples. Definitely think I have a couple of very workable approaches. I have a follow on question about using the intensity graph approach.
First some background. This indicator is going to show the progress of a sorting operation, 1-4 copies of 1-8 unique items are being sorted into 1-32 containers. The items arrive at the sorter in random order, are identified, and then placed into the container where they are still needed. The point of this indicator is to show the user, at a glance, how full each container is andwhich componenets are missing. I want the elements (columns) to appear different for the unique items, which I know you can't do in an array of booleans. So I had already dumped the boolean approach for an array of colorboxes, and it was the color boxes that I was trying to dynamically size. There is still a boolean array to keep track of if an item has arrived, but that array drives the array of colorboxes where each type of item is color coded by assigning a gray value to colorbox for false, and a particular color if true. See attached, which works pretty well (detailed adjusts will make it just right).
I think the intensity graph will look much nicer though, so here is the question:
How do I map the different colors onto the intensity graph so it looks like the colorbox array without the lines? The attached get vi puts out a different value for each yes/no, which is to say I already know how to take the boolean and convert the 1 state to a unique number, what I don't know how to do is map that number into a particular color on the intensity graph.
Thanks guys.
Super helpful as always!
Matt
02-20-2009 02:57 PM
02-21-2009 02:00 PM
Munson1027 wrote:How do I map the different colors onto the intensity graph so it looks like the colorbox array without the lines?
You can just right-click on a marker on the z-scale and select the marker color. In your case you only have two colors total, so things are quire trivial. 🙂