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

From Flowcode Help
Jump to navigationJump to search
(XML import - Pre 8.0 release)
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 Linear Template component==
 +
A base component for drawing scales on horizontal or vertical strips. Can be used to simplify the building of rulers, meters and slider controls.  Mouse handling is built in for easy construction of interactive controls.
  
==[[File:Component Icon 34671299_61e7_40d8_aac1_e33c93759d73.png|Image]] Scale Linear Template component==
+
==Detailed description==
A base component for drawing scales on horizontal or vertical strips.
 
Can be used to simplify the building of rulers, meters and slider controls.  Mouse handling
 
is built in for easy construction of interactive controls.
 
  
This component can be used as a base to create ''child'' components
+
''No detailed description exists yet for this component''
  
The following components all inherit the traits of Scale Linear Template:
+
==Examples==
  
{| class="wikitable" width="50%"
 
|+|-
 
|[[File:Component Icon c7af6f97_a9d6_45d0_a7d2_48d85dbef664.png|Image]] Dash Scale Horizontal
 
|Horizontal based slider with a user defined scale, typically used on in SCADA based solution
 
|-
 
|[[File:Component Icon f51b5e55_6a64_49ad_b79d_2b57db0cd54b.png|Image]] Dash Scale Vertical
 
|Vertical based slider with a user defined scale, typically used on in SCADA based solution
 
|}
 
  
==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}}
Line 39: Line 27:
 
==Downloadable macro reference==
 
==Downloadable macro reference==
  
''This component does not contain any downloadable macros''
+
{| 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 value from the scale. Will be either the most recent value set by "SetValue", or, if set to "Control" mode, the latest mouse clicked value. 
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
==Simulation macro reference==
 
  
===<span style="font-weight: normal;"><u><tt>GetValue</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Get the current value from the scale.
+
|-
 +
| 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 value for the scale. If a pointer object is defined, it will move to point at the new value.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:]] -
 +
| width="90%" | Value
 +
|-
 +
| colspan="2" | Value to set - will be constrained to the minumum-maximum range.&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''
 +
|}
  
Will be either the most recent value set by "SetValue", or, if set to "Control" mode, the latest mouse clicked value.
 
  
'''Parameters'''
+
{| 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 text of the component's label.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Text
 +
|-
 +
| colspan="2" | New text to set.&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''
 +
|}
  
:''This macro has no parameters''
 
  
 +
{| 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 new maximum and minimum values for the scale.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:]] -
 +
| width="90%" | Minimum
 +
|-
 +
| colspan="2" | The minimum value of the scale (Bottom of the component)&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:]] -
 +
| width="90%" | Maximum
 +
|-
 +
| colspan="2" | The maximum value of the scale (Top of the component)&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''
 +
|}
  
'''Return value'''
 
  
:[[Variable Types|FLOAT]]
+
{| 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:]] -
 +
| width="90%" | Minimum
 +
|-
 +
| colspan="2" | Minimum value for the scale&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:]] -
 +
| 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''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>SetValue</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Set the value for the scale. If a pointer object is defined, it will move to point at the new value.
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CTransInit'''
 +
|-
 +
| colspan="2" | Initialises the I2C Transaction mode with the 7-bit device address&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | DeviceAddress
 +
|-
 +
| colspan="2" | 7-bit Device Address&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Baud
 +
|-
 +
| colspan="2" | 0=100KHz, 1=400KHz, 2=1MHz&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''
 +
|}
  
'''Parameters'''
 
  
:[[Variable Types|FLOAT]] ''Value''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
::Value to set - will be constrained to the minumum-maximum range.
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IOSetOutputPin'''
 +
|-
 +
| colspan="2" | Sets the selected digital pin to an output and assigns the output state.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Pin
 +
|-
 +
| colspan="2" | Range: 0-29&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:]] -
 +
| width="90%" | State
 +
|-
 +
| colspan="2" | Range: 0-1&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''
 +
