Difference between revisions of "Component: Scale Arc Template (Advanced Shapes)"

From Flowcode Help
Jump to navigationJump to search
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
+
{| style="width:50%"
 
 
{| width="50%"
 
 
|-
 
|-
| width="20%" style="color: gray;" | Author
+
| width="20%" style="color:gray;" | Author
 
| Matrix Ltd
 
| Matrix Ltd
 
|-
 
|-
| width="20%" style="color: gray;" | Version
+
| width="20%" style="color:gray;" | Version
| 1.2 (Release)
+
| 1.2
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| Advanced Shapes
 
| Advanced Shapes
 
|}
 
|}
  
  
 +
==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.
  
==[[File:Component Icon f307403b_2134_4efa_bfac_bbd0adc0f253.png|Image]] Scale Arc Template component==
+
==Component Source Code==
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.
 
  
 +
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Scale_Arc.fcfx FC_Comp_Source_Scale_Arc.fcfx]
  
This component can be used as a base to create ''child'' components
+
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Scale_Arc.fcfx FC_Comp_Source_Scale_Arc.fcfx]
  
The following components all inherit the traits of Scale Arc Template:
+
==Detailed description==
  
{| class="wikitable" width="50%"
 
|+|-
 
|[[File:Component Icon 2e0aa52e_ac04_4997_b3ac_77205ba19522.png|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.
 
|-
 
|[[File:Component Icon 8c84170a_6fe8_4386_9709_451a0d21da64.png|Image]] Dashboard Meter
 
|Simulation only round meter/dial.  The range of values displayed is easily adjusted.
 
|}
 
  
==Examples==
 
Simple example showing how to use the simulation dial components as a meter display for use in monitoring type applications.
 
  
{{Fcfile|Meters.fcfx|Meters}}
 
  
  
==Downloadable macro reference==
 
  
''This component does not contain any downloadable macros''
 
  
==Simulation macro reference==
 
  
===<span style="font-weight: normal;"><u><tt>GetValue</tt></u></span>===
 
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'''
 
  
:[[Variable Types|FLOAT]]
 
  
 +
''No detailed description exists yet for this component''
  
===<span style="font-weight: normal;"><u><tt>SetValue</tt></u></span>===
+
==Examples==
Set the pointer to the given value on the scale.  Returns the angle required to point at the given value.
 
  
'''Parameters'''
 
  
:[[Variable Types|FLOAT]] ''Value''
 
::The value on the scale to move the pointer to.
 
  
  
'''Return value'''
 
  
:[[Variable Types|FLOAT]]
 
  
  
===<span style="font-weight: normal;"><u><tt>SetLabel</tt></u></span>===
 
Set the label text for the scale
 
  
'''Parameters'''
 
  
:[[Variable Types|STRING]] ''Label''
 
::Text to display.as the component label.
 
  
  
'''Return value'''
 
  
:''This call does not return a value''
 
  
  
===<span style="font-weight: normal;"><u><tt>SetRange</tt></u></span>===
 
Set the minimum and maximum values of the scale
 
  
'''Parameters'''
+
''<span style="color:red;">No additional examples</span>''
  
:[[Variable Types|FLOAT]] ''Minimum''
 
::Minimum value for the scale
 
  
:[[Variable Types|FLOAT]] ''Maximum''
 
::Maximum value for the scale
 
  
  
'''Return value'''
 
  
:''This call does not return a value''
 
  
  
  
  
==Property reference==
 
<span style="font-weight: normal;"><u>Pointer</u></span>
 
  
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.
+
==Macro reference==
  
Depending on the property 'Function' (below)....
+
===GetValue===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetValue'''
 +
|-
 +
| colspan="2" | 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
"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.
+
===SetLabel===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetLabel'''
 +
|-
 +
| colspan="2" | Set the label text for the scale&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Label
 +
|-
 +
| colspan="2" | Text to display.as the component label.&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
<span style="font-weight: normal;"><u>Axis Object</u></span>
 
  
This property is of type ''Panel object'' and can be referenced with the variable name ''axis_object''.
+
===SetRange===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRange'''
 +
|-
 +
| colspan="2" | Set the minimum and maximum values of the scale&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 +
| width="90%" | Minimum
 +
|-
 +
| colspan="2" | Minimum value for the scale&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 +
| width="90%" | Maximum
 +
|-
 +
| colspan="2" | Maximum value for the scale&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
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
+
===SetValue===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetValue'''
 +
|-
 +
| colspan="2" | Set the pointer to the given value on the scale.  Returns the angle required to point at the given value.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 +
| width="90%" | Value
 +
|-
 +
| colspan="2" | The value on the scale to move the pointer to.&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
around a different point.
 
  
<span style="font-weight: normal;"><u>Function</u></span>
+
==Property reference==
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''is_control''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
Choose the 'mode' of the component.
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
"Display" mode - the arc can act as a value display, with the 'Pointer' object rotating to show incoming
+
|-
 
+
|-
value changes.
+
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
+
| width="90%" | Pointer
"Control" mode - clicking on the scale, or 'Pointer' object, sets the value directly, which can be
+
|-
 
+
| colspan="2" | 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.&nbsp;
susequently read by the "GetValue" macro.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
<span style="font-weight: normal;"><u>Canvas Shape</u></span>
+
| width="90%" | Axis Object
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''canvas_shape''.
+
| colspan="2" | 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.&nbsp;
 
+
|-
Shape of the plane on which to draw the scale.
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Function
<span style="font-weight: normal;"><u>Resolution</u></span>
+
|-
 
+
| colspan="2" | 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.&nbsp;
This property is of type ''Signed integer'' and can be referenced with the variable name ''resolution''.
+
|-
 
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
The number of pixels per world unit of size.
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Style
 
+
|-
The scale is drawn as a bit-map, so this setting determines the level of detail vs. drawing speed and memory
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
usage.
+
| width="90%" | Canvas Shape
 
+
|-
<span style="font-weight: normal;"><u>BG Color</u></span>
+
| colspan="2" | Shape of the plane on which to draw the scale.  &nbsp;
 
+
|-
This property is of type ''Color picker with transparency'' and can be referenced with the variable name ''bg_color''.
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
+
| width="90%" | Resolution
Color of the scale background.
+
|-
 
+
| colspan="2" | 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.&nbsp;
<span style="font-weight: normal;"><u>Positive Color</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-2-icon.png]]
This property is of type ''Color picker'' and can be referenced with the variable name ''ink_color''.
+
| width="90%" | BG Color
 
+
|-
Color for arc and divisions for negative values.
+
| colspan="2" | Color of the scale background.&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Negative Color</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
 
+
| width="90%" | Positive Color
This property is of type ''Color picker'' and can be referenced with the variable name ''neg_color''.
+
|-
 
+
| colspan="2" | Color for arc and divisions for negative values.&nbsp;
Color for the arc and divisions for positive values.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
<span style="font-weight: normal;"><u>Label Color</u></span>
+
| width="90%" | Negative Color
 
+
|-
This property is of type ''Color picker'' and can be referenced with the variable name ''label_color''.
+
| colspan="2" | Color for the arc and divisions for positive values.&nbsp;
 
+
|-
Color for the component label text.
+
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
 
+
| width="90%" | Label Color
<span style="font-weight: normal;"><u>Radius %</u></span>
+
|-
 
+
| colspan="2" | Color for the component label text.&nbsp;
This property is of type ''Signed integer'' and can be referenced with the variable name ''arc_radius''.
+
|-
 
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
Radius of the arc line as a percentage of the component's shortest dimension.
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Arc
 
+
|-
<span style="font-weight: normal;"><u>Start Angle</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
This property is of type ''Signed integer'' and can be referenced with the variable name ''arc_start''.
+
| width="90%" | Radius %
 
+
|-
Start angle of the sweep, where the minimum value will appear.
+
| colspan="2" | Radius of the arc line as a percentage of the component's shortest dimension.&nbsp;
 
+
|-
Measured in degrees, anti-clockwise from the positive X-axis.
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
+
| width="90%" | Start Angle
<span style="font-weight: normal;"><u>Sweep</u></span>
+
|-
 
+
| colspan="2" | Start angle of the sweep, where the minimum value will appear. Measured in degrees, anti-clockwise from the positive X-axis.&nbsp;
This property is of type ''Signed integer'' and can be referenced with the variable name ''arc_sweep''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
The number of degrees between the minimum value and the maximum value.
+
| width="90%" | Sweep
 
+
|-
<span style="font-weight: normal;"><u>Thickness</u></span>
+
| colspan="2" | The number of degrees between the minimum value and the maximum value.&nbsp;
 
+
|-
This property is of type ''Floating point'' and can be referenced with the variable name ''arc_thick''.
+
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
+
| width="90%" | Thickness
Thickness of the arc line.
+
|-
 
+
| colspan="2" | Thickness of the arc line.&nbsp;
<span style="font-weight: normal;"><u>Show</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
This property is of type ''True or false'' and can be referenced with the variable name ''show_arc''.
+
| width="90%" | Show
 
+
|-
Whether to show or hide the arc.
+
| colspan="2" | Whether to show or hide the arc.&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Divisions</u></span>
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Marks
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.
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
+
| width="90%" | Divisions
<span style="font-weight: normal;"><u>Radius %</u></span>
+
|-
 
+
| colspan="2" | Number of main divisions around the scale - these divisions can be numbered.&nbsp;
This property is of type ''Signed integer'' and can be referenced with the variable name ''marks_radius''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
Radius of the division ends - they are drawn from here to their intersection with the arc.
+
| width="90%" | Radius %
 
+
|-
% of the component size.
+
| colspan="2" | Radius of the division ends - they are drawn from here to their intersection with the arc. % of the component size.&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Thickness</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
+
| width="90%" | Thickness
This property is of type ''Floating point'' and can be referenced with the variable name ''divs_thick''.
+
|-
 
+
| colspan="2" | Thickness of main (numbered) division lines.&nbsp;
Thickness of main (numbered) division lines.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
<span style="font-weight: normal;"><u>Subdivisions</u></span>
+
| width="90%" | Subdivisions
 
+
|-
This property is of type ''Signed integer'' and can be referenced with the variable name ''marks_subdiv''.
+
| colspan="2" | Number of smaller divisions between each main division.  Set to zero if not required.&nbsp;
 
+
|-
Number of smaller divisions between each main division.  Set to zero if not required.
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
+
| width="90%" | Subs Radius %
<span style="font-weight: normal;"><u>Subs Radius %</u></span>
+
|-
 
+
| colspan="2" | Radius of the small division ends. They are drawn from here to their intersection with the arc. % of component size.&nbsp;
This property is of type ''Signed integer'' and can be referenced with the variable name ''subdiv_radius''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
Radius of the small division ends.  They are drawn from here to their intersection with the arc.
+
| width="90%" | Subs Thickness
 
+
|-
% of component size.
+
| colspan="2" | Thickness of sub-division lines.&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Subs Thickness</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
+
| width="90%" | Show
This property is of type ''Floating point'' and can be referenced with the variable name ''subs_thick''.
+
|-
 
+
| colspan="2" | Whether to show or hide the division markings.&nbsp;
Thickness of sub-division lines.
+
|-
 
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
<span style="font-weight: normal;"><u>Show</u></span>
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Numbers
 
+
|-
This property is of type ''True or false'' and can be referenced with the variable name ''show_marks''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
Whether to show or hide the division markings.
+
| width="90%" | Maximum
 
+
|-
<span style="font-weight: normal;"><u>Maximum</u></span>
+
| colspan="2" | Maximum value to show on the display.&nbsp;
 
+
|-
This property is of type ''Floating point'' and can be referenced with the variable name ''val_max''.
+
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
+
| width="90%" | Minimum
Maximum value to show on the display.
+
|-
 
+
| colspan="2" | Minimum value to show on the display.&nbsp;
<span style="font-weight: normal;"><u>Minimum</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
This property is of type ''Floating point'' and can be referenced with the variable name ''val_min''.
+
| width="90%" | Decimals
 
+
|-
Minimum value to show on the display.
+
| colspan="2" | Number of decimal places to show on the number values.&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Decimals</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
+
| width="90%" | Radius %
This property is of type ''Signed integer'' and can be referenced with the variable name ''dec_places''.
+
|-
 
+
| colspan="2" | Radius from the centre to place the number values. % of component size.&nbsp;
Number of decimal places to show on the number values.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
<span style="font-weight: normal;"><u>Radius %</u></span>
+
| width="90%" | Text Size %
 
+
|-
This property is of type ''Signed integer'' and can be referenced with the variable name ''num_radius''.
+
| colspan="2" | Height of number text - % of component size.&nbsp;
 
+
|-
Radius from the centre to place the number values.
+
| width="10%" align="center" | [[File:Fc9-type-3-icon.png]]
 
+
| width="90%" | Font
% of component size.
+
|-
 
+
| colspan="2" | Font for the number values.&nbsp;
<span style="font-weight: normal;"><u>Text Size %</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
This property is of type ''Signed integer'' and can be referenced with the variable name ''num_size''.
+
| width="90%" | Show
 
+
|-
Height of number text - % of component size.
+
| colspan="2" | Show or hide the number values.&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Font</u></span>
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Label
This property is of type ''Font picker'' and can be referenced with the variable name ''num_font''.
+
|-
 
+
|-
Font for the number values.
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
+
| width="90%" | Text
<span style="font-weight: normal;"><u>Show</u></span>
+
|-
 
+
| colspan="2" | A text label to help identify the display.&nbsp;
This property is of type ''True or false'' and can be referenced with the variable name ''show_numbers''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
Show or hide the number values.
+
| width="90%" | Radius %
 
+
|-
<span style="font-weight: normal;"><u>Text</u></span>
+
| colspan="2" | Radius to place the label - % of component size.&nbsp;
 
+
|-
This property is of type ''Line of text'' and can be referenced with the variable name ''label_text''.
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
+
| width="90%" | Angle
A text label to help identify the display.
+
|-
 
+
| colspan="2" | Angle at which to place the label - degrees anti-clockwise from the positive X-axis.&nbsp;
<span style="font-weight: normal;"><u>Radius %</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
This property is of type ''Signed integer'' and can be referenced with the variable name ''label_radius''.
+
| width="90%" | Text Size %
 
+
|-
Radius to place the label - % of component size.
+
| colspan="2" | Height of the label font - % of component size.&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Angle</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-3-icon.png]]
 
+
| width="90%" | Font
This property is of type ''Signed integer'' and can be referenced with the variable name ''label_angle''.
+
|-
 
+
| colspan="2" | Font for the text label.&nbsp;
Angle at which to place the label - degrees anti-clockwise from the positive X-axis.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
<span style="font-weight: normal;"><u>Text Size %</u></span>
+
| width="90%" | Show
 
+
|-
This property is of type ''Signed integer'' and can be referenced with the variable name ''label_size''.
+
| colspan="2" | Show or hide the text label.&nbsp;
 
+
|-
Height of the label font - % of component size.
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Buttons
<span style="font-weight: normal;"><u>Font</u></span>
+
|-
 
+
|-
This property is of type ''Font picker'' and can be referenced with the variable name ''label_font''.
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
+
| width="90%" | Show Buttons
Font for the text label.
+
|-
 
+
| colspan="2" | Controls if the adjustment buttons are shown on the scale arc or not.&nbsp;
<span style="font-weight: normal;"><u>Show</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
This property is of type ''True or false'' and can be referenced with the variable name ''show_label''.
+
| width="90%" | Adjustment Value
 
+
|-
Show or hide the text label.
+
| colspan="2" | Sets the button adjustment value, will round the value to the nearest whole adjustment. For example with an adjustment of 1,0 the adjustment buttons will jump to the next whole number.&nbsp;
 +
|}

Latest revision as of 13:12, 7 February 2023

Author Matrix Ltd
Version 1.2
Category Advanced Shapes


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.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_Scale_Arc.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_Scale_Arc.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples






Macro reference

GetValue

Fc9-comp-macro.png 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. 
Fc9-f32-icon.png - FLOAT Return


SetLabel

Fc9-comp-macro.png SetLabel
Set the label text for the scale 
Fc9-string-icon.png - STRING Label
Text to display.as the component label. 
Fc9-void-icon.png - VOID Return


SetRange

Fc9-comp-macro.png SetRange
Set the minimum and maximum values of the scale 
Fc9-f32-icon.png - FLOAT Minimum
Minimum value for the scale 
Fc9-f32-icon.png - FLOAT Maximum
Maximum value for the scale 
Fc9-void-icon.png - VOID Return


SetValue

Fc9-comp-macro.png SetValue
Set the pointer to the given value on the scale. Returns the angle required to point at the given value. 
Fc9-f32-icon.png - FLOAT Value
The value on the scale to move the pointer to. 
Fc9-f32-icon.png - FLOAT Return


Property reference

Fc9-prop-icon.png Properties
Fc9-type-17-icon.png Pointer
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. 
Fc9-type-17-icon.png 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. 
Fc9-type-16-icon.png Function
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. 
Fc9-conn-icon.png Style
Fc9-type-16-icon.png Canvas Shape
Shape of the plane on which to draw the scale.  
Fc9-type-14-icon.png 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. 
Fc9-type-2-icon.png BG Color
Color of the scale background. 
Fc9-type-1-icon.png Positive Color
Color for arc and divisions for negative values. 
Fc9-type-1-icon.png Negative Color
Color for the arc and divisions for positive values. 
Fc9-type-1-icon.png Label Color
Color for the component label text. 
Fc9-conn-icon.png Arc
Fc9-type-14-icon.png Radius %
Radius of the arc line as a percentage of the component's shortest dimension. 
Fc9-type-14-icon.png Start Angle
Start angle of the sweep, where the minimum value will appear. Measured in degrees, anti-clockwise from the positive X-axis. 
Fc9-type-14-icon.png Sweep
The number of degrees between the minimum value and the maximum value. 
Fc9-type-15-icon.png Thickness
Thickness of the arc line. 
Fc9-type-7-icon.png Show
Whether to show or hide the arc. 
Fc9-conn-icon.png Marks
Fc9-type-14-icon.png Divisions
Number of main divisions around the scale - these divisions can be numbered. 
Fc9-type-14-icon.png Radius %
Radius of the division ends - they are drawn from here to their intersection with the arc. % of the component size. 
Fc9-type-15-icon.png Thickness
Thickness of main (numbered) division lines. 
Fc9-type-14-icon.png Subdivisions
Number of smaller divisions between each main division. Set to zero if not required. 
Fc9-type-14-icon.png Subs Radius %
Radius of the small division ends. They are drawn from here to their intersection with the arc. % of component size. 
Fc9-type-15-icon.png Subs Thickness
Thickness of sub-division lines. 
Fc9-type-7-icon.png Show
Whether to show or hide the division markings. 
Fc9-conn-icon.png Numbers
Fc9-type-15-icon.png Maximum
Maximum value to show on the display. 
Fc9-type-15-icon.png Minimum
Minimum value to show on the display. 
Fc9-type-14-icon.png Decimals
Number of decimal places to show on the number values. 
Fc9-type-14-icon.png Radius %
Radius from the centre to place the number values. % of component size. 
Fc9-type-14-icon.png Text Size %
Height of number text - % of component size. 
Fc9-type-3-icon.png Font
Font for the number values. 
Fc9-type-7-icon.png Show
Show or hide the number values. 
Fc9-conn-icon.png Label
Fc9-type-10-icon.png Text
A text label to help identify the display. 
Fc9-type-14-icon.png Radius %
Radius to place the label - % of component size. 
Fc9-type-14-icon.png Angle
Angle at which to place the label - degrees anti-clockwise from the positive X-axis. 
Fc9-type-14-icon.png Text Size %
Height of the label font - % of component size. 
Fc9-type-3-icon.png Font
Font for the text label. 
Fc9-type-7-icon.png Show
Show or hide the text label. 
Fc9-conn-icon.png Buttons
Fc9-type-7-icon.png Show Buttons
Controls if the adjustment buttons are shown on the scale arc or not. 
Fc9-type-15-icon.png Adjustment Value
Sets the button adjustment value, will round the value to the nearest whole adjustment. For example with an adjustment of 1,0 the adjustment buttons will jump to the next whole number.