Dials & Gauges Blockset    

Percent Indicators

The Percent Indicators library contains controls that are designed to display percentages and ratios. The Generic Percent and Simple Light Blue blocks are probably the most useful blocks in this library. By default, these blocks reflect scalar input values between 0 and 100 by coloring a corresponding segment of a linear scale. By customizing the blocks, you can also have them display an input value X between m and M as the percentage 100 * ((X - m) / (M - m)).

Customizing Percent Indicators

The table below lists some common ways to customize a block in the Percent Indicators library, using its ActiveX Control Properties dialog box.

Task 
Description 
Use a radial percentage scale that reflects the input as a sector of a circle
On the Misc. panel, set DisplayMode to Radial. Use the StartAngle value to indicate where the sector begins; a value of 0 corresponds to a vertical radius above the circle's center, while a value of 90 corresponds to a horizontal radius to the right of the circle's center.
Change the direction in which a radial percentage scale increases
On the Misc. panel, use the Direction property to reverse the scale's polarity. If Direction is set to Forward, then the scale increases clockwise.
Use a linear percentage scale that reflects the input as a portion of a rectangle
On the Misc. panel, set DisplayMode to Linear.
Change the direction in which a linear percentage scale increases
On the Misc. panel, use the Orientation property to indicate whether the linear scale is horizontal or vertical. Use the Direction property to reverse the scale's polarity. If Direction is set to Forward, then a horizontal scale increases to the right and a vertical scale increases downward.
Specify the range to use when converting the input to a percentage
On the Misc. panel, use the Min and Max properties. If the input value is X, then the block displays the percentage 100 * ((X - Min) / (Max - Min)).
Display a number near or inside the corresponding colored area
On the Portions panel, set DigitalStyle to Floating. You can use the DigitalPosition value to vary the position along one dimension (radius in the case of a radial scale, height in the case of a horizontal scale, and horizontal coordinate in the case of a vertical scale).
Display a number in a fixed position
On the Portions panel, set DigitalStyle to Fixed. To specify the position of the number, first set PortionID to the ID of the portion you want to configure (0 if you are displaying only the scalar input signal) and then use the PortionDigitalX and PortionDigitalY values to indicate the position.

Combining Multiple Regions in One Display

To display multiple regions on a single block, see the customizations in the table below. To learn how to control multiple regions simultaneously, see Controlling Multiple Graphical Elements.

Task 
Description 
Add another region to the display
On the Portions panel, increase the Portions property. The ID of the new region is the Portions property value minus one. To specify properties of the new region, set PortionID to that ID and then set the remaining properties on the dialog box panel accordingly. Note that the DigitalStyle and DigitalFormat properties apply to all regions on the block.
Delete the most recently added region from the display
On the Portions panel, decrease the Portions property. This deletes all properties associated with the region, such as its color.


  Customizing the Odometer Block Sliders