|}
  
  
'''Return value'''
+
{| 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;" | '''UARTReceive'''
 +
|-
 +
| colspan="2" | Receives a data byte from the UART. Recommend calling the UARTCheckRx function first to ensure data is available.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Channel Index: Range 0 - UART Bus Count - 1&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:''This call does not return a value''
 
  
 +
{| 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;" | '''SPIInitialise'''
 +
|-
 +
| colspan="2" | Initialsie the SPI module ready for communications&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1&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><tt>SetLabel</tt></u></span>===
 
Set the text of the component's label.
 
  
'''Parameters'''
+
{| 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;" | '''I2CSend'''
 +
|-
 +
| colspan="2" | Transmit a byte using the I2C bus&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | DataOut
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|STRING]] ''Text''
 
::New text to set.
 
  
 +
{| 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;" | '''UARTSend'''
 +
|-
 +
| colspan="2" | Send a byte via the UART module&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Channel Index: Range 0 - UART Bus Count - 1&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | Data Byte to send. Range: 0-255&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''
 +
|}
  
'''Return value'''
 
  
:''This call does not return a value''
+
{| 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;" | '''PWMSetPrescaler'''
 +
|-
 +
| colspan="2" | Sets the prescaler for the PWM output&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Prescaler
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Period
 +
|-
 +
| colspan="2" | &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><tt>SetRange</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Set new maximum and minimum values for the scale.
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMEnable'''
 +
|-
 +
| colspan="2" | Enable a PWM output&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Range: 0-1&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''
 +
|}
  
'''Parameters'''
 
  
:[[Variable Types|FLOAT]] ''Minimum''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
::The minimum value of the scale (Bottom of the component)
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 +
|-
 +
| colspan="2" | Initialise the comms to the Arduino board ready for commands to be sent.&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''
 +
|}
  
:[[Variable Types|FLOAT]] ''Maximum''
 
::The maximum value of the scale (Top of the component)
 
  
 +
{| 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;" | '''IOSetOutputPin'''
 +
|-
 +
| colspan="2" | Sets the selected digital pin to an output and assigns the output state.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Pin
 +
|-
 +
| colspan="2" | Range: 0-29&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:]] -
 +
| width="90%" | State
 +
|-
 +
| colspan="2" | Range: 0-1&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''
 +
|}
  
'''Return value'''
 
  
:''This call does not return a value''
+
{| 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;" | '''UARTReceive'''
 +
|-
 +
| colspan="2" | Receives a data byte from the UART. Recommend calling the UARTCheckRx function first to ensure data is available.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Channel Index: Range 0 - UART Bus Count - 1&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
 +
{| 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;" | '''ADCSampleAverage10'''
 +
|-
 +
| colspan="2" | Reads the voltage present on an Analog pin as an 10-bit value range 0-1023. Performs the selected number of samples with the selected time in microseconds in between samples&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | ADCChannel
 +
|-
 +
| colspan="2" | Range: 0, 3-7&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | SampleCount
 +
|-
 +
| colspan="2" | Range: 1- 100&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | SampleDelay
 +
|-
 +
| colspan="2" | Delay in us between each sample&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
==Property reference==
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
<span style="font-weight: normal;"><u>Pointer</u></span>
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OneWireScanBus'''
 +
|-
 +
| colspan="2" | Scans the one wire bus to detect all connected devices. Returns the number of one wire devices found.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
This property is of type ''Panel object'' and can be referenced with the variable name ''target_object''.
 
  
Sets an object to act as the pointer for the scale.
+
{| 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;" | '''SPIInitialise'''
 +
|-
 +
| colspan="2" | Initialsie the SPI module ready for communications&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1&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''
 +
|}
  
If in 'Display' mode, the pointer will move to show the incoming "SetValue" numbers.
 
  
In "Control" mode, it will act as an object for setting the value using mouse clicks/drags.
+
{| 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;" | '''OneWireReceiveByte'''
 +
|-
 +
| colspan="2" | Receives a byte from the one wire bus a bit at a time&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
<span style="font-weight: normal;"><u>Track</u></span>
 
  
This property is of type ''Panel object'' and can be referenced with the variable name ''track_object''.
+
{| 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;" | '''I2CSend'''
 +
|-
 +
| colspan="2" | Transmit a byte using the I2C bus&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | DataOut
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
An object to represent a 'track' parallel to the scale upon which the moving part travels.
 
  
If the scale is resized or moved, the 'track' object will also be scaled or moved.
+
{| 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;" | '''UARTSend'''
 +
|-
 +
| colspan="2" | Send a byte via the UART module&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Channel Index: Range 0 - UART Bus Count - 1&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | Data Byte to send. Range: 0-255&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''
 +
|}
  
For example, the 'track' object could be a simple black rectangle to represent the 'slot' in which
 
  
a slider control moves.
+
{| 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;" | '''OneWireGetDeviceCount'''
 +
|-
 +
| colspan="2" | Returns the number of devices found by the last ScanBus operation.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
<span style="font-weight: normal;"><u>Orientation</u></span>
 
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''orientation''.
+
{| 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;" | '''PWMSetPrescaler'''
 +
|-
 +
| colspan="2" | Sets the prescaler for the PWM output&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Range: 0 - 11&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Prescaler
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Period
 +
|-
 +
| colspan="2" | &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''
 +
|}
  
Whether the scale and/or motion should be along the X-axis (horizontal) or Y-axis (vertical)
 
  
<span style="font-weight: normal;"><u>Function</u></span>
+
{| 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;" | '''PWMEnable'''
 +
|-
 +
| colspan="2" | Enable a PWM output&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Range: 0-11&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''
 +
|}
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''is_slider''.
 
  
Set the mode of the component...
+
{| 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;" | '''ADCSampleArray10'''
 +
|-
 +
| colspan="2" | Reads the voltage present on an Analog pin as an 10-bit value range 0-1023 Performs the selected number of samples with the selected time in microseconds in between samples and returns each sample in a single packet&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | ADCChannel
 +
|-
 +
| colspan="2" | Range: 0, 3-7&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | SampleCount
 +
|-
 +
| colspan="2" | Range: 1- 32&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | SampleDelay
 +
|-
 +
| colspan="2" | Delay in us between each sample&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Samples
 +
|-
 +
| colspan="2" | 10-bit samples returned from the function&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''
 +
|}
  
Display - the pointer object moves only when a value is set using the 'SetValue' macro.
 
  
Control - the pointer can be moved using the mouse to set a new value, which can then be read using the
+
{| 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;" | '''ADCSampleAverage8'''
 +
|-
 +
| colspan="2" | Reads the voltage present on an Analog pin as an 8-bit value range 0-255 Performs the selected number of samples with the selected time in microseconds in between samples&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | ADCChannel
 +
|-
 +
| colspan="2" | Range: 0, 3-7&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | SampleCount
 +
|-
 +
| colspan="2" | Range: 1- 100&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | SampleDelay
 +
|-
 +
| colspan="2" | Delay in us between each sample&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'GetValue' macro.
 
  
<span style="font-weight: normal;"><u>Resolution</u></span>
+
{| 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;" | '''Initialise'''
 +
|-
 +
| colspan="2" | Initialise the comms to the Arduino board ready for commands to be sent.&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''
 +
|}
  
This property is of type ''Signed integer'' and can be referenced with the variable name ''resolution''.
 
  
Determines the amount of detail in the scale graphics - larger values will require more memory
 
  
and/or loading time etc.
 
  
<span style="font-weight: normal;"><u>BG Color</u></span>
+
==Property reference==
  
This property is of type ''Color picker with transparency'' and can be referenced with the variable name ''bg_color''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
Colour of the background object.
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
<span style="font-weight: normal;"><u>Positive Color</u></span>
+
|-
 
+
|-
This property is of type ''Color picker'' and can be referenced with the variable name ''ink_color''.
+
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
+
| width="90%" | Pointer
Markings colour for positive scale values.
+
|-
 
+
| colspan="2" | Sets an object to act as the pointer for the scale. If in 'Display' mode, the pointer will move to show the incoming "SetValue" numbers. In "Control" mode, it will act as an object for setting the value using mouse clicks/drags.&nbsp;
<span style="font-weight: normal;"><u>Negative Color</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
This property is of type ''Color picker'' and can be referenced with the variable name ''neg_color''.
+
| width="90%" | Track
 
+
|-
Markings colour for negative values.
+
| colspan="2" | An object to represent a 'track' parallel to the scale upon which the moving part travels. If the scale is resized or moved, the 'track' object will also be scaled or moved. For example, the 'track' object could be a simple black rectangle to represent the 'slot' in which a slider control moves.&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Label Color</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Orientation
This property is of type ''Color picker'' and can be referenced with the variable name ''label_color''.
+
|-
 
+
| colspan="2" | Whether the scale and/or motion should be along the X-axis (horizontal) or Y-axis (vertical)&nbsp;
Color for the text label.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
<span style="font-weight: normal;"><u>Offset %</u></span>
+
| width="90%" | Function
 
+
|-
This property is of type ''Signed integer'' and can be referenced with the variable name ''line_offset''.
+
| colspan="2" | Set the mode of the component... Display - the pointer object moves only when a value is set using the 'SetValue' macro. Control - the pointer can be moved using the mouse to set a new value, which can then be read using the 'GetValue' macro.&nbsp;
 
+
|-
Distance of the main line from the left or bottom of the component. % of component size.
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
+
| width="90%" | Resolution
<span style="font-weight: normal;"><u>Start %</u></span>
+
|-
 
+
| colspan="2" | Determines the amount of detail in the scale graphics - larger values will require more memory and/or loading time etc.&nbsp;
This property is of type ''Signed integer'' and can be referenced with the variable name ''line_start''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-2-icon.png]]
Start position of the scale from the left/bottom of the component. % of component size.
+
| width="90%" | BG Color
 
+
|-
<span style="font-weight: normal;"><u>End %</u></span>
+
| colspan="2" | Colour of the background object.&nbsp;
 
+
|-
This property is of type ''Signed integer'' and can be referenced with the variable name ''line_end''.
+
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
 
+
| width="90%" | Positive Color
End position of the scale from the left/bottom of the component. % of component size.
+
|-
 
+
| colspan="2" | Markings colour for positive scale values.&nbsp;
<span style="font-weight: normal;"><u>Thickness</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
This property is of type ''Floating point'' and can be referenced with the variable name ''line_thick''.
+
| width="90%" | Negative Color
 
+
|-
Thickness of the main scale line.
+
| colspan="2" | Markings colour for negative values.&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Show</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
 
+
| width="90%" | Label Color
This property is of type ''True or false'' and can be referenced with the variable name ''show_line''.
+
|-
 
+
| colspan="2" | Color for the text label.&nbsp;
Whether to show or hide the main scale line.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
<span style="font-weight: normal;"><u>Divisions</u></span>
+
| width="90%" | Offset %
 
+
|-
This property is of type ''Signed integer'' and can be referenced with the variable name ''marks_count''.
+
| colspan="2" | Distance of the main line from the left or bottom of the component. % of component size.&nbsp;
 
+
|-
Number of major divisions of the scale - these can be numbered.
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
+
| width="90%" | Start %
<span style="font-weight: normal;"><u>Offset %</u></span>
+
|-
 
+
| colspan="2" | Start position of the scale from the left/bottom of the component% of component size.&nbsp;
This property is of type ''Signed integer'' and can be referenced with the variable name ''marks_offset''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
Position of the division lines across the scale - % of component size,.
+
| width="90%" | End %
 
+
|-
<span style="font-weight: normal;"><u>Thickness</u></span>
+
| colspan="2" | End position of the scale from the left/bottom of the component.  % of component size.&nbsp;
 
+
|-
This property is of type ''Floating point'' and can be referenced with the variable name ''divs_thick''.
+
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
+
| width="90%" | Thickness
Thickness of the division lines.
+
|-
 
+
| colspan="2" | Thickness of the main scale line.&nbsp;
<span style="font-weight: normal;"><u>Subdivisions</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 ''marks_subdiv''.
+
| width="90%" | Show
 
+
|-
Number of smaller divsions between the numbered onesSet to zero if not required.
+
| colspan="2" | Whether to show or hide the main scale line.&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Subs Offset</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
+
| width="90%" | Divisions
This property is of type ''Signed integer'' and can be referenced with the variable name ''subdiv_offset''.
+
|-
 
+
| colspan="2" | Number of major divisions of the scale - these can be numbered.&nbsp;
Position of the sub-division line ends.  % of width across the component.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
<span style="font-weight: normal;"><u>Subs Thickness</u></span>
+
| width="90%" | Offset %
 
+
|-
This property is of type ''Floating point'' and can be referenced with the variable name ''subs_thick''.
+
| colspan="2" | Position of the division lines across the scale - % of component size,.&nbsp;
 
+
|-
Thickness of the sub-division lines..
+
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
+
| width="90%" | Thickness
<span style="font-weight: normal;"><u>Show</u></span>
+
|-
 
+
| colspan="2" | Thickness of the division lines.&nbsp;
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-14-icon.png]]
Whether to show or hide the divisions and sub-divisions.
+
| width="90%" | Subdivisions
 
+
|-
<span style="font-weight: normal;"><u>Maximum</u></span>
+
| colspan="2" | Number of smaller divsions between the numbered ones. Set to zero if not required.&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-14-icon.png]]
 
