취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

Wide Meter Wanted

해결 완료!
솔루션으로 이동

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 포인트
11/17 메시지
1,658 조회수

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."
12/17 메시지
1,652 조회수

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.

13/17 메시지
1,608 조회수

@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 포인트
14/17 메시지
1,592 조회수

Could you save this for 19?

 

Thanks

0 포인트
15/17 메시지
1,550 조회수

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 포인트
16/17 메시지
1,532 조회수
솔루션
승인자 paul_cardinale

This is what I came up with.

"If you weren't supposed to push it, it wouldn't be a button."
0 포인트
17/17 메시지
1,453 조회수