Difference between revisions of "Extensions.EventHandling.TimerExpiredEventSource"

From emotive
Jump to navigation Jump to search
 
(8 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:  '''TimerExpiredEventSource'''}}[[Category:EventHandling]]
 
{{DISPLAYTITLE:  '''TimerExpiredEventSource'''}}[[Category:EventHandling]]
 
== Classification ==
 
== Classification ==
{{ClassificationActivity | TimerExpiredEventSource | Create an event source for timing | [[Term]] | [[Extensions.EventHandling|OTX EventHandling extension]] | [[Event source related terms]] | [[OutOfBoundsException]] | - }}
+
{{ClassificationActivity | TimerExpiredEventSource | Create an event source for timing | [[Term]] | [[Extensions.EventHandling|OTX EventHandling extension]] | [[Extensions.EventHandling#Terms|Event source related terms]] | [[Core.DataTypes.ComplexDataType.OutOfBoundsException|OutOfBoundsException]] | - }}
  
 
== OTL Syntax ==
 
== OTL Syntax ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
EventSourceTerm = EventHandling.TimerExpiredEventSource(IntergerTerm);
+
EventSourceTerm EventHandling.TimerExpiredEventSource(NumericTerm timeOut);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
== Description ==
 
== Description ==
The OTX '''TimerExpiredEventSource''' term creates an event source that triggers an event when a specified time has elapsed. If the specified time has elapsed, the timer expiration event is produced and added to the queue of the Event Sources. Event queue immediately begin sobaldder event source is created. Event queue should start immediately as soon as the event source is created.
+
The OTX '''TimerExpiredEventSource''' term will create an event source that produces an event when a specified time expires. If the specified time expires, the timer expiry event is produced and put into the event source's queue. Event queueing will start immediately once the event source is created.
 +
 
 +
if the timeout value is negative, the [[Core.DataTypes.ComplexDataType.OutOfBoundsException|OutOfBoundsException]] exception will be thrown.
  
 
{{TermReturnValue| [[Extensions.EventHandling.EventSource|EventSource]] | '''The EventSource''',  the timing monitors.}}
 
{{TermReturnValue| [[Extensions.EventHandling.EventSource|EventSource]] | '''The EventSource''',  the timing monitors.}}
Line 16: Line 18:
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| TimeOut | [[Core.DataTypes.SimpleDataType.Integer|Integer]] | [[Term]] | - | [1] | An integer value that is interpreted to wait in milliseconds as a time. When the specified number of milliseconds has elapsed, an event is triggered.}}
+
{{TableRowPropertie2| TimeOut | [[Numeric]] | [[Term]] | - | [1] | This element specifies an [[Core.DataTypes.SimpleDataType.Integer|Integer]] value that is interpreted as a time in milli-seconds to wait. [[Core.DataTypes.SimpleDataType.Float|Float]] values will be truncated.}}
 
|}
 
|}
  
 
== OTL Examples ==
 
== OTL Examples ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 +
/// Local Declarations
 +
 
EventHandling.EventSource EventSource1;
 
EventHandling.EventSource EventSource1;
 
Integer Variable1;
 
Integer Variable1;
 
EventHandling.Event Event1;
 
EventHandling.Event Event1;
 +
 +
/// Flow
  
 
EventSource1 = EventHandling.TimerExpiredEventSource(1000);
 
EventSource1 = EventHandling.TimerExpiredEventSource(1000);
Line 40: Line 46:
 
       EventHandling.WaitForEvent({EventSource1}, Event1);
 
       EventHandling.WaitForEvent({EventSource1}, Event1);
  
       terminate;
+
       terminateLanes;
 
   }
 
   }
 
}
 
}
Line 47: Line 53:
 
== See also ==
 
== See also ==
 
[[Extensions.EventHandling.ThresholdExceededEventSource|ThresholdExceededEventSource]] <br/>
 
[[Extensions.EventHandling.ThresholdExceededEventSource|ThresholdExceededEventSource]] <br/>
 +
[[Extensions.EventHandling.MonitorChangeEventSource|MonitorChangeEventSource]] <br/>
 
[[Extensions.EventHandling.WaitForEvent|WaitForEvent]]
 
[[Extensions.EventHandling.WaitForEvent|WaitForEvent]]

Latest revision as of 10:39, 12 September 2019

Classification

Name TimerExpiredEventSource
Short Description Create an event source for timing
Class Term
Extension OTX EventHandling extension
Group Event source related terms
Exceptions OutOfBoundsException
Checker Rules -
Standard Compliant Yes

OTL Syntax

EventSourceTerm EventHandling.TimerExpiredEventSource(NumericTerm timeOut);

Description

The OTX TimerExpiredEventSource term will create an event source that produces an event when a specified time expires. If the specified time expires, the timer expiry event is produced and put into the event source's queue. Event queueing will start immediately once the event source is created.

if the timeout value is negative, the OutOfBoundsException exception will be thrown.

Return Value

The Term returns the value, see table below.

Icons Note.png In OTX, Terms are categorized according to its return data type!
Data Type Description
EventSource The EventSource, the timing monitors.

Properties

Name Data Type Class Default Cardinality Description
TimeOut Numeric Term - [1] This element specifies an Integer value that is interpreted as a time in milli-seconds to wait. Float values will be truncated.

OTL Examples

/// Local Declarations

EventHandling.EventSource EventSource1;
Integer Variable1;
EventHandling.Event Event1;

/// Flow

EventSource1 = EventHandling.TimerExpiredEventSource(1000);

parallel
{
   lane
   {
      while (true) : Loop0
      {
         Variable1 = Variable1 + 1;
      }
   }
   lane
   {
      EventHandling.WaitForEvent({EventSource1}, Event1);

      terminateLanes;
   }
}

See also

ThresholdExceededEventSource
MonitorChangeEventSource
WaitForEvent