+
| width="90%" | Subs Offset
Maximum number to show on the scale.
+
|-
 
+
| colspan="2" | Position of the sub-division line ends.  % of width across the component.&nbsp;
<span style="font-weight: normal;"><u>Minimum</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
This property is of type ''Floating point'' and can be referenced with the variable name ''val_min''.
+
| width="90%" | Subs Thickness
 
+
|-
Minimum number to show on the scale.
+
| colspan="2" | Thickness of the sub-division lines..&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Decimals</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
+
| width="90%" | Show
This property is of type ''Signed integer'' and can be referenced with the variable name ''dec_places''.
+
|-
 
+
| colspan="2" | Whether to show or hide the divisions and sub-divisions.&nbsp;
Number of decimal places to show on the numbers.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
<span style="font-weight: normal;"><u>Offset %</u></span>
+
| width="90%" | Maximum
 
+
|-
This property is of type ''Signed integer'' and can be referenced with the variable name ''num_offset''.
+
| colspan="2" | Maximum number to show on the scale.&nbsp;
 
+
|-
Distance acrross the scale width to show the numbers.  % of component size.
+
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
+
| width="90%" | Minimum
<span style="font-weight: normal;"><u>Text Size %</u></span>
+
|-
 
+
| colspan="2" | Minimum number to show on the scale.&nbsp;
This property is of type ''Signed integer'' and can be referenced with the variable name ''num_size''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
Text height of the scale numbers.  % of component size.
+
| width="90%" | Decimals
 
