Meter

Microchip Graphics Library

Microchip Graphics Library
Meter

There are three meter types that you can draw:

  1. MTR_WHOLE_TYPE
  2. MTR_HALF_TYPE
  3. MTR_QUARTER_TYPE
It supports only System inputs, replying to the event EVENT_SET with the message: MTR_MSG_SET (see MtrTranslateMsg() for details). This action ID means that the message contains the new value of the meter on the parameter 2 of the message. 

 

The Meter Object is rendered using the assigned style scheme, value range colors (see MtrSetScaleColors() for details) and compile time settings. The following figure illustrates the assignments for a MTR_HALF_TYPE meter. 

 

 

 

 

Functions
 
Name 
Description 
 
This function creates a METER object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object. 
 
This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set.
Depending on the defined settings, value of the meter will displayed or hidden. Displaying the value will require a little bit more rendering time depending on the size of the meter and font used.
When rendering objects of the same type, each object must be rendered completely before the rendering of the... more 
 
This function sets the value of the meter to the passed newVal. newVal is checked to be in the minValue-maxValue range inclusive. If newVal is not in the range, minValue maxValue is assigned depending on the given newVal if less than minValue or above maxValue. 
 
This function performs the actual state change based on the translated message given. Meter value is set based on parameter 2 of the message given. The following state changes are supported:  
 
This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
 
Macros
Name 
Description 
This macro returns the current value of the meter. Value is always in the minValue-maxValue range inclusive. 
This macro is used to directly decrement the value. 
This macro is used to directly increment the value. 
Scale colors can be used to highlight values of the meter. User can set these colors to define the arc colors and scale colors. This also sets the color of the meter value when displayed. Limitation is that color settings are set to the following angles: Color Boundaries Type Whole Type Half Type Quarter Arc 6 225 to 180 not used not used Arc 5 179 to 135 179 to 135 not used Arc 4 134 to 90 134 to 90 not used Arc 3 89 to 45 89 to 45 89 to 45 Arc 2 44 to 0 44... more 
This function sets the font of title. 
This function sets the font of value. 
This is a compile time setting to select the type if meter shape. There are three types:
  • MTR_WHOLE_TYPE - Meter drawn with 6 octants used.
  • MTR_HALF_TYPE - Meter drawn with semi circle shape.
  • MTR_QUARTER_TYPE - Meter drawn with quarter circle shape.
Set only one value at a time. This is done to save code space. User can define the colors of the arcs for each type. MTR_WHOLE_TYPE will use all the arc colors (arcColor1 - arcColor6) MTR_HALF_TYPE will use arc colors (arcColor5, arcColor4, arcColor3, arcColor2) MTR_QUARTER_TYPE will use arc colors (arcColor3, arcColor2) Set the meter type in Meter.h file and... more 
Sets the meter accuracy to one decimal places when displaying the values. Application must multiply the minValue, maxValue and values passed to the widget by RESOLUTION. 
Structures
Name 
Description 
Defines the parameters required for a meter Object. Depending on the type selected the meter is drawn with the defined shape parameters and values set on the given fields. 
Topics
Name 
Description 
List of Meter bit states. 
Links
Microchip Graphics Library Version 3.06.02 - October 15, 2012
Copyright © 2012 Microchip Technology, Inc.  All rights reserved