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
aircraft:tmd:events [2019/07/20 15:48] – [Event Functions] jhaircraft:tmd:events [2022/07/19 21:07] (current) – [event_edge] 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 ]>
Line 56: Line 56:
             >             >
             <[input_event][Button1_Pressed][]             <[input_event][Button1_Pressed][]
-                <[string8][Input][Controls.Button]>+                <[string8][Message][Controls.Button]>
                 <[float64][InputValue][1.0]>                 <[float64][InputValue][1.0]>
                 <[string8][Events][ DEV0.Trigger ]>                 <[string8][Events][ DEV0.Trigger ]>
Line 64: Line 64:
 ==== event_edge ==== ==== event_edge ====
  
-The event_edge object constantly monitors the input. When the input passes through the ''Threshold'' on either the rising or falling edge it triggers all of the functions listed in the ''Events'' list.+The event_edge, event_edge_rising and event_edge_falling objects constantly monitor the input. When the input passes through the ''Threshold'' it triggers all of the functions listed in the ''Events'' list.
  
-  * ''Rising''when set to true: The input is increasing and passes from below the threshold above the threshold then the ''Events'' are fired. +  * ''event_edge_rising'' - The input is increasing and passes from below the threshold above the threshold then the ''Events'' are fired. 
-  * ''Falling''when set to true: The input is moving from above the threshold below it then the ''Events'' are fired.+  * ''event_edge_falling'' - The input is moving from above the threshold below it then the ''Events'' are fired
 +  * ''event_edge'' - When the input passes through the threshold it triggers the events.
  
  
Line 73: Line 74:
                 <[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 176: Line 187:
  
 The following objects allow for different outcomes of a triggered event. 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 192: Line 205:
   * 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 220: Line 235:
 ==== 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 227: 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 ''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 238: Line 268:
  
 ==== 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.1563630518.txt.gz · Last modified: 2019/07/20 15:48 by jh