Difference between revisions of "Component: Scale Arc Template (Advanced Shapes)"
(XML import - Pre 8.0 release) |
|||
Line 38: | Line 38: | ||
==Examples== | ==Examples== | ||
Simple example showing how to use the simulation dial components as a meter display for use in monitoring type applications. | Simple example showing how to use the simulation dial components as a meter display for use in monitoring type applications. | ||
− | |||
{{Fcfile|Meters.fcfx|Meters}} | {{Fcfile|Meters.fcfx|Meters}} | ||
− | |||
==Downloadable macro reference== | ==Downloadable macro reference== |
Revision as of 14:51, 22 May 2018
Author | Matrix Ltd |
Version | 1.2 (Release) |
Category | Advanced Shapes |
Contents
Scale Arc Template component
A base component for drawing circular dials. This allows a simple way to create graduated and labelled dials, for example, within meter and rotary control components. Mouse handling is built in for ease of building interactive controls.
This component can be used as a base to create child components
The following components all inherit the traits of Scale Arc Template:
Examples
Simple example showing how to use the simulation dial components as a meter display for use in monitoring type applications.
Meters
Downloadable macro reference
This component does not contain any downloadable macros
Simulation macro reference
GetValue
Get the current scale value - this will be the most recent value set using "SetValue", or from the most recent mouse click if the component is in "Control"
mode.
Parameters
- This macro has no parameters
Return value
SetValue
Set the pointer to the given value on the scale. Returns the angle required to point at the given value.
Parameters
- FLOAT Value
- The value on the scale to move the pointer to.
Return value
SetLabel
Set the label text for the scale
Parameters
- STRING Label
- Text to display.as the component label.
Return value
- This call does not return a value
SetRange
Set the minimum and maximum values of the scale
Parameters
- FLOAT Minimum
- Minimum value for the scale
- FLOAT Maximum
- Maximum value for the scale
Return value
- This call does not return a value
Property reference
Pointer
This property is of type Panel object and can be referenced with the variable name target_object.
Set another panel object to be a pointer that will rotate around the scale.
Depending on the property 'Function' (below)....
"Display" mode - the object acts as a pointer showing the values set by the "SetValue" macro.
"Control" mode - the object acts as a handle for mouse movements that will set the current value.
Axis Object
This property is of type Panel object and can be referenced with the variable name axis_object.
An object to act as the centre of the arc, and rotation point of the 'Pointer' object.
By default, the arc is drawn centrally, but by assigning an object here, the whole scale can be centred
around a different point.
Function
This property is of type Fixed list of ints and can be referenced with the variable name is_control.
Choose the 'mode' of the component.
"Display" mode - the arc can act as a value display, with the 'Pointer' object rotating to show incoming
value changes.
"Control" mode - clicking on the scale, or 'Pointer' object, sets the value directly, which can be
susequently read by the "GetValue" macro.
Canvas Shape
This property is of type Fixed list of ints and can be referenced with the variable name canvas_shape.
Shape of the plane on which to draw the scale.
Resolution
This property is of type Signed integer and can be referenced with the variable name resolution.
The number of pixels per world unit of size.
The scale is drawn as a bit-map, so this setting determines the level of detail vs. drawing speed and memory
usage.
BG Color
This property is of type Color picker with transparency and can be referenced with the variable name bg_color.
Color of the scale background.
Positive Color
This property is of type Color picker and can be referenced with the variable name ink_color.
Color for arc and divisions for negative values.
Negative Color
This property is of type Color picker and can be referenced with the variable name neg_color.
Color for the arc and divisions for positive values.
Label Color
This property is of type Color picker and can be referenced with the variable name label_color.
Color for the component label text.
Radius %
This property is of type Signed integer and can be referenced with the variable name arc_radius.
Radius of the arc line as a percentage of the component's shortest dimension.
Start Angle
This property is of type Signed integer and can be referenced with the variable name arc_start.
Start angle of the sweep, where the minimum value will appear.
Measured in degrees, anti-clockwise from the positive X-axis.
Sweep
This property is of type Signed integer and can be referenced with the variable name arc_sweep.
The number of degrees between the minimum value and the maximum value.
Thickness
This property is of type Floating point and can be referenced with the variable name arc_thick.
Thickness of the arc line.
Show
This property is of type True or false and can be referenced with the variable name show_arc.
Whether to show or hide the arc.
Divisions
This property is of type Signed integer and can be referenced with the variable name marks_count.
Number of main divisions around the scale - these divisions can be numbered.
Radius %
This property is of type Signed integer and can be referenced with the variable name marks_radius.
Radius of the division ends - they are drawn from here to their intersection with the arc.
% of the component size.
Thickness
This property is of type Floating point and can be referenced with the variable name divs_thick.
Thickness of main (numbered) division lines.
Subdivisions
This property is of type Signed integer and can be referenced with the variable name marks_subdiv.
Number of smaller divisions between each main division. Set to zero if not required.
Subs Radius %
This property is of type Signed integer and can be referenced with the variable name subdiv_radius.
Radius of the small division ends. They are drawn from here to their intersection with the arc.
% of component size.
Subs Thickness
This property is of type Floating point and can be referenced with the variable name subs_thick.
Thickness of sub-division lines.
Show
This property is of type True or false and can be referenced with the variable name show_marks.
Whether to show or hide the division markings.
Maximum
This property is of type Floating point and can be referenced with the variable name val_max.
Maximum value to show on the display.
Minimum
This property is of type Floating point and can be referenced with the variable name val_min.
Minimum value to show on the display.
Decimals
This property is of type Signed integer and can be referenced with the variable name dec_places.
Number of decimal places to show on the number values.
Radius %
This property is of type Signed integer and can be referenced with the variable name num_radius.
Radius from the centre to place the number values.
% of component size.
Text Size %
This property is of type Signed integer and can be referenced with the variable name num_size.
Height of number text - % of component size.
Font
This property is of type Font picker and can be referenced with the variable name num_font.
Font for the number values.
Show
This property is of type True or false and can be referenced with the variable name show_numbers.
Show or hide the number values.
Text
This property is of type Line of text and can be referenced with the variable name label_text.
A text label to help identify the display.
Radius %
This property is of type Signed integer and can be referenced with the variable name label_radius.
Radius to place the label - % of component size.
Angle
This property is of type Signed integer and can be referenced with the variable name label_angle.
Angle at which to place the label - degrees anti-clockwise from the positive X-axis.
Text Size %
This property is of type Signed integer and can be referenced with the variable name label_size.
Height of the label font - % of component size.
Font
This property is of type Font picker and can be referenced with the variable name label_font.
Font for the text label.
Show
This property is of type True or false and can be referenced with the variable name show_label.
Show or hide the text label.