Dial Component - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Dial Component

insert a dial in a worksheet or document

 

Description

Image of the Components Palette Item

Image of an Inserted Dial

Dial Properties

Dial Component Example

Description

• 

The dial component performs an action or a series of actions to communicate with other embedded components when adjusting the needle in the dial, although assigning an action to a component is not required.  

• 

To perform an action when the dial, click the dial component, and then, from the Dial context panel, select Edit Value Changed Code to open the Code Editor dialog for the dial component. 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 dial. For more information, see the Dial Component Example on this page.

• 

The dial component is customized by setting options in the Dial context panel. To view the options in the context panel, select the dial component. Actions are associated with components using routines in the DocumentTools package.

• 

The Name property is used to reference the dial 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 dial respectively when selected.

• 

The Continuous Update On Drag property performs a continuous action on one or more components when selected. The Maple commands in the Edit Value Changed Code property must be programmed as such to perform this continuous action.

Image of the Components Palette Item

Image of an Inserted Dial

Dial Properties

• 

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

  

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

  

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

  

 

Option

Get

Set

Option Type

anglerange

x

x

integer

continuousupdate

x

x

true or false

enabled

x

x

true or false

image

 

x

name or string

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

startangle

x

x

integer

tooltip

x

x

string

type

x

 

string

upper

x

x

integer or floating-point number

value

x

x

integer or floating-point number

visible

x

x

true or false

  

 

  

anglerange 

  

The range from 0 to 360 degrees of the dial. By default, the value is 270.

  

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 is set to false, any action associated with this component cannot be initiated. By default, the value is true.

  

image

  

The image that appears on the dial.

  

lower 

  

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

  

majorticks 

  

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

  

minorticks 

  

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

  

pixelheight 

  

The height of the dial image in pixels.

  

pixelwidth 

  

The width of the dial image in pixels.

  

showlabels 

  

Indicates if labels are shown. By default, the value is false.

  

showticks 

  

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

  

startangle

  

The start angle from 0 to 360 degrees for the dial. By default, the value is 45.  

  

tooltip 

  

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

  

type 

  

The type of the component. This returns "Dial".

  

upper 

  

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

  

value 

  

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

  

visible 

  

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

Dial Component Example

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

This example shows how you can alter a Meter component using a Dial component.

 

1. 

Insert a Dial component and a Meter component using the Components palette.  For information on displaying the Maple palettes, see the Show Palettes help page.

2. 

Click the Dial component to display the Dial context panel.

3. 

Adjust the size of the Dial by entering 180 for both Width in Pixels and Height in Pixels.

Note: To use the entire area of the dial, change Start angle to 0 and Angle range to 360 degrees.

4. 

Click Change and then Clear to remove the default blue dial. To select a different image, click Select.

5. 

Click OK to save changes.

6. 

Click the Dial component, and then select Edit Value Changed Code.

This launches the Code Editor.

7. 

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

SetProperty("Meter0", value, GetProperty("Dial0", value ));

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

8. 

Click  or from the File menu, select Save Code to accept all changes.

9. 

From the File menu, select Close Code Editor.

When you change the value of the Dial component by turning it, the value on the Meter component changes accordingly.

 

with(DocumentTools):

You can verify the syntax of the embedded component action by executing the command in the worksheet.

SetProperty("Meter0", value, GetProperty("Dial0", value ));

See Also

DocumentTools

DocumentTools[GetProperty]

DocumentTools[SetProperty]

EmbeddedComponents