transition
-
By default transition* (default transition)
is a transition that is performed before any state or node is activated. The system automatically adds a default transition for the first state and adds a node for the transition.
A transition (transition) is a line with an arrow describing the transition from one state or node of the spacecraft, where the transition begins, to another. Such a transition can connect not only states but also nodes, or link a state block to a node. For a transition, []
conditions and {}
actions can be defined. Transition conditions determine whether a transition to the next node or state occurs. The actions associated with a transition specify what code on Julia will be executed during that transition.
Transition syntax
Transitions are customised with Operators of temporal logic, change indicators, conditions and actions:
Actions and conditions are subject to the following rules:
-
Conditions are given in square brackets
[]
. -
Actions are specified in curly brackets
{}
. -
All fields are optional and can be omitted.
-
Conditions and actions support the mathematical and logical operations of the Julia language. For example:
-
You can leave comments on transitions as in any Julia code:
-
To place multiple statements Julia language on one line, use the semicolon ; as a separator:
{y = 0; v = 1}
-
Conditions within a single transition are specified through the logical operators
&&&
(and) and|||
(or).#Вариант с "и" [x>1 && x<3] #Вариант с "или" [x>1 || x<3]
-
In conditions, operator priorities can be given by parentheses, as in the Julia language, for example:
[x == 1 && (y == 3 || after(3,sec))] # выражение (y == 3 || after(3,sec)) будет вычислено первым
-
Read more about temporal logic operators in the article Operators of temporal logic;
-
For more on change indicators, see below.
Transition priorities
The Priority of transitions is the order in which they are evaluated and executed if the conditions of multiple transitions are simultaneously true.
Consider an example from article:
In the example, the Rest state has two transitions whose priorities are set automatically:
Left-click on the transition to set the desired priority and select Priority order:
In our case, the transition up to the Alarm state has been put first and has the first priority, and up to the Fault state has been put second and has the second priority respectively.
Super transitions
A Supertransition (supertransition) is a mechanism that allows transitions between states at any level of the hierarchy, including transitions deep into child states, transitions between parent and child states, or any transition whose ends are on opposite sides of a block-state boundary.