06-13-2014 08:48 AM
Hello,
I have a numeric control and a rectangular LED that changes colour from Green>Yellow>Red with different range of values for each colour. I was wondering If I can place this LED behind a numeric indicator. Basically have the background have the LEd while the number displays the Numbers in the front. I tried to change the order of these items but doesn't work the way i want it to.
Any help would be great! Much appreciated!
Thuba25
06-13-2014 08:54 AM
You can overlay and arrange objects on the z-axis -- however it is not recommended due to potential performance issues.
How about rather than having an LED behind the control, change the background (or perhaps text) color of the control itself?
Mike...
06-13-2014 09:02 AM - edited 06-13-2014 09:05 AM
This is the best attempt I could do... I set the background of the Control to transparent using a Property Node:
EDIT:
it should also be noted i used "Bring to Front" on the Numeric Control. I also disabled the label and increment/decrement visibility:
06-13-2014 09:05 AM
Ooh, Ooh, Ooh...
Mr Happy's suggestion just gave me another idea: Have nothing but the LED and display the number in the LED's Boolean Text property.
Mike...
06-13-2014 09:06 AM
@mikeporter wrote:
Ooh, Ooh, Ooh...
Mr Happy's suggestion just gave me another idea: Have nothing but the LED and display the number in the LED's Boolean Text property.
Mike...
I like this idea even more than mine. It would look much nicer. But I dont have time to create another example if you would like to do the honors.
06-13-2014 09:10 AM
How can i do that ?
06-13-2014 09:12 AM - edited 06-13-2014 09:13 AM
Thuba should be able to comeup with the code, there's property nodes for all the significant bits -- as well as examples that ship with NI.
One hint though: The Boolean Text for an LED typically isn't shown by default, you'll have to turn it on manually.
Mike...
06-13-2014 09:12 AM
I don't want the text to be just two values for ON and OFF. The colours will be green yellow and red. So i would like to display the range of numbers, lets say 1-10 for GREEN , 11-20 YELLOW and 21-30 RED.
06-13-2014 09:14 AM - edited 06-13-2014 09:15 AM
That's fine, there's also a property node for what the boolean text should be, and for three colors vary the button color using property nodes -- rather than the boolean value.
Mike...
06-13-2014 09:14 AM
@Thuba25 wrote:
I don't want the text to be just two values for ON and OFF. The colours will be green yellow and red. So i would like to display the range of numbers, lets say 1-10 for GREEN , 11-20 YELLOW and 21-30 RED.
Thats why mikeporter's recommendation was even better. You can literally set the string "1-10" or an individual number "1" using a property node. See here for an example of property node's changing the label: http://digital.ni.com/public.nsf/allkb/35994A10267179A286256E15006D4255