mirror of
https://github.com/nasa/fpp.git
synced 2025-12-11 03:05:32 -06:00
Revise spec for events
This commit is contained in:
parent
99bc939199
commit
60efb6bb00
@ -6020,8 +6020,7 @@ product container Container2 default priority 10</code></pre>
|
||||
<em>]</em>
|
||||
<code>format</code> <a href="#Expressions_String-Literals"><em>string-literal</em></a>
|
||||
<em>[</em>
|
||||
<code>throttle</code> <a href="#Expressions"><em>expression</em></a>
|
||||
<em>[</em> <code>every</code> <a href="#Expressions"><em>expression</em></a> <em>]</em>
|
||||
<code>throttle</code> <em>throttle</em>
|
||||
<em>]</em></p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
@ -6052,6 +6051,15 @@ product container Container2 default priority 10</code></pre>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p><em>throttle</em> is defined as follows:</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p><a href="#Expressions"><em>expression</em></a>
|
||||
<em>[</em>
|
||||
<code>every</code> <a href="#Expressions"><em>expression</em></a>
|
||||
<em>]</em></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="Specifiers_Event-Specifiers_Semantics">7.5.2. Semantics</h4>
|
||||
@ -6088,29 +6096,49 @@ parameters. A numeric format is allowed for any
|
||||
argument whose type is a <a href="#Types_Internal-Types_Numeric-Types">numeric type</a>.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>The optional expression <em>e</em> following <code>throttle</code> specifies the maximum number
|
||||
of times to emit the event before throttling it.
|
||||
The type of <em>e</em> must be convertible to
|
||||
<a href="#Types_Internal-Types_Integer"><em>Integer</em></a> and must evaluate to an integer
|
||||
in the range [0,2<sup>31</sup>).</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>The optional expression <em>e</em> following <code>every</code> specifies the maximum time period
|
||||
to elapse before clearing the event throttle. <em>e</em> must satisfy the following
|
||||
rules:</p>
|
||||
<p>The optional <em>throttle</em> syntax is for throttling events.
|
||||
It has the following meaning:</p>
|
||||
<div class="ulist">
|
||||
<ul>
|
||||
<li>
|
||||
<p>Convertible to the <a href="#Types_Internal-Types_Anonymous-Struct-Types">anonymous struct type</a> <code>{seconds: U32, useconds: U32}</code></p>
|
||||
<p>The expression <em>e</em> following <code>throttle</code> specifies the <strong>maximum throttle
|
||||
count</strong>.
|
||||
The type of <em>e</em> must be convertible to
|
||||
<a href="#Types_Internal-Types_Integer"><em>Integer</em></a> and must evaluate to an integer
|
||||
in the range \$[0, 2^31)\$.
|
||||
When the FSW asks the framework to emit events, a <strong>throttle count</strong>
|
||||
starts at zero and goes up by one with each event emitted.
|
||||
When the throttle count equals the maximum throttle count, no more events
|
||||
are emitted until the throttle count is reset.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>seconds</code> must evaluate to an integer in the range [0,2<sup>31</sup>)</p>
|
||||
<p>The optional expression <em>e</em> following <code>every</code> specifies the <strong>throttle
|
||||
period</strong>.
|
||||
<em>e</em> must satisfy the following rules:</p>
|
||||
<div class="ulist">
|
||||
<ul>
|
||||
<li>
|
||||
<p>The type of <em>e</em> must be convertible to the
|
||||
<a href="#Types_Internal-Types_Anonymous-Struct-Types">anonymous struct type</a> <em>T =</em> <code>{ seconds: U32, useconds: U32 }</code>.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>useconds</code> must evaluate to an integer in the range [0,10<sup>6</sup>)</p>
|
||||
<p>After conversion to <em>T</em>, <em>e</em> must evaluate to an
|
||||
<a href="#Values_Anonymous-Struct-Values">anonymous struct value</a>
|
||||
<code>{ seconds =</code> <em>s</em> <code>:U32, useconds =</code> <em>u</em> <code>:U32 }</code>.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>seconds</code> + <code>useconds</code> must be greater than zero</p>
|
||||
<p><em>s</em> must be in the range \$[0, 2^31)\$, <em>u</em> must be in the range
|
||||
\$[0,10^6)\$, and \$s + u\$ must be greater than zero.</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>If a throttle period \$p\$ is specified, and the throttle count
|
||||
goes from zero to nonzero at time \$t\$, then the throttle count is
|
||||
automatically reset to zero at time \$t + p\$.
|
||||
If no throttle period is specified, then the throttle count must be
|
||||
reset in some other way (typically this is done by command).</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -11853,7 +11881,7 @@ equivalent.</p>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<div id="footer-text">
|
||||
Last updated 2025-09-22 10:15:59 -0700
|
||||
Last updated 2025-09-22 11:54:34 -0700
|
||||
</div>
|
||||
</div>
|
||||
<script src="code-prettify/run_prettify.js"></script>
|
||||
|
||||
@ -15700,7 +15700,7 @@ serialized according to its
|
||||
</div>
|
||||
<div id="footer">
|
||||
<div id="footer-text">
|
||||
Last updated 2025-09-17 14:35:51 -0700
|
||||
Last updated 2025-09-22 11:13:20 -0700
|
||||
</div>
|
||||
</div>
|
||||
<script src="code-prettify/run_prettify.js"></script>
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="generator" content="Asciidoctor 2.0.23">
|
||||
<meta name="generator" content="Asciidoctor 2.0.20">
|
||||
<title>F Prime Prime (FPP)</title>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700">
|
||||
<style>
|
||||
@ -140,7 +140,7 @@ p a>code:hover{color:rgba(0,0,0,.9)}
|
||||
#content::before{content:none}
|
||||
#header>h1:first-child{color:rgba(0,0,0,.85);margin-top:2.25rem;margin-bottom:0}
|
||||
#header>h1:first-child+#toc{margin-top:8px;border-top:1px solid #dddddf}
|
||||
#header>h1:only-child{border-bottom:1px solid #dddddf;padding-bottom:8px}
|
||||
#header>h1:only-child,body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #dddddf;padding-bottom:8px}
|
||||
#header .details{border-bottom:1px solid #dddddf;line-height:1.45;padding-top:.25em;padding-bottom:.25em;padding-left:.25em;color:rgba(0,0,0,.6);display:flex;flex-flow:row wrap}
|
||||
#header .details span:first-child{margin-left:-.125em}
|
||||
#header .details span.email a{color:rgba(0,0,0,.85)}
|
||||
@ -162,7 +162,6 @@ p a>code:hover{color:rgba(0,0,0,.9)}
|
||||
#toctitle{color:#7a2518;font-size:1.2em}
|
||||
@media screen and (min-width:768px){#toctitle{font-size:1.375em}
|
||||
body.toc2{padding-left:15em;padding-right:0}
|
||||
body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #dddddf;padding-bottom:8px}
|
||||
#toc.toc2{margin-top:0!important;background:#f8f8f7;position:fixed;width:15em;left:0;top:0;border-right:1px solid #e7e7e9;border-top-width:0!important;border-bottom-width:0!important;z-index:1000;padding:1.25em 1em;height:100%;overflow:auto}
|
||||
#toc.toc2 #toctitle{margin-top:0;margin-bottom:.8rem;font-size:1.2em}
|
||||
#toc.toc2>ul{font-size:.9em;margin-bottom:0}
|
||||
@ -328,7 +327,7 @@ a.image{text-decoration:none;display:inline-block}
|
||||
a.image object{pointer-events:none}
|
||||
sup.footnote,sup.footnoteref{font-size:.875em;position:static;vertical-align:super}
|
||||
sup.footnote a,sup.footnoteref a{text-decoration:none}
|
||||
sup.footnote a:active,sup.footnoteref a:active,#footnotes .footnote a:first-of-type:active{text-decoration:underline}
|
||||
sup.footnote a:active,sup.footnoteref a:active{text-decoration:underline}
|
||||
#footnotes{padding-top:.75em;padding-bottom:.75em;margin-bottom:.625em}
|
||||
#footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em;border-width:1px 0 0}
|
||||
#footnotes .footnote{padding:0 .375em 0 .225em;line-height:1.3334;font-size:.875em;margin-left:1.2em;margin-bottom:.2em}
|
||||
@ -464,7 +463,7 @@ generated code.</p>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<div id="footer-text">
|
||||
Last updated 2025-03-17 09:56:45 -0700
|
||||
Last updated 2025-02-18 09:43:03 -0800
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@ -16,8 +16,7 @@ _[_
|
||||
_]_
|
||||
`format` <<Expressions_String-Literals,_string-literal_>>
|
||||
_[_
|
||||
`throttle` <<Expressions,_expression_>>
|
||||
_[_ `every` <<Expressions,_expression_>> _]_
|
||||
`throttle` _throttle_
|
||||
_]_
|
||||
|
||||
_severity_ is one of the following:
|
||||
@ -30,6 +29,13 @@ _severity_ is one of the following:
|
||||
* `warning` `high`
|
||||
* `warning` `low`
|
||||
|
||||
_throttle_ is defined as follows:
|
||||
|
||||
<<Expressions,_expression_>>
|
||||
_[_
|
||||
`every` <<Expressions,_expression_>>
|
||||
_]_
|
||||
|
||||
==== Semantics
|
||||
|
||||
* The identifier names the event.
|
||||
@ -57,24 +63,41 @@ ground. The arguments to the format string are the values bound to the event
|
||||
parameters. A numeric format is allowed for any
|
||||
argument whose type is a <<Types_Internal-Types_Numeric-Types,numeric type>>.
|
||||
|
||||
* The optional expression _e_ following `throttle` specifies the maximum number
|
||||
of times to emit the event before throttling it.
|
||||
* The optional _throttle_ syntax is for throttling events.
|
||||
It has the following meaning:
|
||||
|
||||
** The expression _e_ following `throttle` specifies the *maximum throttle
|
||||
count*.
|
||||
The type of _e_ must be convertible to
|
||||
<<Types_Internal-Types_Integer,_Integer_>> and must evaluate to an integer
|
||||
in the range [0,2^31^).
|
||||
in the range stem:[[0, 2^31)].
|
||||
When the FSW asks the framework to emit events, a *throttle count*
|
||||
starts at zero and goes up by one with each event emitted.
|
||||
When the throttle count equals the maximum throttle count, no more events
|
||||
are emitted until the throttle count is reset.
|
||||
|
||||
* The optional expression _e_ following `every` specifies the maximum time period
|
||||
to elapse before clearing the event throttle. _e_ must satisfy the following
|
||||
rules:
|
||||
** The optional expression _e_ following `every` specifies the *throttle
|
||||
period*.
|
||||
_e_ must satisfy the following rules:
|
||||
|
||||
** Convertible to the <<Types_Internal-Types_Anonymous-Struct-Types,
|
||||
anonymous struct type>> `{seconds: U32, useconds: U32}`
|
||||
*** The type of _e_ must be convertible to the
|
||||
<<Types_Internal-Types_Anonymous-Struct-Types,
|
||||
anonymous struct type>> _T =_ `{ seconds: U32, useconds: U32 }`.
|
||||
|
||||
** `seconds` must evaluate to an integer in the range [0,2^31^)
|
||||
*** After conversion to _T_, _e_ must evaluate to an
|
||||
<<Values_Anonymous-Struct-Values,anonymous struct value>>
|
||||
`{ seconds =` _s_ `:U32, useconds =` _u_ `:U32 }`.
|
||||
|
||||
** `useconds` must evaluate to an integer in the range [0,10^6^)
|
||||
*** _s_ must be in the range stem:[[0, 2^31)], _u_ must be in the range
|
||||
stem:[[0,10^6)], and stem:[s + u] must be greater than zero.
|
||||
|
||||
** `seconds` + `useconds` must be greater than zero
|
||||
+
|
||||
+
|
||||
If a throttle period stem:[p] is specified, and the throttle count
|
||||
goes from zero to nonzero at time stem:[t], then the throttle count is
|
||||
automatically reset to zero at time stem:[t + p].
|
||||
If no throttle period is specified, then the throttle count must be
|
||||
reset in some other way (typically this is done by command).
|
||||
|
||||
==== Examples
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user