+
|-
<span style="font-weight: normal;"><u>Font</u></span>
+
| colspan="2" | Number of decimal places to show on the numbers.&nbsp;
 
+
|-
This property is of type ''Font picker'' and can be referenced with the variable name ''num_font''.
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
+
| width="90%" | Offset %
Font for the scale numbers.
+
|-
 
+
| colspan="2" | Distance acrross the scale width to show the numbers.  % of component size.&nbsp;
<span style="font-weight: normal;"><u>Show</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
This property is of type ''True or false'' and can be referenced with the variable name ''show_numbers''.
+
| width="90%" | Text Size %
 
+
|-
Whether to show or hide the scale numbers.
+
| colspan="2" | Text height of the scale numbers.  % of component size.&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Text</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-3-icon.png]]
 
+
| width="90%" | Font
This property is of type ''Line of text'' and can be referenced with the variable name ''label_text''.
+
|-
 
+
| colspan="2" | Font for the scale numbers.&nbsp;
Text label for the component to aid identification.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
<span style="font-weight: normal;"><u>Offset X %</u></span>
+
| width="90%" | Show
 
+
|-
This property is of type ''Signed integer'' and can be referenced with the variable name ''label_X''.
+
| colspan="2" | Whether to show or hide the scale numbers.&nbsp;
 
