Difference between revisions of "Transition Icon Properties"

From Flowcode Help
Jump to navigationJump to search
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 +
[[File:IconTransitionStraight.png|border|link=Transition_Icon_Properties]] [[File:IconTransitionCurved.png|border|link=Transition_Icon_Properties]]
 +
 +
A Transition icon is used within a [[State_diagrams|State Diagram macro]] to represent a transition from one States icon to another. Each Transition icon has a condition that determines the logical flow of the user's program and optional functionality that is executed when the Transition has been activated.
 +
 +
 +
==Details==
 +
{| style="margin:0px; text-align:center;"
 +
|-
 +
|[[File:IconTransitionStraight.png|border|link=Transition_Icon_Properties]] / [[File:IconTransitionCurved.png|border|link=Transition_Icon_Properties]]
 +
|width="50px" |→
 +
|[[File:Properties_Transition.png]]
 +
|}
 +
 
Transitions are lines that connect two states in a state diagram.   
 
Transitions are lines that connect two states in a state diagram.   
  
Line 4: Line 17:
  
  
Like a state, transitions have a display name (i.e. the text displayed on the state within the diagram) and an optional function (macro call, calculation, delay or execute C code) which is executed when the program flow traverses the transition.
+
'''Display Name'''
  
 +
The name of the icon that appears in the State icon in the State Diagram.
  
In addition, transitions have a condition which is an expression that evaluates to true (non-zero) or false (zero).
+
This can be optionally displayed or hidden on the icon itself when the "Show" tick-box is unticked.
  
The condition is used during program execution to determine if the program flow should proceed along that transition. 
 
  
When a state has performed its own optional function, each transition leaving that state has its condition tested in turn to see which path the program flow should continue along.
+
'''Condition'''
  
 +
Transitions have a condition which is an expression that evaluates to true (non-zero) or false (zero). 
  
Transitions have an optional label which can display the name of the transition, its condition, or its function.
+
The condition is used during program execution to determine if the program flow should proceed along that transition.  When the condition is true, the function of the Transition is executed and program control passes to the attached State icon.
 +
 
 +
 
 +
Each transition leaving that state has its condition tested in turn to see which path the program flow should continue along. The order that these are checked is set in the State icon's property page.
 +
 
 +
 
 +
The condition expression 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.
  
Setting the colour of a transition sets the colour of its label. 
 
  
The colour of the transition line and arrow cannot be altered.
+
States will perform their optional function when program flow enters that state through a transition from another state.
  
  
The entry state icon includes a special transition leaving it which should point to the first state to be executed in the state diagram (after the entry state itself).
+
This function can be optionally displayed or hidden on the icon itself when the "Show" tick-box is unticked.
  
This transition is always connected to the enter state and cannot be deleted. 
 
  
Also, it has no properties and so cannot have a label or code.
+
'''Edit...'''
  
It is always executed as if its transition condition is true.
+
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:
  
During program execution (simulation or ICD), the colour of the transition line changes to blue or orange when its condition is being evaluated – blue signifies the condition is false and the transition will be ignored, and orange signifies that the transition is true and the program flow with execute along this transition. 
+
{| class="wikitable"
 +
|+
 +
|-
 +
| [[Macro_Icon_Properties|Call macro]]
 +
|-
 +
| [[Calculation_Icon_Properties|Calculation]]
 +
|-
 +
| [[Delay_Icon_Properties|Delay]]
 +
|-
 +
| [[Code_Icon_Properties|Code]]
 +
|}
  
When the transition is executing, it changes to a thick orange line.
 
  
==Transition Order==
+
==Transition label==
In a state diagram, if a state has multiple transitions leaving it then these need to be evaluated in a set order to ensure program execution is expected and repeatable.   
+
Transitions have an optional label which can display the name of the transition, its condition, or its function.   
  
For example, if two transitions leave a state both evaluate to “true”, we need to ensure one of the transitions has priority over the other.
+
The colour of a transition can be changed by right-clicking the transition and selecting "Set shape colour".
 +
This sets the colour of its label. The colour of the transition line and arrow cannot be altered.
  
  
When a state with multiple exit transitions is selected, the order of transition evaluation is displayed, where “1” shows the first transition to be evaluated.   
+
==Entry State Transition==
 +
The entry state icon includes a special transition leaving it which should point to the first state to be executed in the state diagram (after the entry state itself).   
  
This transition order is also shown if a transition is selectedA state with only one transition leaving it will not show the transition order.
+
This transition is always connected to the enter state and cannot be deleted.   
  
[[File:State_Icon1.png]]
+
Also, it has no properties and so cannot have a label or code.
  
The order can be set on the diagram itself by reconnecting the transitions to the state (the last transition to be connected will have the lowest priority).
+
It is always executed as if its transition condition is true.
  
Alternatively, the transitions can be reordered by editing the properties of the state icon and clicking “Set transition order” to open the Transition Order dialog.
 
  
 +
==Simulation==
 +
During program execution (simulation or ICD), the colour of the transition line changes to blue or orange when its condition is being evaluated – blue signifies the condition is false and the transition will be ignored, and orange signifies that the transition is true and the program flow with execute along this transition. 
  
When using the Transition Order dialog, the applicable transitions are listed using either their name, condition or function.
+
When the transition is executing, it changes to a thick orange line.
  
Highlighting a transition and pressing the up/down arrows will move it higher/lower in the transition order. 
 
  
The transition at the top of the list will be evaluated first.
+
==Example of a State Diagram==
When transitions are evaluated, the evaluation process stops once a transition has evaluated to true. 
 
  
All other transitions leaving the state are assumed to be false even if they have not been evaluated yet.
+
[[File:State0.png|State Diagram Overview]]

Latest revision as of 14:18, 12 June 2026

IconTransitionStraight.png IconTransitionCurved.png

A Transition icon is used within a State Diagram macro to represent a transition from one States icon to another. Each Transition icon has a condition that determines the logical flow of the user's program and optional functionality that is executed when the Transition has been activated.


Details

IconTransitionStraight.png / IconTransitionCurved.png Properties Transition.png

Transitions are lines that connect two states in a state diagram.

These lines have an arrow at one end signifying the direction of program flow through the transition.


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.


Condition

Transitions have a condition which is an expression that evaluates to true (non-zero) or false (zero).

The condition is used during program execution to determine if the program flow should proceed along that transition. When the condition is true, the function of the Transition is executed and program control passes to the attached State icon.


Each transition leaving that state has its condition tested in turn to see which path the program flow should continue along. The order that these are checked is set in the State icon's property page.


The condition expression 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 function 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


Transition label

Transitions have an optional label which can display the name of the transition, its condition, or its function.

The colour of a transition can be changed by right-clicking the transition and selecting "Set shape colour". This sets the colour of its label. The colour of the transition line and arrow cannot be altered.


Entry State Transition

The entry state icon includes a special transition leaving it which should point to the first state to be executed in the state diagram (after the entry state itself).

This transition is always connected to the enter state and cannot be deleted.

Also, it has no properties and so cannot have a label or code.

It is always executed as if its transition condition is true.


Simulation

During program execution (simulation or ICD), the colour of the transition line changes to blue or orange when its condition is being evaluated – blue signifies the condition is false and the transition will be ignored, and orange signifies that the transition is true and the program flow with execute along this transition.

When the transition is executing, it changes to a thick orange line.


Example of a State Diagram

State Diagram Overview