LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Design a depth scale for GUI

Solved!
Go to solution

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)

0 Kudos
Message 1 of 20
(1,122 Views)

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.


___________________
Try to take over the world!
0 Kudos
Message 2 of 20
(1,081 Views)

It shouldn't be too hard to customize a vertical slide bar to look resemble the indicator in your image.

 

 

George Zou
0 Kudos
Message 3 of 20
(1,052 Views)

@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).


___________________
Try to take over the world!
0 Kudos
Message 4 of 20
(1,017 Views)
Yes, this is exactly what I want. 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
0 Kudos
Message 5 of 20
(1,001 Views)

@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?


___________________
Try to take over the world!
0 Kudos
Message 6 of 20
(985 Views)

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.

0 Kudos
Message 7 of 20
(971 Views)

@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.

 

 

 

George Zou
0 Kudos
Message 8 of 20
(925 Views)

@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.

 

George Zou
0 Kudos
Message 9 of 20
(921 Views)

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.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 20
(898 Views)