+
|-
X - position of the label.  % of Width.
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
+
| width="90%" | Text
<span style="font-weight: normal;"><u>Offset Y %</u></span>
+
|-
 
+
| colspan="2" | Text label for the component to aid identification.&nbsp;
This property is of type ''Signed integer'' and can be referenced with the variable name ''label_Y''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
Y position of label.  % of height.
+
| width="90%" | Offset X %
 
+
|-
<span style="font-weight: normal;"><u>Text Size %</u></span>
+
| colspan="2" | X - position of the label.  % of Width.&nbsp;
 
+
|-
This property is of type ''Signed integer'' and can be referenced with the variable name ''label_size''.
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
+
| width="90%" | Offset Y %
Text size of label.  % of component size.
+
|-
 
+
| colspan="2" | Y position of label.  % of height.&nbsp;
<span style="font-weight: normal;"><u>Font</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
This property is of type ''Font picker'' and can be referenced with the variable name ''label_font''.
+
| width="90%" | Text Size %
 
+
|-
Font for the component label.
+
| colspan="2" | Text size of label.  % of component size.&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Show</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-3-icon.png]]
 
+
| width="90%" | Font
This property is of type ''True or false'' and can be referenced with the variable name ''show_label''.
+
|-
 
+
| colspan="2" | Font for the component label.&nbsp;
Whether to show or hide the text label.
+
|-
 +
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 +
| width="90%" | Show
 +
