Difference between revisions of "Component: Scale Arc (Controls)"

From Flowcode Help
Jump to navigationJump to search
(XML import of component documentation)
 
(XML import)
 
(4 intermediate revisions by one other user not shown)
Line 4: Line 4:
 
|-
 
|-
 
| width="20%" style="color: gray;" | Author
 
| width="20%" style="color: gray;" | Author
| [http://www.matrixltd.com Matrix Ltd]
+
| Matrix Ltd
 
|-
 
|-
 
| width="20%" style="color: gray;" | Version
 
| width="20%" style="color: gray;" | Version
| 1.1
+
| 1.2 (Release)
 
|-
 
|-
 
| width="20%" style="color: gray;" | Category
 
| width="20%" style="color: gray;" | Category
Line 16: Line 16:
  
 
==[[File:Component Icon f307403b_2134_4efa_bfac_bbd0adc0f253.png|Image]] Scale Arc component==
 
==[[File:Component Icon f307403b_2134_4efa_bfac_bbd0adc0f253.png|Image]] Scale Arc component==
For creating dials and rotary controls.
+
A base component for drawing circular dials. This allows a simple way to create graduated
Make a scale to show any range of values, then link a pointer object to construct
+
and labelled dials, for example, within meter and rotary control components.
meters and rotary controls.
+
Mouse handling is built in for ease of building interactive controls.
 +
 
  
 
This component can be used as a base to create ''child'' components
 
This component can be used as a base to create ''child'' components
Line 27: Line 28:
 
|+|-
 
|+|-
 
|[[File:Component Icon 2e0aa52e_ac04_4997_b3ac_77205ba19522.png|Image]] Dashboard Knob
 
|[[File:Component Icon 2e0aa52e_ac04_4997_b3ac_77205ba19522.png|Image]] Dashboard Knob
|Simple simulation only knob (no analogue pin connection) for use on the dashboard.
+
|Rotary control designed for the dashboard panel.  Has customisable value markings
 +
around the control.  Simulation only - the control value can be read using simulation macros
 +
but is not connected to a chip pin.
 
|-
 
|-
 
|[[File:Component Icon 8c84170a_6fe8_4386_9709_451a0d21da64.png|Image]] Dashboard Meter
 
|[[File:Component Icon 8c84170a_6fe8_4386_9709_451a0d21da64.png|Image]] Dashboard Meter
|Simulation only panel meter for the dashboard (no analogue pin connection).
+
|Simulation only round meter/dial.  The range of values displayed is easily adjusted.
 
|}
 
|}
  
Line 64: Line 67:
  
 
:[[Variable Types|FLOAT]] ''Value''
 
:[[Variable Types|FLOAT]] ''Value''
::New value to set the pointer to.
+
::The value on the scale to move the pointer to.
  
  
 
'''Return value'''
 
'''Return value'''
  
:[[Variable Types|FLOAT]] : The resulting angle of the pointer in degrees from the positive X-axis.
+
:[[Variable Types|FLOAT]]
  
  
Line 78: Line 81:
  
 
:[[Variable Types|STRING]] ''Label''
 
:[[Variable Types|STRING]] ''Label''
::Text to display.
+
::Text to display.as the component label.
  
  
Line 122: Line 125:
 
This property is of type ''Panel object'' and can be referenced with the variable name ''axis_object''.
 
This property is of type ''Panel object'' and can be referenced with the variable name ''axis_object''.
  
By default the dial is centered at the component centre.  Choose another object here to set
+
An object to act as the centre of the arc, and rotation point of the 'Pointer' object.
 
 
a different center point for the scale.
 
  
NB)  Pointer objects always rotate around the centre of the dial markings.
+
By default, the arc is drawn centrally, but by assigning an object here, the whole scale can be centred
  
<span style="font-weight: normal;"><u>Mouse Control</u></span>
+
around a different point.
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''control_type''.
+
<span style="font-weight: normal;"><u>Function</u></span>
  
Decide whether or not the value can be set by clicking with the mouse.
+
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''is_control''.
  
Modes...
+
Choose the 'mode' of the component.
  
None - the dial will be a display only; value can be set using the 'setValue' macro.
+
"Display" mode - the arc can act as a value display, with the 'Pointer' object rotating to show incoming
  
Dial - clicking on the dial face will set the value.
+
value changes.
  
Pointer - clicking and dragging the pointer object will set the value.
+
"Control" mode - clicking on the scale, or 'Pointer' object, sets the value directly, which can be
  
Dial and Pointer - either object can set the value.
+
susequently read by the "GetValue" macro.
  
 
<span style="font-weight: normal;"><u>Canvas Shape</u></span>
 
<span style="font-weight: normal;"><u>Canvas Shape</u></span>
Line 182: Line 183:
 
This property is of type ''Color picker'' and can be referenced with the variable name ''label_color''.
 
This property is of type ''Color picker'' and can be referenced with the variable name ''label_color''.
  
Color for the component lable text.
+
Color for the component label text.
  
 
<span style="font-weight: normal;"><u>Radius %</u></span>
 
<span style="font-weight: normal;"><u>Radius %</u></span>
Line 203: Line 204:
  
 
The number of degrees between the minimum value and the maximum value.
 
The number of degrees between the minimum value and the maximum value.
 +
 +
<span style="font-weight: normal;"><u>Thickness</u></span>
 +
 +
This property is of type ''Floating point'' and can be referenced with the variable name ''arc_thick''.
 +
 +
Thickness of the arc line.
  
 
<span style="font-weight: normal;"><u>Show</u></span>
 
<span style="font-weight: normal;"><u>Show</u></span>
Line 209: Line 216:
  
 
Whether to show or hide the arc.
 
Whether to show or hide the arc.
 
<span style="font-weight: normal;"><u>Thickness</u></span>
 
 
This property is of type ''Floating point'' and can be referenced with the variable name ''arc_thick''.
 
 
Thickness of the arc line.
 
  
 
<span style="font-weight: normal;"><u>Divisions</u></span>
 
<span style="font-weight: normal;"><u>Divisions</u></span>
Line 226: Line 227:
 
This property is of type ''Signed integer'' and can be referenced with the variable name ''marks_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 interseciot with the arc.
+
Radius of the division ends - they are drawn from here to their intersection with the arc.
  
 
% of the component size.
 
% of the component size.

Latest revision as of 11:25, 13 February 2015


Author Matrix Ltd
Version 1.2 (Release)
Category Controls


Image Scale Arc 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:

-
Image Dashboard Knob Rotary control designed for the dashboard panel. Has customisable value markings

around the control. Simulation only - the control value can be read using simulation macros but is not connected to a chip pin.

Image Dashboard Meter Simulation only round meter/dial. The range of values displayed is easily adjusted.

Examples

No additional examples


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

FLOAT


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

FLOAT


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.