Difference between revisions of "Component: Switch User Images (Switch)"
From Flowcode Help
Jump to navigationJump to search(9 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
|- | |- | ||
| width="20%" style="color:gray;" | Author | | width="20%" style="color:gray;" | Author | ||
− | | | + | | Matrix TSL |
|- | |- | ||
| width="20%" style="color:gray;" | Version | | width="20%" style="color:gray;" | Version | ||
− | | | + | | 6.0 |
|- | |- | ||
| width="20%" style="color:gray;" | Category | | width="20%" style="color:gray;" | Category | ||
Line 15: | Line 15: | ||
A simple digital push switch allowing latched and none latched operation. In embedded mode displays the connecting pin and pin status. The on and off states of the switch are shown using user supplied images allowing customised switches to be created. | A simple digital push switch allowing latched and none latched operation. In embedded mode displays the connecting pin and pin status. The on and off states of the switch are shown using user supplied images allowing customised switches to be created. | ||
− | == | + | ==Version information== |
− | + | Library Version, Component Version, Date, Author, Info | |
+ | 5, 5.0, 23-09-24, MW, Fixed a bug to make sure switch starts in the off position | ||
+ | 5, 5.0, 23-09-24, MW, Added option for simulation only | ||
+ | 5, 5.0, 23-09-24, MW, Fixed a bug preventing custom lable posistion from updating on the fly | ||
+ | 5, 5.0, 23-09-24, MW, Fixed connection lable so show correct polariy within array | ||
+ | 5, 5.0, 15-04-25, MW, Modified switch to show correct value for off when stating and stopping simulation | ||
+ | 5, 5.0, 16-04-25, MW, Fixed a bug where Pin x and y lables remained visisble when supposed to be hidden | ||
+ | 5, 5.0, 01-05-25, MW, Adjusted pin and component labels and bounds to decrease overall bounds size | ||
+ | 5, 5.0, 01-05-25, MW, Changed labels so don't interact and change switch state | ||
+ | 5, 5.0, 01-05-25, MW, Corrected pin label properties | ||
+ | 5, 5.0, 01-05-25, MW, Added option to hide label | ||
+ | 5, 5.0, 01-05-25, MW, Fixed SameAsHandle label to update on rename event | ||
+ | 6, 0.0, 01-05-25, MW, Changed switch properties to stop greying out | ||
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
Line 26: | Line 48: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
Line 31: | Line 63: | ||
''<span style="color:red;">No additional examples</span>'' | ''<span style="color:red;">No additional examples</span>'' | ||
− | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==Macro reference== | ||
+ | |||
+ | ===ReadState=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 46: | Line 89: | ||
+ | ===SetState=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetState''' |
+ | |- | ||
+ | | colspan="2" | Sets the switch to be on or off. | ||
+ | |- | ||
|- | |- | ||
− | | | + | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL |
+ | | width="90%" | State | ||
|- | |- | ||
+ | | colspan="2" | The new state of the switch (true=on, false=off) | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
Line 59: | Line 108: | ||
+ | ===WaitUntilHigh=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WaitUntilHigh''' |
− | |||
− | |||
|- | |- | ||
+ | | colspan="2" | Waits until the switch is in state 'high' The interpretation of 'high' depends on the polarity | ||
|- | |- | ||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
Line 77: | Line 122: | ||
+ | ===WaitUntilLow=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 88: | Line 134: | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
− | |||
− | |||
Line 99: | Line 143: | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties''' | ||
|- | |- | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Function | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
+ | | width="90%" | Simulation Only | ||
+ | |- | ||
+ | | colspan="2" | | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
Line 107: | Line 160: | ||
| width="90%" | Connection | | width="90%" | Connection | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | The chip pin to which the switch connects. |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| width="90%" | Polarity | | width="90%" | Polarity | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Set the polarity of states sent to the chip pin. 'Active High' -> Pressed = Set, Released = Clear 'Active Low' -> Pressed = Clear, Released = Set |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | ||
| width="90%" | Debounce | | width="90%" | Debounce | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Sets the time in milliseconds to allow a pin change to settle into a stable state. NB) Debouncing is only used when reading the button state using the component macros. Chip pins are NOT debounced. |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
| width="90%" | Latching | | width="90%" | Latching | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Determines if the simulated switch maintains its state or revers back to the default state when not clicked. |
|- | |- | ||
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
Line 130: | Line 183: | ||
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| width="90%" | Component Label | | width="90%" | Component Label | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Component label position | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
Line 148: | Line 206: | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9-type- | + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] |
− | | width="90%" | | + | | width="90%" | Pin label position |
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
− | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Images |
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9-type- | + | | width="10%" align="center" | [[File:Fc9-type-12-icon.png]] |
− | | width="90%" | | + | | width="90%" | Image On |
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
Line 167: | Line 225: | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9-type- | + | | width="10%" align="center" | [[File:Fc9-type-12-icon.png]] |
− | | width="90%" | | + | | width="90%" | Image Off |
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-13-icon.png]] | ||
+ | | width="90%" | FilenameOff | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|} | |} | ||
+ | |||
+ | ==Component Source Code== | ||
+ | |||
+ | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Switch_User_Images_2dgi.fcfx FC_Comp_Source_Switch_User_Images_2dgi.fcfx] | ||
+ | |||
+ | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Switch_User_Images_2dgi.fcfx FC_Comp_Source_Switch_User_Images_2dgi.fcfx] |
Latest revision as of 08:59, 9 June 2025
Author | Matrix TSL |
Version | 6.0 |
Category | Switch |
Contents
Switch User Images component
A simple digital push switch allowing latched and none latched operation. In embedded mode displays the connecting pin and pin status. The on and off states of the switch are shown using user supplied images allowing customised switches to be created.
Version information
Library Version, Component Version, Date, Author, Info 5, 5.0, 23-09-24, MW, Fixed a bug to make sure switch starts in the off position 5, 5.0, 23-09-24, MW, Added option for simulation only 5, 5.0, 23-09-24, MW, Fixed a bug preventing custom lable posistion from updating on the fly 5, 5.0, 23-09-24, MW, Fixed connection lable so show correct polariy within array 5, 5.0, 15-04-25, MW, Modified switch to show correct value for off when stating and stopping simulation 5, 5.0, 16-04-25, MW, Fixed a bug where Pin x and y lables remained visisble when supposed to be hidden 5, 5.0, 01-05-25, MW, Adjusted pin and component labels and bounds to decrease overall bounds size 5, 5.0, 01-05-25, MW, Changed labels so don't interact and change switch state 5, 5.0, 01-05-25, MW, Corrected pin label properties 5, 5.0, 01-05-25, MW, Added option to hide label 5, 5.0, 01-05-25, MW, Fixed SameAsHandle label to update on rename event 6, 0.0, 01-05-25, MW, Changed switch properties to stop greying out
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
ReadState
![]() |
ReadState |
Reads the button state as 0 for released or 1 for pressed Performs debounce if required | |
![]() |
Return |
SetState
![]() |
SetState |
Sets the switch to be on or off. | |
![]() |
State |
The new state of the switch (true=on, false=off) | |
![]() |
Return |
WaitUntilHigh
![]() |
WaitUntilHigh |
Waits until the switch is in state 'high' The interpretation of 'high' depends on the polarity | |
![]() |
Return |
WaitUntilLow
![]() |
WaitUntilLow |
Waits until the switch is in state 'low' The interpretation of 'high' depends on the polarity | |
![]() |
Return |
Property reference
Component Source Code
Please click here to download the component source project: FC_Comp_Source_Switch_User_Images_2dgi.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_Switch_User_Images_2dgi.fcfx