381
edits
(→Related content: + Readme file) |
(Added state-machine documentation) |
||
Line 130: | Line 130: | ||
* <logic> | * <logic> | ||
* <flipflop> | * <flipflop> | ||
* <state-machine> | |||
== Common elements used by all elements == | == Common elements used by all elements == | ||
Line 699: | Line 700: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== State Machine <state-machine> == | |||
For a discription of what a state machine can do, look here: [http://en.wikipedia.org/wiki/Finite-state_machine]. | |||
<state-machine> | |||
<branch>/my-statemachine</branch> | |||
<state> | |||
<name>init</name> | |||
<enter> | |||
<binding></binding> | |||
<binding></binding> | |||
</enter> | |||
<exit> | |||
<binding></binding> | |||
</exit> | |||
<update> | |||
<binding></binding> | |||
</update> | |||
</state> | |||
<state> | |||
<name>finished</name> | |||
<enter>Zero to many bindings, fired upon state enter</enter> | |||
<exit>Zero to many bindings, fired upon state exit</exit> | |||
<update>Zero to many bindings, fired upon every state change</update> | |||
</state> | |||
<transition> | |||
<name>ready</name> | |||
<source>init</source> | |||
<target>finished</target> | |||
<exclude-target type="bool">true</exclude-target> | |||
<condition> | |||
<greater-than> | |||
<property>/sim/time/elapsed-sec</property> | |||
<value>30</value> | |||
</greater-than> | |||
</condition> | |||
<binding>Zero to many bindings, fired upon state change</binding> | |||
</transition> | |||
</state-machine> | |||
Legal elements for the state machine are: | |||
{| class="prettytable" | |||
!branch | |||
|A path to a property node where the internal states of the machine gets written to. Can be empty. | |||
|- | |||
!state | |||
|Two ore more state elements are required for a minimal state machine | |||
|- | |||
!transition | |||
|Any number of transition elements. Describes how to change from one state to another. | |||
|} | |||
Legal elements for the state element are: | |||
{| class="prettytable" | |||
!name | |||
|required, gives the state a name for reference | |||
|- | |||
!enter | |||
|optional, zero to many enter elements containing a SGBinding to fire upon state enter | |||
|- | |||
!exit | |||
|optional, zero to many exit elements containing a SGBinding to fire upon state exit | |||
|- | |||
!update | |||
|optional, zero to many update elements containing a SGBinding to fire upon state change | |||
|} | |||
Legal elements for the transition element are: | |||
{| class="prettytable" | |||
!name | |||
|required, gives the transition a name for reference | |||
|- | |||
!source | |||
|required, one to many source elements containing the name of a source state | |||
|- | |||
!target | |||
|required, exactly one target element defining the target state | |||
|- | |||
!condition | |||
|required, contains a SGCondition when this state change occours | |||
|- | |||
!exclude-target | |||
|optional, boolean flag defaults to true. Indicates if this transition should be evaluated even if current state equals target | |||
|- | |||
!binding | |||
|optional, zero to many binding elements containing a SGBinding to fire when this transition triggers | |||
|} | |||
== Proposed extensions == | == Proposed extensions == | ||
This sections contains new features for the autopilot to be implemented. Nobody knows if and when this will happen. Consider this as a collection of ideas as a base for discussion on the mailing list, the forum or IRC. | This sections contains new features for the autopilot to be implemented. Nobody knows if and when this will happen. Consider this as a collection of ideas as a base for discussion on the mailing list, the forum or IRC. | ||
== Related content == | == Related content == |