|-
 +
| colspan="2" | Whether to show or hide the text label.&nbsp;
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
 +
|-
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''  
 +
|-
 +
|}

Revision as of 20:45, 16 November 2021

Author Matrix Ltd
Version 1.2
Category Advanced Shapes


Scale Linear Template component

A base component for drawing scales on horizontal or vertical strips. Can be used to simplify the building of rulers, meters and slider controls. Mouse handling is built in for easy construction of interactive controls.

Detailed description

No detailed description exists yet for this component

Examples

Simple example showing how to use the simulation dial components as a meter display for use in monitoring type applications. FC6 Icon.png Meters

Downloadable macro reference

Fc9-comp-macro.png GetValue
Get the current value from the scale. Will be either the most recent value set by "SetValue", or, if set to "Control" mode, the latest mouse clicked value. 
[[File:]] - Return


Fc9-comp-macro.png SetValue
Set the value for the scale. If a pointer object is defined, it will move to point at the new value. 
[[File:]] - Value
Value to set - will be constrained to the minumum-maximum range. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetLabel
Set the text of the component's label. 
Fc9-string-icon.png - STRING Text
New text to set. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetRange
Set new maximum and minimum values for the scale. 
[[File:]] - Minimum
The minimum value of the scale (Bottom of the component) 
[[File:]] - Maximum
The maximum value of the scale (Top of the component) 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetRange
Set the minimum and maximum values of the scale 
[[File:]] - Minimum
Minimum value for the scale 
[[File:]] - Maximum
Maximum value for the scale 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png I2CTransInit
Initialises the I2C Transaction mode with the 7-bit device address 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-u8-icon.png - BYTE DeviceAddress
7-bit Device Address 
Fc9-u8-icon.png - BYTE Baud
0=100KHz, 1=400KHz, 2=1MHz 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png IOSetOutputPin
Sets the selected digital pin to an output and assigns the output state. 
Fc9-u8-icon.png - BYTE Pin
Range: 0-29 
[[File:]] - State
Range: 0-1 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png UARTReceive
Receives a data byte from the UART. Recommend calling the UARTCheckRx function first to ensure data is available. 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - UART Bus Count - 1 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SPIInitialise
Initialsie the SPI module ready for communications 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - SPI Bus Count - 1 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png I2CSend
Transmit a byte using the I2C bus 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-u8-icon.png - BYTE DataOut
 
