Meter Component - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Document Tools : Embedded Components : MeterComponent

Meter Component

• 

The meter component defines a meter in a Standard Maple worksheet or document. This component performs an action or a series of actions to communicate with other embedded components when adjusting the needle in the meter, although assigning an action to a component is not required.  

• 

To perform an action when the meter is adjusted, right-click (Control-click for Macintosh) the meter, and then select Edit Value Changed Action to open the Code Editor dialog for the meter. Enter the commands you want to perform in the Code Editor dialog.

• 

You need to specify one or more embedded components that will display the output when adjusting the needle in the meter. For more information, see the Meter Component Example on this page.

• 

The meter component is customized by setting options in the Meter Properties. To open the Meter Properties, right-click (Control-click for Macintosh) the meter, and then select Component Properties. Actions are associated with components using routines in the DocumentTools package.

• 

The Name property is used to reference the meter gauge when using the routines from the DocumentTools package.

• 

The Show Axis Label and Show Axis Tick Marks properties displays an axis label and axis tick marks on the meter respectively when selected.

• 

The Update Continuously while Dragging property performs a continuous action on one or more components when selected. The Maple commands in the Action When Value Changes property must be programmed as such to perform this continuous action.

Image of the Components Palette Item

Image of an Inserted Meter

Meter Properties

• 

The following table describes the control and use of the meter component options.

  

An x in the G column indicates that the option can be read, that is, retrieved by using the DocumentTools[GetProperty] tool.

  

An x in the S column indicates that the option can be written, that is, set by using the DocumentTools[SetProperty] tool.

Option           G  S  Option Type
 
continuousupdate x  x  true or false
enabled          x  x  true or false
lower            x  x  integer or floating-point number
majorTicks       x  x  positive integer or positive floating-point number
minorTicks       x  x  positive integer or positive floating-point number
pixelHeight      x  x  positive integer
pixelWidth       x  x  positive integer
showLabels       x  x  true or false
showTicks        x  x  true or false
tooltip          x  x  string
upper            x  x  integer or floating-point number
value            x  x  integer or floating-point number
visible          x  x  true or false
                                                                                     

  

continuousupdate 

  

Indicates whether the component should update continuously during drag operations. By default, the value is false.

  

enabled 

  

Whether the component is enabled. If enabled, the thumb can be moved with the mouse. By default, the value is false.

  

lower 

  

The lower bound on the meter. By default, the value is 0.

  

majorTicks 

  

The interval between the major ticks on the meter. By default, the value is 20.

  

minorTicks 

  

The interval between the minor ticks on the meter. By default, the value is 10.

  

pixelHeight 

  

The height of the meter image in pixels. By default, the value is 97.

  

pixelWidth 

  

The width of the meter image in pixels. By default, the value is 207.

  

showLabels 

  

Indicates if range values are shown. By default, the value is true.

  

showTicks 

  

Indicates if tick marks are shown. By default, the value is true.

  

tooltip 

  

The text that appears when the user hovers the mouse over the component.

  

upper 

  

The upper bound on the meter. By default, the value is 100.

  

value 

  

The current position of the meter marker. By default, the value is 0.

  

visible 

  

Specifies if the meter is visible. By default, the value is true .

Meter Component Example

Note: To interact with the examples provided below, open this help page as a worksheet and then execute the worksheet.

This examples shows how you can change the transparency of a 3-D plot using the Meter component.

To insert the components and configure the Plot component:

1. 

Insert a Plot and Meter component. For information on displaying the Maple palettes, see the Show Palettes help page.

2. 

Right-click (Control-click for Macintosh) the Plot component, and then select Component Properties.

3. 

In the Plot Expression field, enter plot3d(x^2*cos(y), x =-1 .. 1, y=-2*Pi .. 2*Pi);.

4. 

Click OK.

To configure the Meter component so that it changes the transparency of the plot:

1. 

Right-click (Control-click for Macintosh) the Meter component, and then select Component Properties.

2. 

Set the following values in the Meter Properties dialog:

• 

Value at Highest Position=1

• 

Current Position=0.5

• 

Spacing of Major Tick Marks=0.25

• 

Spacing of Minor Tick Marks=0.125

• 

Select Enable Input

• 

Select Update Continuously While Dragging

3. 

Click OK.

4. 

Right-click (Control-click for Macintosh) the Meter component, and then select Edit Value Changed Action.

This launches a dialog with preset statements and additional information on how to program actions between embedded components.

5. 

Before the end use; statement in the dialog, enter the following command:

Do(%Plot0=plot3d(x^2*cos(y), x = -1..1, y = -2*Pi..2*Pi, transparency =%Meter0));

Note: Ensure the names of the components are correct (that is, that they match the Name fields for their components).

6. 

From the File menu, select Save Code to accept all changes.

7. 

From the File menu, select Close Code Editor.

When you change the value of the Meter component (by moving its needle), the transparency of the 3-D plot changes to the value you set.

 

See Also

ButtonComponent, CheckBoxComponent, ComboBoxComponent, DataTableComponent, DialComponent, DocumentTools, DocumentTools[Do], DocumentTools[GetProperty], DocumentTools[SetProperty], EmbeddedComponents, LabelComponent, ListBoxComponent, MathExpressionComponent, PlotComponent, RadioButtonComponent, RotaryGaugeComponent, SliderComponent, TextAreaComponent, ToggleButtonComponent, VideoPlayerComponent,  VolumeGaugeComponent 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam