LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wide Meter Wanted

Solved!
Go to solution

I'd probably look at creating a 2D picture. I did a quick test and getting a gradient scale and a line as needle was simple enough.

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 11 of 17
(1,120 Views)

wiebe@CARYA wrote:

@paul_cardinale wrote:

wiebe@CARYA wrote:

I suppose the logic is that these meters resemble physical meters, and as the needle makes a circle, the meter has to stay to ratio...

 

You can replace a slider's background with a gradient decoration (2 colors only):

 

wiebeCARYA_1-1648554508623.png

 

Or a custom PNG (pixelated)...

 

Otherwise I guess you'll have to use a picture control and\or an XControl...


Can't just put an image on the background because I need the ramp data to be updated from a DB.


So... Even if the ratio wasn't fixed, you couldn't have used the meter? 🙄

 

Or is there a way to dynamically change the colors of the meter?


Yes, the color ramp of a meter is changeable:

paul_cardinale_0-1648645307493.png

 

"If you weren't supposed to push it, it wouldn't be a button."
Message 12 of 17
(1,114 Views)

I might have just the thing you are looking for.  This is a Meter Picture class that I intended on turning into a XControl or QControl but never got around to it.  You give it the color range and colors, then it creates a meter that has gradient colors for the ranges you picked.  You can then set the value, or resize the control and it creates a 2D Picture control showing the meter and value.  It doesn't work in all sizes but I think it does a decent job and you can adjust it as needed.

 

Meter Picture Class.png

I tried to keep performance decent, by only redrawing the things that are needed.  So the gradients aren't re created if only the value changes for instance.  Oh and documentation was never finished.  I think the 3 main functions are pretty self explanatory, but I can't honestly remember how I did all the math.  I'm guessing parts of it were pulled from other posts found on the forums.

Message 13 of 17
(1,070 Views)

@Hooovahh wrote:

I might have just the thing you are looking for.  This is a Meter Picture class that I intended on turning into a XControl or QControl but never got around to it.


Indeed a nice little picture class. This was exactly what I was thinking of when reading the original post. Well done.

 

If he needs it to be wider, just increase the radius a little bit. I like how the color ramp is a bunch of lines, but when you make the meter big (huuuge) you can see the aliasing and whitespace in between. I won't take a star off for that, though.

_______________________________________________________________
"Computers are useless. They can only give you answers." - Pablo Picasso
0 Kudos
Message 14 of 17
(1,054 Views)

Could you save this for 19?

 

Thanks

0 Kudos
Message 15 of 17
(1,012 Views)

Here it is in 2018 SP1. I rearranged the project a little and set the comment font so it would not exceed its bounds. No code changes.

_______________________________________________________________
"Computers are useless. They can only give you answers." - Pablo Picasso
0 Kudos
Message 16 of 17
(994 Views)
Solution
Accepted by paul_cardinale

This is what I came up with.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 17 of 17
(915 Views)