If you've ever been to some kind of major utility plant or industrial site
you may have seen equipment with all kinds of gages and meters on them. I figured it would be
neat to have some of your computer sensors to have the same kind of appearance (call me old
school). So here is my computerized interpretation of the trusty old Westinghouse KX-241 meter:

The appearance is obviously not perfect yet but I like where it's headed.

Requirements

This program requires Qt 4.

It also requires some kind of sensor input. Since this is just a demo it is kind of
specific to what I actually have. My goal is to someday have this be an option type in
KSysGuard. Until then, if you have lm_sensors you should be able to get more inputs but
most of the sensors just use /proc.

Of course this is probably Linux-specific, but I do not have different systems on which to
test, and again this is just a demo. ;)

This uses qmake so after it builds you need to copy it manually if you would like to install
it. I just run it from where it was built myself.

Features

Everything is anti-aliased to look nice.

Also animation is employed to try and make the needle feedback realistic.

Unfortunately the above combine to make CPU usage high for rapidly oscillating values.
This is a self-fulfilling prophecy for the CPU usage meter so as of now stats you get while
running this program have a lot of inherent error for CPU usage.

The widget can draw green or red bands (i.e. stay inside green band or keep anywhere but in
red band).

In the demo you can have more than one widget for a single sensor (I have the example of
two meters for fan speed, with a narrow range to show fine detail.

Comments

One way to reduce CPU usage is to stop the needles from moving. I've done this for the
network meters by using a non-zero lower bound. So minor network usage will not cause
deflection and therefore will not cause an expensive redraw.

Caching of things that are expensive to paint is already performed. The needle is the
only thing that is redrawn but I'm sure those smarter than I can find lots more room for
optimization.

One technique is to use QGLWidget instead of QWidget as a base class for the widget. But
IIRC when I tried it I lost anti-aliasing for some things.