Difference between revisions of "State Icon Properties"

From Flowcode Help
Jump to navigationJump to search
Tags: Flowcode v9 Flowcode v10 Version
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
[[File:iconState.png|border]]
 +
 +
A State icon is used within a [[State_diagrams|State Diagram macro]] to represent one of the states. Each State icon will have optional functionality that is executed when the State is entered.
 +
 +
 +
==Details==
 +
{| style="margin:0px; text-align:center;"
 +
|-
 +
|[[File:iconState.png|border]]
 +
|width="50px" |→
 +
|[[File:Properties_State.png]]
 +
|}
 +
 
A State Diagram consists of several state icons interconnected with transitions.  Like a transition, a state icon has a display name (i.e. the text displayed on the state within the diagram) and an optional function.
 
A State Diagram consists of several state icons interconnected with transitions.  Like a transition, a state icon has a display name (i.e. the text displayed on the state within the diagram) and an optional function.
  
 +
 +
'''Display Name'''
 +
 +
The name of the icon that appears in the State icon in the State Diagram.
 +
 +
This can be optionally displayed or hidden on the icon itself when the "Show" tick-box is unticked.
 +
 +
 +
'''Function'''
  
 
The function is code that is executed when the program flow enters (or remains in) that state icon.
 
The function is code that is executed when the program flow enters (or remains in) that state icon.
Line 9: Line 31:
 
States will perform their optional function when program flow enters that state through a transition from another state.
 
States will perform their optional function when program flow enters that state through a transition from another state.
  
 +
 +
This can be optionally displayed or hidden on the icon itself when the "Show" tick-box is unticked.
 +
 +
 +
'''Edit...'''
 +
 +
Click the "Edit..." button to change the details of the selected function. This button will be hidden if the function is set to "Do nothing" and will be labelled "Choose macro..." if the "Call Macro" function is chosen.
 +
 +
This will open another property window that is specific to the selected function. More details are here:
 +
 +
{| class="wikitable"
 +
|+
 +
|-
 +
| [[Macro_Icon_Properties|Call macro]]
 +
|-
 +
| [[Calculation_Icon_Properties|Calculation]]
 +
|-
 +
| [[Delay_Icon_Properties|Delay]]
 +
|-
 +
| [[Code_Icon_Properties|Code]]
 +
|}
 +
 +
 +
'''Set transition order'''
  
 
States usually have one or more exit transitions: arrows that flow out of the state icon with optional conditions that must be true for program execution to ‘flow’ along that Transition.
 
States usually have one or more exit transitions: arrows that flow out of the state icon with optional conditions that must be true for program execution to ‘flow’ along that Transition.
Line 14: Line 60:
 
These exit Transitions are evaluated in turn until one is found to be true.  The evaluation order of these transitions can be set by clicking “Set transition order” or by reconnecting the start end of the transition to the state.
 
These exit Transitions are evaluated in turn until one is found to be true.  The evaluation order of these transitions can be set by clicking “Set transition order” or by reconnecting the start end of the transition to the state.
  
 +
 +
==Editing the order of transitions==
 +
[[File:TransitionOrder.png]]
 +
 +
The order in which transitions are evaluated can be set in this window. Click the required transition to select it and set its position in the list using the up and down arrows.
 +
 +
 +
The transitions can be listed here by their Display Name, their specified Condition, or the Function that they perform.
 +
 +
 +
==Special States==
  
 
A state without an exit transition will force program execution to remain in that state until the program is stopped by the user.
 
A state without an exit transition will force program execution to remain in that state until the program is stopped by the user.
  
  
Each state diagram must contain a single “Entry State” icon which contains the code to be executed when the program enters that macro.
+
Each state diagram must contain a single “Entry State” icon which contains the code to be executed when the program enters that macro.
  
 
Only one transition can exit this entry state and neither this transition nor the entry state can be deleted from the state diagram.
 
Only one transition can exit this entry state and neither this transition nor the entry state can be deleted from the state diagram.
 +
 +
 +
State Diagrams can may have one or more [[Exit_State_Icon_Properties|Exit State icons]], which cause the State Diagram to return to its calling macro.
 +
 +
These may have a return value if this State Diagram macro specifies a return type.
 +
 +
 +
==Example of a State Diagram==
 +
 +
[[File:State0.png|State Diagram Overview]]

Latest revision as of 14:10, 12 June 2026

IconState.png

A State icon is used within a State Diagram macro to represent one of the states. Each State icon will have optional functionality that is executed when the State is entered.


Details

IconState.png Properties State.png

A State Diagram consists of several state icons interconnected with transitions. Like a transition, a state icon has a display name (i.e. the text displayed on the state within the diagram) and an optional function.


Display Name

The name of the icon that appears in the State icon in the State Diagram.

This can be optionally displayed or hidden on the icon itself when the "Show" tick-box is unticked.


Function

The function is code that is executed when the program flow enters (or remains in) that state icon.

This can be to call a macro, perform a calculation, delay program execution or execute some custom C code.


States will perform their optional function when program flow enters that state through a transition from another state.


This can be optionally displayed or hidden on the icon itself when the "Show" tick-box is unticked.


Edit...

Click the "Edit..." button to change the details of the selected function. This button will be hidden if the function is set to "Do nothing" and will be labelled "Choose macro..." if the "Call Macro" function is chosen.

This will open another property window that is specific to the selected function. More details are here:

Call macro
Calculation
Delay
Code


Set transition order

States usually have one or more exit transitions: arrows that flow out of the state icon with optional conditions that must be true for program execution to ‘flow’ along that Transition.

These exit Transitions are evaluated in turn until one is found to be true. The evaluation order of these transitions can be set by clicking “Set transition order” or by reconnecting the start end of the transition to the state.


Editing the order of transitions

TransitionOrder.png

The order in which transitions are evaluated can be set in this window. Click the required transition to select it and set its position in the list using the up and down arrows.


The transitions can be listed here by their Display Name, their specified Condition, or the Function that they perform.


Special States

A state without an exit transition will force program execution to remain in that state until the program is stopped by the user.


Each state diagram must contain a single “Entry State” icon which contains the code to be executed when the program enters that macro.

Only one transition can exit this entry state and neither this transition nor the entry state can be deleted from the state diagram.


State Diagrams can may have one or more Exit State icons, which cause the State Diagram to return to its calling macro.

These may have a return value if this State Diagram macro specifies a return type.


Example of a State Diagram

State Diagram Overview