06-03-2013 07:52 PM
Is there any way to get a static reference to a decoration? I have some pipes that are represented by colored decorations that I wish to change the colors of them based on the data I receive. I know it is possible to get references to decorations in a programmatic way, but that is a huge maintainability problem since it makes it incredibly difficult to follow the program flow. Thanks.
Solved! Go to Solution.
06-03-2013 08:16 PM
I do not think you can get that directly. Check the Idea Exchange. I think there have been some proposals along that line.
Perhaps an alternative approach would be to put color box indicators behind the decorations and change the color of those. The borders of your pipe decorations would be opaque while the interiors would be transparent to allow the color boxes to show through. The color boxes show up as standard terminals on the block diagram. With appropriate labels they fit perfectly into the dataflow paradigm.
Lynn
06-04-2013 01:06 AM
As Lynn suggested, there is already an idea for this in the IE, and if you find it, you will also find a link to do something like this using tags.
That said, I agree with his suggestion in this case and would take it even a step further - use only color box controls. You should be able to customize them using the control editor to do quite a few things. If you have a lot of them, I would suggest putting them in a cluster and writing code which will automatically get their references and actually change their colors (value) based on their labels. You will probably find it easier and cleaner than controlling each one directly.
06-04-2013 02:52 AM
What do you mean precisely with "it makes it incredibly difficult to follow the program flow"?
You may store the references into a LV2 global type vi in the initialization step. Then it would be easy to use them without having too much wires around.
06-04-2013 08:58 AM
@tst wrote:
As Lynn suggested, there is already an idea for this in the IE, and if you find it, you will also find a link to do something like this using tags.
That said, I agree with his suggestion in this case and would take it even a step further - use only color box controls. You should be able to customize them using the control editor to do quite a few things. If you have a lot of them, I would suggest putting them in a cluster and writing code which will automatically get their references and actually change their colors (value) based on their labels. You will probably find it easier and cleaner than controlling each one directly.
Very sound advice. as I learned to my horror here. and was directed here for help customizing the controls I eventually used easilly. (saving about a forest's worth of BD space as well)
06-04-2013 10:10 AM - edited 06-04-2013 10:11 AM
You might also consider the multi-segment pipe control...