User Tools

Site Tools


aircraft:tmd:events

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
aircraft:tmd:events [2019/07/20 15:34] jhaircraft:tmd:events [2022/07/19 21:06] jh
Line 38: Line 38:
  
 <code>            <[input_event][Button_Pressed][] <code>            <[input_event][Button_Pressed][]
-                <[string8][Input][Controls.Button]>+                <[string8][Message][Controls.Button]>
                 <[string8][Events][ DEV0.Trigger ]>                 <[string8][Events][ DEV0.Trigger ]>
             >             >
             <[input_event][Knob_Stepped][]             <[input_event][Knob_Stepped][]
-                <[string8][Input][Controls.Button]>+                <[string8][Message][Controls.Button]>
                 <[string8][StepEvents][ DEV0.Trigger ]>                 <[string8][StepEvents][ DEV0.Trigger ]>
             >             >
             <[input_event][Button_Toggled][]             <[input_event][Button_Toggled][]
-                <[string8][Input][Controls.Button]>+                <[string8][Message][Controls.Button]>
                 <[string8][ToggleEvents][ DEV0.Trigger ]>                 <[string8][ToggleEvents][ DEV0.Trigger ]>
             >             >
             <[input_event][Button_Clicked][]             <[input_event][Button_Clicked][]
-                <[string8][Input][Controls.Button]>+                <[string8][Message][Controls.Button]>
                 <[string8][Events]      [ DEV0.Trigger ]>                 <[string8][Events]      [ DEV0.Trigger ]>
                 <[string8][StepEvents]  [ DEV0.Trigger ]>                 <[string8][StepEvents]  [ DEV0.Trigger ]>
                 <[string8][ToggleEvents][ DEV0.Trigger ]>                 <[string8][ToggleEvents][ DEV0.Trigger ]>
 +            >
 +            <[input_event][Button1_Pressed][]
 +                <[string8][Message][Controls.Button]>
 +                <[float64][InputValue][1.0]>
 +                <[string8][Events][ DEV0.Trigger ]>
             >             >
 </code> </code>
Line 68: Line 73:
                 <[string8][Input][State.Output]>                 <[string8][Input][State.Output]>
                 <[string8][Events][ DEV0.Trigger ]>                 <[string8][Events][ DEV0.Trigger ]>
-                <[bool][Rising][true]> +                <[float64][Value][0.0]> 
-                <[bool][Falling][true]>+                <[float64][Threshold][0.5]> 
 +            > 
 +            <[event_edge_rising][State_Increased][] 
 +                <[string8][Input][State.Output]> 
 +                <[string8][Events][ DEV0.Trigger ]> 
 +                <[float64][Value][0.0]> 
 +                <[float64][Threshold][0.5]> 
 +            > 
 +            <[event_edge_falling][State_Decreased][] 
 +                <[string8][Input][State.Output]> 
 +                <[string8][Events][ DEV0.Trigger ]>
                 <[float64][Value][0.0]>                 <[float64][Value][0.0]>
                 <[float64][Threshold][0.5]>                 <[float64][Threshold][0.5]>
Line 86: Line 101:
  
 ==== event_linear ==== ==== event_linear ====
 +
 +The event_linear changes the value carried by the event and then triggers a list of ''Events'' with the new value.
 +The new value is simply: ''NewValue = OldValue * Scaling + Offset''.
  
 <code>            <[event_linear][StepSomething][] <code>            <[event_linear][StepSomething][]
Line 95: Line 113:
  
 ==== event_value ==== ==== event_value ====
 +
 +The event_value overwrites the value carried by the event chain and uses the value from the ''Input'' instead.
 +
 +This is used to set a ''variable'' to a specific value with ''Variable.Set'' or ''Variable.Reset''.
  
 <code>            <[event_value][SetSomethingToSomeValue][] <code>            <[event_value][SetSomethingToSomeValue][]
Line 103: Line 125:
  
  
-===== 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 139:
  
 ==== event_demultiplexer ==== ==== event_demultiplexer ====
 +
 +This is like a switch case with discrete input taken from the tmd.
 +
 +The ''InputSelect'' value is taken in from the tmd and becomes a discrete integer. That value is then used as an index in the list, starting from 0 (zero based index). If the InputSelect value is outside of the range 0 to (n-1) no event is triggered.
 +
 +> 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.
  
 <code>            <[event_demultiplexer][TriggerIf][] <code>            <[event_demultiplexer][TriggerIf][]
Line 126: Line 154:
 ==== 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 ''Events'' list based on the calculated index. The list starts at index 0 and increases.+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 ''Events'' list based on the calculated index. The list starts at index 0 (zero based index). When the value is below zero or higher than the number of events that can be triggered then no event is fired.
  
 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 173:
 ==== 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 is triggered it checks the value of the event call against the range and triggers either the list of events when inside (''EventsIn''or outside (''EventsOut''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.
  
 <code>            <[event_range][StepWhenValueInRange][] <code>            <[event_range][StepWhenValueInRange][]
Line 154: Line 184:
  
 ===== Event 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 171: Line 204:
   * Variable.Step - The value is increased or decreased by 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)   * 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:tmd:inputs|TMD Inputs]] can be manipulated in the same way as the variable. E.g. an ''input_binary'' can be Set, Reset or Toggled, an ''input_discrete'' can be Stepped, Toggled, Set or Reset as well.
  
 <code>            <[variable][Variable][] <code>            <[variable][Variable][]
Line 199: Line 234:
 ==== event_timeout ==== ==== event_timeout ====
  
 +The timeout is an object like a countdown, several things can be fired here: ''Trigger'', ''Set'', ''Reset'', ''Pause'', ''Unpause''
 +to start/stop/reset (like a chronometer), to start (let it run), reset (stop and reset) or pause and unpause the internal timer.
 +
 +''Duration'' is the count down time.
 +
 +When the timer has reached zero the list of ''Events'' are fired.
 +
 +> 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 ''event_edge'' or to constantly monitor a value, e.g. logic_greater, logic_or, etc. (see [[aircraft:tmd:logic|TMD Logic]]).
 + 
 <code>            <[event_timeout][EventDelay][] <code>            <[event_timeout][EventDelay][]
-                <[float64][Duration][1.0]>+                <[float64][Duration][10.0]>
                 <[string8][Events][ DEV0.Trigger ]>                 <[string8][Events][ DEV0.Trigger ]>
             >             >
Line 206: Line 250:
  
 ==== event_repeat ==== ==== event_repeat ====
 +
 +Constantly fires an event as long as the input condition is non-zero. When the input is above zero the ''EventsUp'' list is fired and if it is below zero ''EventsDown'' is triggered.
 +
 +''Scaling'' adjusts the value that is carried over to the next events. Lower values reduce the step size for example.
 +
 +> 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.
  
 <code>            <[event_repeat][DirectionalGyroCorrectionSwitchFunction][] <code>            <[event_repeat][DirectionalGyroCorrectionSwitchFunction][]
Line 217: Line 267:
  
 ==== event_swap ==== ==== event_swap ====
 +
 +This can swap two values within the tmd, e.g. two variables or a variable and an ''input_binary'', ''input_discrete'', etc.
 +
 +> The ''input_pair'' is optimized for frequency inputs that you can swap back and forth. Use this when you can instead of the ''event_swap''.
  
 <code>            <[event_swap][NAV1ManualFrequencySwap][] <code>            <[event_swap][NAV1ManualFrequencySwap][]
aircraft/tmd/events.txt · Last modified: 2022/07/19 21:07 by jh