[[File:]] - Return


Fc9-comp-macro.png UARTSend
Send a byte via the UART module 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - UART Bus Count - 1 
Fc9-u8-icon.png - BYTE Data
Data Byte to send. Range: 0-255 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png PWMSetPrescaler
Sets the prescaler for the PWM output 
Fc9-u8-icon.png - BYTE Channel
 
Fc9-u8-icon.png - BYTE Prescaler
 
Fc9-u8-icon.png - BYTE Period
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png PWMEnable
Enable a PWM output 
Fc9-u8-icon.png - BYTE Channel
Range: 0-1 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
Initialise the comms to the Arduino board ready for commands to be sent. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png IOSetOutputPin
Sets the selected digital pin to an output and assigns the output state. 
Fc9-u8-icon.png - BYTE Pin
Range: 0-29 
[[File:]] - State
Range: 0-1 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png UARTReceive
Receives a data byte from the UART. Recommend calling the UARTCheckRx function first to ensure data is available. 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - UART Bus Count - 1 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png ADCSampleAverage10
Reads the voltage present on an Analog pin as an 10-bit value range 0-1023. Performs the selected number of samples with the selected time in microseconds in between samples 
Fc9-u8-icon.png - BYTE ADCChannel
Range: 0, 3-7 
Fc9-u8-icon.png - BYTE SampleCount
Range: 1- 100 
Fc9-u8-icon.png - BYTE SampleDelay
Delay in us between each sample 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png OneWireScanBus
Scans the one wire bus to detect all connected devices. Returns the number of one wire devices found. 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SPIInitialise
Initialsie the SPI module ready for communications 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - SPI Bus Count - 1 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png OneWireReceiveByte
Receives a byte from the one wire bus a bit at a time 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png I2CSend
Transmit a byte using the I2C bus 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-u8-icon.png - BYTE DataOut
 
[[File:]] - Return


Fc9-comp-macro.png UARTSend
Send a byte via the UART module 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - UART Bus Count - 1 
Fc9-u8-icon.png - BYTE Data
Data Byte to send. Range: 0-255 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png OneWireGetDeviceCount
Returns the number of devices found by the last ScanBus operation. 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png PWMSetPrescaler
Sets the prescaler for the PWM output 
Fc9-u8-icon.png - BYTE Channel
Range: 0 - 11 
Fc9-u8-icon.png - BYTE Prescaler
 
