Difference between revisions of "Component: Simulation Switch Template (Controls)"
From Flowcode Help
Jump to navigationJump to searchLine 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
− | Please click here | + | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_sim_switch_base.fcfx FC_Comp_Source_sim_switch_base.fcfx] |
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
Line 40: | Line 42: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
Line 62: | Line 66: | ||
==Macro reference== | ==Macro reference== | ||
+ | |||
+ | {| 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;" | '''GetState''' | ||
+ | |- | ||
+ | | colspan="2" | Read the current state of the switch. Returns BOOL true when the switch is on, or BOOL false when off. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | 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;" | '''SetState''' | ||
+ | |- | ||
+ | | colspan="2" | Sets the current state of the switch. BOOL true when the switch is on, or BOOL false when off. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | SwitchState | ||
+ | |- | ||
+ | | colspan="2" | Sets the state of the switch | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==Property reference== | ||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties''' | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Operation | ||
+ | |- | ||
+ | | colspan="2" | Latching = Mouse click to turn on, click again to turn off. Momentary = Mouse click to turn on, release to turn off. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Send Event | ||
+ | |- | ||
+ | | colspan="2" | Determine when the component will send a User event to its parent. On Change - Whenever the switch state changes. On Click - Only when the mouse clicks the object. On Release - Only when the mouse is released over the object. Never - No events. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-17-icon.png]] | ||
+ | | width="90%" | Moving part | ||
+ | |- | ||
+ | | colspan="2" | Handle of a panel object that will be the moving part of the switch. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-17-icon.png]] | ||
+ | | width="90%" | Pivot object | ||
+ | |- | ||
+ | | colspan="2" | Object around which the moving part will rotate when rotation is selected as the movement tyoe. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Type | ||
+ | |- | ||
+ | | colspan="2" | Set whether the moving part will move linearly or by rotation. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Axis | ||
+ | |- | ||
+ | | colspan="2" | Axis along which the moving part will move (for push/slide) or around which it will rotate (rotary). | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-15-icon.png]] | ||
+ | | width="90%" | Movement | ||
+ | |- | ||
+ | | colspan="2" | Distance or angle by which the mioving part will move. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Show | ||
+ | |- | ||
+ | | colspan="2" | Decide what label to show... None - no labels are displayed Name - shows the component's name Property - shows a property value of the component (a field for the property name will appear below) | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Startup State | ||
+ | |- | ||
+ | | colspan="2" | Default state of the indicator when loading the project or starting the simulation runtime. | ||
+ | |}==Macro reference== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
Revision as of 15:18, 20 January 2023
Author | Matrix Ltd |
Version | 1.3 |
Category | Controls |
Contents
Simulation Switch Template component
A base for building switches that do not download to chip. Mouse interaction can send 'System.User' events with the following data... ID = The handle of the switch component sending the message Message = 1 (on) or 0 (off) Current state can also be read via simulation macros.
Component Source Code
Please click here to view the component source code (Beta): FC_Comp_Source_sim_switch_base.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
![]() |
GetState |
Read the current state of the switch. Returns BOOL true when the switch is on, or BOOL false when off. | |
![]() |
Return |
![]() |
SetState |
Sets the current state of the switch. BOOL true when the switch is on, or BOOL false when off. | |
![]() |
SwitchState |
Sets the state of the switch | |
![]() |
Return |
Property reference
==Macro reference==
![]() |
GetState |
Read the current state of the switch. Returns BOOL true when the switch is on, or BOOL false when off. | |
![]() |
Return |
![]() |
SetState |
Sets the current state of the switch. BOOL true when the switch is on, or BOOL false when off. | |
![]() |
SwitchState |
Sets the state of the switch | |
![]() |
Return |