12-04-2010 12:05 PM
Hi everyone,
I am currently involved in reading a series of temperatures along a length of pipe as part of an experiment. I thought it would be a nice touch for my VI to have a diagram of the pipe which changes colour to show the temperature distribution along it.
I have attached my initial solution. I would have posted a VI snippet but this seemed to effect the my references in the property nodes.
Issues
The code 'works' in the sense that the foreground colour of each tab control will change based on the value of the corresponding temperature.
I am looking for suggestions as to how to do this more efficiently as there will be up to 16 temperatures in the final system.
Many thanks in advance,
Pete
12-04-2010 12:48 PM - edited 12-04-2010 12:53 PM
Tabs are probably the weirdest choice here. Why not use e.g. a simple colorbox or button?
In any case, try to learn about autoindexing, it will dramatically simplify your code (see attached in yellow box).
I probably would use an array of clusters, each containing a colorbox and a numeric with transparent background. Modify as needed. 😉 (see attached in green box).
Of course you probably would want to make it a it prettier than my draft. 😉
For a larger ramp, I would use a plain array of flat colorboxes. Now simply index into a color ramp to generate it according to your temperatures.
12-04-2010 01:26 PM
Thank you for the quick reply.
The green solution solves both of my previous issues! It is much less convoluted than what I had previously.
I have now read the help file for the Threshold 1D Array function as I had not used this previously.. and I also refreshed my memory about autoindexing.
The last thing you mention is for a larger ramp, could you elaborate? I think I understand what you mean but I wouldn't know how to implement it.
Thanks again,
Pete
12-04-2010 01:36 PM - edited 12-04-2010 01:39 PM
Here's a quick example. Modify as needed. 😉
For simplicity, you could also use an intensity graph. Simply make the 1D array of temperatures into a 2D array and feed it to an intensity graph. Change the Z color ramp accordingly.