Fc9-u8-icon.png - BYTE Period
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png PWMEnable
Enable a PWM output 
Fc9-u8-icon.png - BYTE Channel
Range: 0-11 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ADCSampleArray10
Reads the voltage present on an Analog pin as an 10-bit value range 0-1023 Performs the selected number of samples with the selected time in microseconds in between samples and returns each sample in a single packet 
Fc9-u8-icon.png - BYTE ADCChannel
Range: 0, 3-7 
Fc9-u8-icon.png - BYTE SampleCount
Range: 1- 32 
Fc9-u16-icon.png - UINT SampleDelay
Delay in us between each sample 
Fc9-u16-icon.png - UINT Samples
10-bit samples returned from the function 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ADCSampleAverage8
Reads the voltage present on an Analog pin as an 8-bit value range 0-255 Performs the selected number of samples with the selected time in microseconds in between samples 
Fc9-u8-icon.png - BYTE ADCChannel
Range: 0, 3-7 
Fc9-u8-icon.png - BYTE SampleCount
Range: 1- 100 
Fc9-u8-icon.png - BYTE SampleDelay
Delay in us between each sample 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Initialise
Initialise the comms to the Arduino board ready for commands to be sent. 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-17-icon.png Pointer
Sets an object to act as the pointer for the scale. If in 'Display' mode, the pointer will move to show the incoming "SetValue" numbers. In "Control" mode, it will act as an object for setting the value using mouse clicks/drags. 
Fc9-type-17-icon.png Track
An object to represent a 'track' parallel to the scale upon which the moving part travels. If the scale is resized or moved, the 'track' object will also be scaled or moved. For example, the 'track' object could be a simple black rectangle to represent the 'slot' in which a slider control moves. 
Fc9-type-16-icon.png Orientation
Whether the scale and/or motion should be along the X-axis (horizontal) or Y-axis (vertical) 
Fc9-type-16-icon.png Function
Set the mode of the component... Display - the pointer object moves only when a value is set using the 'SetValue' macro. Control - the pointer can be moved using the mouse to set a new value, which can then be read using the 'GetValue' macro. 
Fc9-type-14-icon.png Resolution
Determines the amount of detail in the scale graphics - larger values will require more memory and/or loading time etc. 
Fc9-type-2-icon.png BG Color
Colour of the background object. 
Fc9-type-1-icon.png Positive Color
Markings colour for positive scale values. 
Fc9-type-1-icon.png Negative Color
Markings colour for negative values. 
Fc9-type-1-icon.png Label Color
Color for the text label. 
Fc9-type-14-icon.png Offset %
Distance of the main line from the left or bottom of the component. % of component size. 
Fc9-type-14-icon.png Start %
Start position of the scale from the left/bottom of the component. % of component size. 
Fc9-type-14-icon.png End %
End position of the scale from the left/bottom of the component. % of component size. 
Fc9-type-15-icon.png Thickness
Thickness of the main scale line. 
Fc9-type-7-icon.png Show
Whether to show or hide the main scale line. 
Fc9-type-14-icon.png Divisions
Number of major divisions of the scale - these can be numbered. 
Fc9-type-14-icon.png Offset %
Position of the division lines across the scale - % of component size,. 
Fc9-type-15-icon.png Thickness
Thickness of the division lines. 
Fc9-type-14-icon.png Subdivisions
Number of smaller divsions between the numbered ones. Set to zero if not required. 
Fc9-type-14-icon.png Subs Offset
Position of the sub-division line ends. % of width across the component. 
Fc9-type-15-icon.png Subs Thickness
Thickness of the sub-division lines.. 
Fc9-type-7-icon.png Show
Whether to show or hide the divisions and sub-divisions. 
Fc9-type-15-icon.png Maximum
Maximum number to show on the scale. 
Fc9-type-15-icon.png Minimum
Minimum number to show on the scale. 
Fc9-type-14-icon.png Decimals
Number of decimal places to show on the numbers. 
Fc9-type-14-icon.png Offset %
Distance acrross the scale width to show the numbers. % of component size. 
Fc9-type-14-icon.png Text Size %
Text height of the scale numbers. % of component size. 
Fc9-type-3-icon.png Font
Font for the scale numbers. 
Fc9-type-7-icon.png Show
Whether to show or hide the scale numbers. 
Fc9-type-10-icon.png Text
Text label for the component to aid identification. 
Fc9-type-14-icon.png Offset X %
X - position of the label. % of Width. 
Fc9-type-14-icon.png Offset Y %
Y position of label. % of height. 
Fc9-type-14-icon.png Text Size %
Text size of label. % of component size. 
Fc9-type-3-icon.png Font
Font for the component label. 
Fc9-type-7-icon.png Show
Whether to show or hide the text label. 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png Simulations