aircraft:tmd:events
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
aircraft:tmd:events [2019/07/20 15:31] – jh | aircraft:tmd:events [2022/07/19 21:07] (current) – [event_edge] jh | ||
---|---|---|---|
Line 5: | Line 5: | ||
A very powerful tool in Aerofly FS 2 aircraft programming in the [[aircraft: | A very powerful tool in Aerofly FS 2 aircraft programming in the [[aircraft: | ||
- | Events are usually only triggered every once in a while and are certainly not intended for constant state logic. Inherently the event logic is state-less. Events cannot replace an underlying [[aircraft: | + | Events are usually only triggered every once in a while and are certainly not intended for constant state logic. Inherently the event logic is state-less. Events cannot replace an underlying [[aircraft: |
> None of the event objects have an '' | > None of the event objects have an '' | ||
Line 38: | Line 38: | ||
< | < | ||
- | < | + | < |
< | < | ||
> | > | ||
< | < | ||
- | < | + | < |
< | < | ||
> | > | ||
< | < | ||
- | < | + | < |
< | < | ||
> | > | ||
< | < | ||
- | < | + | < |
< | < | ||
< | < | ||
< | < | ||
+ | > | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
> | > | ||
</ | </ | ||
Line 59: | Line 64: | ||
==== event_edge ==== | ==== event_edge ==== | ||
- | The event_edge | + | The event_edge, event_edge_rising and event_edge_falling objects |
- | * '' | + | * '' |
- | * '' | + | * '' |
+ | * '' | ||
Line 68: | Line 74: | ||
< | < | ||
< | < | ||
- | <[bool][Rising][true]> | + | <[float64][Value][0.0]> |
- | <[bool][Falling][true]> | + | <[float64][Threshold][0.5]> |
+ | > | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | > | ||
+ | < | ||
+ | < | ||
+ | < | ||
< | < | ||
< | < | ||
Line 86: | Line 102: | ||
==== event_linear ==== | ==== event_linear ==== | ||
+ | |||
+ | The event_linear changes the value carried by the event and then triggers a list of '' | ||
+ | The new value is simply: '' | ||
< | < | ||
Line 95: | Line 114: | ||
==== event_value ==== | ==== event_value ==== | ||
+ | |||
+ | The event_value overwrites the value carried by the event chain and uses the value from the '' | ||
+ | |||
+ | This is used to set a '' | ||
< | < | ||
Line 103: | Line 126: | ||
- | ===== Event Value Checks | + | ===== Event Logic ===== |
- | Depending on the value carried by the event decisions can be made. | + | Depending on the value carried by the event or other values read in decisions can be made and whole decision trees can be set-up. |
==== event_sequence ==== | ==== event_sequence ==== | ||
Line 117: | Line 140: | ||
==== event_demultiplexer ==== | ==== event_demultiplexer ==== | ||
+ | |||
+ | This is like a switch case with discrete input taken from the tmd. | ||
+ | |||
+ | The '' | ||
+ | |||
+ | > If InputSelect == 0.0 -> trigger event at index 0 (first in the list), if InputSelect == 1.0 -> trigger event at index 1 (triggers second in the list), etc. | ||
< | < | ||
Line 126: | Line 155: | ||
==== event_select ==== | ==== event_select ==== | ||
- | When triggered the event_select checks the value of the event call and casts it into an integer. Depending on the integer it selects one of the events from the '' | + | This is like a switch case with discrete input taken from the value of the event itself. |
+ | |||
+ | When triggered the event_select checks the value of the event call and casts it into an integer. Depending on the integer it selects one of the events from the '' | ||
This is useful to have when there is a row of buttons, e.g. like a bezel select on an multifunction display and there is only one message name to be used. With an input_event you can receive that message and then call this event_select to do something specific based on the value of the original button message. | This is useful to have when there is a row of buttons, e.g. like a bezel select on an multifunction display and there is only one message name to be used. With an input_event you can receive that message and then call this event_select to do something specific based on the value of the original button message. | ||
Line 143: | Line 174: | ||
==== event_range ==== | ==== event_range ==== | ||
- | When the event range is triggered it checks the value of the event call against the range and triggers either the list of events when inside or outside of the range. E.g. a button could generate a message with value 1.0 which is received by an input_event and then the input_event triggers this event_range. Depending on what the button value was the event_range does one thing within a set range but does something different when the value is outside that range. | + | When the event_range |
< | < | ||
Line 153: | Line 184: | ||
- | ===== Functions | + | ===== Event Functions ===== |
+ | |||
+ | The following objects allow for different outcomes of a triggered event. | ||
+ | After the execution of a chain of events usually either nothing happens, one or more value are changed or a pulse or timer is triggerd. | ||
==== DEV0 ==== | ==== DEV0 ==== | ||
Line 162: | Line 196: | ||
> | > | ||
</ | </ | ||
+ | |||
+ | ==== Variables ==== | ||
+ | |||
+ | The variable class isn't an event class as such, it cannot trigger any further events. But events can manipulate the value of a '' | ||
+ | |||
+ | Available functions are: | ||
+ | * Variable.Set - Changes the value of the variable to the value carried by the event (Value = event_value) | ||
+ | * Variable.Step - The value is increased or decreased by the value carried by the event (Value += event_value) | ||
+ | * Variable.Reset - The value is set to 0.0 (Value = 0.0) | ||
+ | |||
+ | > Events are not limited to the variable class. Many, in fact almost all of the [[aircraft: | ||
+ | |||
+ | < | ||
+ | < | ||
+ | > | ||
+ | </ | ||
+ | |||
+ | The value of the variable is available to other tmd objects as '' | ||
+ | |||
==== event_sound ==== | ==== event_sound ==== | ||
Line 180: | Line 233: | ||
</ | </ | ||
- | ==== Variables | + | ==== event_timeout |
- | The variable class isn' | + | The timeout is an object like a countdown, several things |
+ | to start/ | ||
- | Available functions are: | + | '' |
- | * Variable.Set - Changes the value of the variable to the value carried by the event (Value = event_value) | + | |
- | * Variable.Step - The value is increased or decreased by the value carried by the event (Value += event_value) | + | |
- | * Variable.Reset - The value is set to 0.0 (Value = 0.0) | + | |
- | < | + | When the timer has reached zero the list of '' |
- | < | + | |
- | > | + | |
- | </ | + | |
- | + | ||
- | The value of the variable is available to other tmd objects as '' | + | |
- | + | ||
- | + | ||
- | ==== event_timeout ==== | + | |
+ | > The event delay could theoretically restart itself causing a periodic check, but this should be avoided if possible as there are better ways to catch changes in a system state, e.g. the '' | ||
+ | |||
< | < | ||
- | < | + | < |
< | < | ||
> | > | ||
Line 206: | Line 251: | ||
==== event_repeat ==== | ==== event_repeat ==== | ||
+ | |||
+ | Constantly fires an event as long as the input condition is non-zero. When the input is above zero the '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | > It is not intended to trigger a long chain of events, just to fluidly move an input back and forth like the directional gyro adjustment for example. | ||
< | < | ||
Line 217: | Line 268: | ||
==== event_swap ==== | ==== event_swap ==== | ||
+ | |||
+ | This can swap two values within the tmd, e.g. two variables or a variable and an '' | ||
+ | |||
+ | > The '' | ||
< | < |
aircraft/tmd/events.1563629514.txt.gz · Last modified: 2019/07/20 15:31 by jh