09-29-2022 02:58 AM
I'm designing a GUI for an AUV. I want to show the depth like in the image attached. The slide moves with the sensor value and the yellow line indicates the actual value.
How can I design this? Can the Simulator Assistant do this function?
(The vertical slide bar function doesn't look appealing that's why I won't use that)
Solved! Go to Solution.
09-29-2022 06:00 AM - edited 09-29-2022 06:01 AM
There are a number of ways you could do this, but because the values on the scale need to change as you descend, I would suggest going with the built-in Picture Plots VIs.
Specifically, look at Draw Scale.vi and the simple scale example from the example finder. Modifying it to get your basic indicator should be relatively simple. Then, upload your code so others can benefit too.
09-29-2022 08:54 AM - edited 09-29-2022 09:02 AM
It shouldn't be too hard to customize a vertical slide bar to look resemble the indicator in your image.
09-30-2022 01:48 AM
@zou wrote:
It shouldn't be too hard to customize a vertical slide bar to look resemble the indicator in your image.
What's not shown in the image, but I expect is what the OP wants, is that the line should stay in the center and the scale should be moving up and down instead (and have its values change over time). That's not something which I think can be done with just customization and you would need some code (at the very least something like putting the slide instead a cluster and changing its position).
09-30-2022 04:41 AM
09-30-2022 05:46 AM
@sarwatsarfaraz wrote:
I explored the Draw scale.vi, doesn't seem like i can design a moving scale by modifying it, because the start and end values of the scale are fixed in that
In what way are they fixed? It's an input to the VI.
Did you look at the shipping example I pointed to, which does most of the work you need?
09-30-2022 06:40 AM - edited 09-30-2022 06:45 AM
Depending on how robust and flexible you want this to be, you can take a very simple route: When customizing, replace the needle with your scale. That way, when the needle would be moving in the base indicator, the scale is moving. You will have to add your own needle and calibrate the indicator so that everything lines up. If you don't plan on changing it in the future, that would be a fast way to get it done.
For an example, take a look at the second compass indicator in the top row here: https://forums.ni.com/t5/Example-Code/Customizing-the-Gauge-Control-in-LabVIEW/tac-p/3533699/highlig... - they probably replaced the needle indicator with a whole circular degree scale so that the outer part can turn freely and "up" indicates the direction.
10-03-2022 10:14 AM - edited 10-03-2022 10:26 AM
@tst wrote:
@zou wrote:
It shouldn't be too hard to customize a vertical slide bar to look resemble the indicator in your image.
What's not shown in the image, but I expect is what the OP wants, is that the line should stay in the center and the scale should be moving up and down instead (and have its values change over time). That's not something which I think can be done with just customization and you would need some code (at the very least something like putting the slide instead a cluster and changing its position).
Figured that out right after I made my post. That's why I edited my post.
Customize the control is just for OP's concern about the appealing of the slide bar.
I was thinking move the whole control up/down, not just the scale. It's too easy thought everyone knows how.
Not only the scale moves, the blue background might potentially becomes darker when depth increase.
That's why move the whole control rather then the scale.
And it's easier than redraw everything.
10-03-2022 10:21 AM
@LLindenbauer wrote:
For an example, take a look at the second compass indicator in the top row here: https://forums.ni.com/t5/Example-Code/Customizing-the-Gauge-Control-in-LabVIEW/tac-p/3533699/highlig... - they probably replaced the needle indicator with a whole circular degree scale so that the outer part can turn freely and "up" indicates the direction.
Rotate the scale is a built-in feature of the gauge control. Only available at edit time.
10-03-2022 10:56 AM
If you change the scale.min and scale.max and keep the needle in the middle (or just a fixed graphical needle) you'd get a similar effect.