Difference between revisions of "Extensions.Measure.IsDeviceEvent"

From emotive
Jump to navigation Jump to search
(Created page with "Category:Measure == Classification == {{ClassificationActivity | IsDeviceEvent | Checks whether the event originated from a '''DeviceEventSource''' term | Term | Mea...")
 
Line 3: Line 3:
 
{{ClassificationActivity | IsDeviceEvent | Checks whether the event originated from a '''DeviceEventSource''' term | [[Term]] | [[Measure|OTX Measure extension]] | [[Event related terms]] | - | - }}
 
{{ClassificationActivity | IsDeviceEvent | Checks whether the event originated from a '''DeviceEventSource''' term | [[Term]] | [[Measure|OTX Measure extension]] | [[Event related terms]] | - | - }}
  
== Pseudo-Code Syntax ==
+
== OTL Syntax ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
Boolean IsDeviceEvent(Event event);
+
BooleanTerm = Measure.IsDeviceEvent(EventTerm);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 19: Line 19:
 
|}
 
|}
  
== Examples ==
+
== OTL Examples ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
Boolean result = IsDeviceEvent(myEvent);
+
package Measure.DeviceSignature TestDocument
 +
{
 +
  DeviceServiceSignature Addition(in Integer a, in Integer b, out Measure.Measurement OutValue);
 +
}
 +
 
 +
public procedure IsDeviceEvent()
 +
{
 +
  EventHandling.EventSource EventSource;
 +
  Measure.Measurement Addition_Return;
 +
  EventHandling.Event Event;
 +
  Boolean IsDeviceEvent = false;
 +
 
 +
  EventSource = Measure.DeviceEventSource(TestDocument);
 +
 
 +
  parallel
 +
  {
 +
      lane
 +
      {
 +
        EventHandling.WaitForEvent({EventSource}, Event);
 +
      }
 +
      lane
 +
      {
 +
Measure.ExecuteDeviceService(TestDocument, Addition, {in a = 2, in b = 3, out OutValue = Addition_Return}, false, false);
 +
      }
 +
  }
 +
 
 +
  IsDeviceEvent = Measure.IsDeviceEvent(Event);
 +
}
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Revision as of 09:41, 10 February 2015

Classification

Name IsDeviceEvent
Short Description Checks whether the event originated from a DeviceEventSource term
Class Term
Extension OTX Measure extension
Group Event related terms
Exceptions -
Checker Rules -
Standard Compliant Yes

OTL Syntax

BooleanTerm = Measure.IsDeviceEvent(EventTerm);

Description

The term will return TRUE if if the event originated from a DeviceEventSource term.

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
Boolean This value is TRUE if if the event originated from a DeviceEventSource term.

Properties

Name Data Type Class Default Cardinality Description
Event Event Term - [1] The event, whose Type is checked.

OTL Examples

package Measure.DeviceSignature TestDocument
{
   DeviceServiceSignature Addition(in Integer a, in Integer b, out Measure.Measurement OutValue);
}

public procedure IsDeviceEvent()
{
   EventHandling.EventSource EventSource;
   Measure.Measurement Addition_Return;
   EventHandling.Event Event;
   Boolean IsDeviceEvent = false;

   EventSource = Measure.DeviceEventSource(TestDocument);

   parallel
   {
      lane
      {
         EventHandling.WaitForEvent({EventSource}, Event);
      }
      lane
      {
	 Measure.ExecuteDeviceService(TestDocument, Addition, {in a = 2, in b = 3, out OutValue = Addition_Return}, false, false);
      }
   }

   IsDeviceEvent = Measure.IsDeviceEvent(Event);
}

See also

DeviceEventSource
GetDeviceServiceNameFromEvent