AnalogMeterTest

Displays a numerical value as an analog meter
Download

AnalogMeterTest Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Freeware
  • Publisher Name:
  • Digital Metrology Solutions
  • Publisher web site:
  • http://www.digitalmetrology.com/index.htm
  • Operating Systems:
  • Windows All
  • File Size:
  • 39 KB

AnalogMeterTest Tags


AnalogMeterTest Description

The AnalogMeterTest was developed to be a small tool that uses the analog meter class control to display a numerical value as an analog meter.Recently, I've been involved in a instrumentation project wherein one single display (a CView) is used to present measurement results as well as the status of some transducers. The desire was to have everything in one "window" that could be maximized and all of the relevant information could be seen without having to deal with overlapping windows or dialog boxes.As a means of graphically displaying the transducer status, an "analog meter" class was developed which could be used in any square rectangle within any display context. Thus, a sqaure area (CRect) could be determined within an application's CView derived class and the meter could be displayed and updated as needed within this CRect. The drawing a meter is somewhat trivial, however the smooth (and fast) animation of such a meter is a different matter. To this end I referred back to the "triple buffering" method I used in my Oscilloscope/Strip Chart control. In this approach, I create three bitmaps: one for the underlying "grid" (the pie shaped wedge, the title and numerical limit values), one for the "needle" and one which is used to temporarily store the "result" of the combination of the needle and grid prior to BitBlt'ing to the destination display context. To improve the speed of animation, these bitmaps are only updated on an "as needed" basis. For example, the grid bitmap is only redrawn when the meter's rectangle has changed and the needle bitmap is only redrawn when the needle's position has changed. Furthermore, the combination of bitmaps is performed in a memory based result prior to display in order to provide faster performance.


AnalogMeterTest Related Software