Difference between revisions of "Extensions.Measure.IsDeviceEvent"

From emotive
Jump to navigation Jump to search
 
(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:'''IsDeviceEvent '''}}[[Category:Measure]]
 
{{DISPLAYTITLE:'''IsDeviceEvent '''}}[[Category:Measure]]
 
== Classification ==
 
== Classification ==
{{ClassificationActivity | IsDeviceEvent | Checks whether the event originated from a '''DeviceEventSource''' term | [[Term]] | [[Extensions.Measure|OTX Measure extension]] | [[Event related terms]] | - | - }}
+
{{ClassificationActivity | IsDeviceEvent | Checks whether the event originated from a '''DeviceEventSource''' term or not.| [[Term]] | [[Extensions.Measure|OTX Measure extension]] | [[Extensions.Measure#Terms|Event related terms]] | - | - }}
  
 
== OTL Syntax ==
 
== OTL Syntax ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
BooleanTerm = Measure.IsDeviceEvent(EventTerm);
+
BooleanTerm Measure.IsDeviceEvent(EventValue event);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
== Description ==
 
== Description ==
The term will return TRUE if if the event originated from a ''DeviceEventSource'' term.
+
The '''IsDeviceEvent''' term will return '''true''' if and only if the Event originates from a [[Extensions.Measure.DeviceEventSource|DeviceEventSource]] term.
  
{{TermReturnValue| [[Core.DataTypes.SimpleDataType.Boolean|Boolean]] | This value is TRUE if if the event originated from a DeviceEventSource term. }}
+
{{TermReturnValue| [[Core.DataTypes.SimpleDataType.Boolean|Boolean]] | This value is TRUE if and only if the event originated from a '''DeviceEventSource''' term. }}
  
 
== Properties ==
 
== Properties ==
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| Event | [[Extensions.EventHandling.Event|Event]] | [[Term]] | - | [1] | The event, whose Type is checked.}}
+
{{TableRowPropertie2| Event | [[Extensions.EventHandling.Event|Event]] | [[Value]] | - | [1] | Represents the '''Event''' whose type will be tested.}}
 
|}
 
|}
  
 
== OTL Examples ==
 
== OTL Examples ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
package Measure.DeviceSignature TestDocument
+
/// Signatures
 +
 
 +
package Measure.DeviceSignature DeviceSignature1
 
{
 
{
  DeviceServiceSignature Addition(in Integer a, in Integer b, out Measure.Measurement OutValue);
+
Measure.DeviceServiceSignature Add(in Integer a, out Measure.Measurement Measurement);
 
}
 
}
  
public procedure IsDeviceEvent()
+
/// Global Declarations
 +
 
 +
public procedure main()
 
{
 
{
  EventHandling.EventSource EventSource;
+
/// Local Declarations
  Measure.Measurement Addition_Return;
+
 
  EventHandling.Event Event;
+
Measure.Measurement Measurement1;
  Boolean IsDeviceEvent = false;
+
Integer a1 = 10;
 +
EventHandling.EventSource EventSource1;
 +
EventHandling.Event Event1;
 +
Boolean Boolean1 = false;
  
  EventSource = Measure.DeviceEventSource(TestDocument);
+
/// Flow
  
  parallel
+
EventSource1 = Measure.DeviceEventSource(DeviceSignature1);
  {
 
      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);
+
parallel
 +
{
 +
lane
 +
{
 +
Measure.ExecuteDeviceService(DeviceSignature1, Add, {a = a1, Measurement = Measurement1}, false, false);
 +
}
 +
lane
 +
{
 +
EventHandling.WaitForEvent({EventSource1}, Event1);
 +
}
 +
}
 +
Boolean1 = Measure.IsDeviceEvent(Event1);
 
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 02:56, 13 September 2019

Classification

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

OTL Syntax

BooleanTerm Measure.IsDeviceEvent(EventValue event);

Description

The IsDeviceEvent term will return true if and only if the Event originates 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 and only if the event originated from a DeviceEventSource term.

Properties

Name Data Type Class Default Cardinality Description
Event Event Value - [1] Represents the Event whose type will be tested.

OTL Examples

/// Signatures

package Measure.DeviceSignature DeviceSignature1
{
	Measure.DeviceServiceSignature Add(in Integer a, out Measure.Measurement Measurement);
}

/// Global Declarations

public procedure main()
{
	/// Local Declarations

	Measure.Measurement Measurement1;
	Integer a1 = 10;
	EventHandling.EventSource EventSource1;
	EventHandling.Event Event1;
	Boolean Boolean1 = false;

	/// Flow

	EventSource1 = Measure.DeviceEventSource(DeviceSignature1);

	parallel
	{
		lane
		{
			Measure.ExecuteDeviceService(DeviceSignature1, Add, {a = a1, Measurement = Measurement1}, false, false);
		}
		lane
		{
			EventHandling.WaitForEvent({EventSource1}, Event1);
		}
	}
	Boolean1 = Measure.IsDeviceEvent(Event1);
}

See also

DeviceEventSource
GetDeviceServiceNameFromEvent