Difference between revisions of "Component: Sim. Switch Base (Simulation)"

From Flowcode Help
Jump to navigationJump to search
(XML import)
(XML import)
 
(One intermediate revision by one other user not shown)
Line 7: Line 7:
 
|-
 
|-
 
| width="20%" style="color: gray;" | Version
 
| width="20%" style="color: gray;" | Version
| 1.1
+
| 1.3 (Release)
 
|-
 
|-
 
| width="20%" style="color: gray;" | Category
 
| width="20%" style="color: gray;" | Category
Line 25: Line 25:
 
This component can be used as a base to create ''child'' components
 
This component can be used as a base to create ''child'' components
  
[[File:Component Icon cc31d777_b10d_4a0a_8b7a_58d842b5530d.png|Image]] The component Basic Sim. Switch is inherited from this.
+
The following components all inherit the traits of Sim. Switch Base:
 +
 
 +
{| class="wikitable" width="50%"
 +
|+|-
 +
|[[File:Component Icon ff84da29_d690_4c8f_a6ab_3c5d59722061.png|Image]] Basic Sim. Slide Switch
 +
|Simple slide switch with no pin assignment.
 +
State can only be determined by simulation macro read.
 +
Momentary or latching action can be chosen in the properties.
 +
|-
 +
|[[File:Component Icon cc31d777_b10d_4a0a_8b7a_58d842b5530d.png|Image]] Basic Sim. Switch
 +
|Simple push button switch with LED indicator with no pin assignment.
 +
State can only be determined by simulation macro read.
 +
Momentary or latching action can be chosen in the properties.
 +
|}
  
 
==Examples==
 
==Examples==
Line 38: Line 51:
  
 
===<span style="font-weight: normal;"><u><tt>GetState</tt></u></span>===
 
===<span style="font-weight: normal;"><u><tt>GetState</tt></u></span>===
''<span style="color:red;">No additional information</span>''
+
Read the current state of the switch.  Returns BOOL true when the switch is on, or
 
 
  
 +
BOOL false when off.
  
 
'''Parameters'''
 
'''Parameters'''
Line 50: Line 63:
  
 
:[[Variable Types|BOOL]] : Returns true if the operation is a success, else false
 
:[[Variable Types|BOOL]] : Returns true if the operation is a success, else false
 +
 +
 +
===<span style="font-weight: normal;"><u><tt>SetState</tt></u></span>===
 +
Sets the current state of the switch.  BOOL true when the switch is on, or
 +
 +
BOOL false when off.
 +
 +
'''Parameters'''
 +
 +
:[[Variable Types|BOOL]] ''SwitchState''
 +
::Sets the state of the switch
 +
 +
 +
'''Return value'''
 +
 +
:''This call does not return a value''
  
  

Latest revision as of 11:25, 13 February 2015


Author Matrix Ltd
Version 1.3 (Release)
Category Simulation


Image Sim. Switch Base 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.


This component can be used as a base to create child components

The following components all inherit the traits of Sim. Switch Base:

-
Image Basic Sim. Slide Switch Simple slide switch with no pin assignment.

State can only be determined by simulation macro read. Momentary or latching action can be chosen in the properties.

Image Basic Sim. Switch Simple push button switch with LED indicator with no pin assignment.

State can only be determined by simulation macro read. Momentary or latching action can be chosen in the properties.

Examples

No additional examples


Downloadable macro reference

This component does not contain any downloadable macros

Simulation macro reference

GetState

Read the current state of the switch. Returns BOOL true when the switch is on, or

BOOL false when off.

Parameters

This macro has no parameters


Return value

BOOL : Returns true if the operation is a success, else false


SetState

Sets the current state of the switch. BOOL true when the switch is on, or

BOOL false when off.

Parameters

BOOL SwitchState
Sets the state of the switch


Return value

This call does not return a value



Property reference

Operation

This property is of type Fixed list of ints and can be referenced with the variable name operation.

Latching = Mouse click to turn on, click again to turn off.

Momentary = Mouse click to turn on, release to turn off.

Send Event

This property is of type Fixed list of ints and can be referenced with the variable name send_event.

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.

Startup State

This property is of type Fixed list of ints and can be referenced with the variable name start_state.

State that the switch will take when simulation is started.

Moving part

This property is of type Panel object and can be referenced with the variable name target.

Handle of a panel object that will be the moving part of the switch.

Pivot object

This property is of type Panel object and can be referenced with the variable name pivot.

Object around which the moving part will rotate when rotation is selected as the movement tyoe.

Type

This property is of type Fixed list of ints and can be referenced with the variable name movetype.

Set whether the moving part will move linearly or by rotation.

Axis

This property is of type Fixed list of ints and can be referenced with the variable name axis.

Axis along which the moving part will move (for push/slide) or around which it will rotate (rotary).

Movement

This property is of type Floating point and can be referenced with the variable name move.

Distance or angle by which the mioving part will move.