aircraft:tmd:events
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
aircraft:tmd:events [2019/07/12 22:10] – jh | aircraft:tmd:events [2019/07/20 15:30] – jh | ||
---|---|---|---|
Line 26: | Line 26: | ||
* Events can trigger other events | * Events can trigger other events | ||
- | ===== Events | + | ===== Event Generation |
- | ==== DEV0 ==== | + | ==== input_event ==== |
- | + | ||
- | The do-nothing placeholder is triggered with '' | + | |
- | + | ||
- | < | + | |
- | > | + | |
- | </ | + | |
- | + | ||
- | ==== input_event==== | + | |
The input_event receives messages from the [[aircraft: | The input_event receives messages from the [[aircraft: | ||
Line 80: | Line 72: | ||
< | < | ||
< | < | ||
+ | > | ||
+ | </ | ||
+ | |||
+ | ===== Event Value Manipulation ===== | ||
+ | |||
+ | When a button, key command or joystick button are pressed they all generate messages and these messages carry a certain value. Most of them are 1.0, some are -1.0 (e.g. when rotated in the other direction) but other values can also exist. In the [[aircraft: | ||
+ | |||
+ | When the message is received by an '' | ||
+ | |||
+ | The value is therefor carried from one event object to the next most of the time and we still have access to the original value way down the event chain. | ||
+ | |||
+ | > When a '' | ||
+ | |||
+ | ==== event_linear ==== | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | > | ||
+ | </ | ||
+ | |||
+ | ==== event_value ==== | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | > | ||
+ | </ | ||
+ | |||
+ | ===== Basic Events ===== | ||
+ | |||
+ | ==== DEV0 ==== | ||
+ | |||
+ | The do-nothing placeholder is triggered with '' | ||
+ | |||
+ | < | ||
+ | > | ||
+ | </ | ||
+ | |||
+ | ==== event_sound ==== | ||
+ | |||
+ | Normally an event_sound object is used to generate a switch or button sound. Using the trigger function (in this case SwitchSound.Trigger) causes the event_sound to briefly output 1.0 to the sound section of the [[aircraft: | ||
+ | |||
+ | < | ||
> | > | ||
</ | </ | ||
Line 85: | Line 122: | ||
==== event_pulse ==== | ==== event_pulse ==== | ||
- | When the pulse is triggered (function '' | + | When the pulse is triggered (function '' |
< | < | ||
Line 91: | Line 128: | ||
> | > | ||
</ | </ | ||
+ | |||
+ | ==== 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) | ||
+ | |||
+ | < | ||
+ | < | ||
+ | > | ||
+ | </ | ||
+ | |||
+ | The value of the variable is available to other tmd objects as '' | ||
+ | |||
+ | ===== Event Value Checks ===== | ||
+ | |||
+ | Depending on the value carried by the event decisions can be made. | ||
==== event_sequence ==== | ==== event_sequence ==== | ||
- | ==== event_range ==== | + | Creates a chain of events that are executed one after another. This allows objects like the autopilot, that only trigger a single '' |
- | ==== event_select ==== | + | < |
+ | < | ||
+ | > | ||
+ | </ | ||
==== event_demultiplexer ==== | ==== event_demultiplexer ==== | ||
- | ==== event_linear ==== | + | < |
+ | < | ||
+ | < | ||
+ | > | ||
+ | </ | ||
- | ==== event_value | + | ==== 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 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. | ||
+ | |||
+ | > Similar logic can be achieved with the '' | ||
+ | |||
+ | > When you are not interested in the value carried with the event then use the '' | ||
+ | |||
+ | < | ||
+ | < | ||
+ | DoSomethingIfValueIs1.Trigger | ||
+ | DoSomethingIfValueIs2.Trigger ]> | ||
+ | > | ||
+ | </ | ||
+ | |||
+ | ==== 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. | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | > | ||
+ | </ | ||
+ | |||
+ | ===== Other Event Objects ===== | ||
- | ==== event_sound ==== | ||
==== event_timeout ==== | ==== event_timeout ==== | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | > | ||
+ | </ | ||
==== event_repeat ==== | ==== event_repeat ==== | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | > | ||
+ | </ | ||
==== event_swap ==== | ==== event_swap ==== | ||
- | ==== event_crash ==== | + | < |
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | > | ||
+ | </ | ||
aircraft/tmd/events.txt · Last modified: 2022/07/19 21:07 by jh