Difference between revisions of "Extensions.Measure.GetDeviceServiceNameFromEvent"
Jump to navigation
Jump to search
(Created page with "Category:Measure == Classification == {{ClassificationActivity | GetDeviceServiceNameFromEvent | Returns a string that contains the name of the device and services | Ter...") |
|||
Line 3: | Line 3: | ||
{{ClassificationActivity | GetDeviceServiceNameFromEvent | Returns a string that contains the name of the device and services | [[Term]] | [[Measure|OTX Measure extension]] | [[Event related terms]] | - | - }} | {{ClassificationActivity | GetDeviceServiceNameFromEvent | Returns a string that contains the name of the device and services | [[Term]] | [[Measure|OTX Measure extension]] | [[Event related terms]] | - | - }} | ||
− | == | + | == OTL Syntax == |
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | + | StringTerm = Measure.GetDeviceServiceNameFromEvent(EventTerm); | |
</syntaxhighlight> | </syntaxhighlight> | ||
Line 21: | Line 21: | ||
|} | |} | ||
− | == Examples == | + | == OTL Examples == |
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | String | + | 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; | ||
+ | String DeviceName; | ||
+ | |||
+ | 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); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | DeviceName = Measure.GetDeviceServiceNameFromEvent(Event); | ||
+ | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 09:43, 10 February 2015
Contents
Classification
Name | GetDeviceServiceNameFromEvent |
Short Description | Returns a string that contains the name of the device and services |
Class | Term |
Extension | OTX Measure extension |
Group | Event related terms |
Exceptions | - |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
StringTerm = Measure.GetDeviceServiceNameFromEvent(EventTerm);
Description
An event object accepts the GetDeviceServiceNameFromEvent term and returns a string that contains the device - and service name of the device and the service, which caused the event. By using this term can wait a sequence of OTX for an event from a device when receiving a new result and then decide which service of the device caused the event.
The string value that is returned will consist of two parts: "devicename.ServiceName", where devicename and servicename is the name as specified by the corresponding DeviceSignature has.
Return Value
The Term returns the value, see table below.
![]()
In OTX, Terms are categorized according to its return data type!
Data Type | Description |
String | The string that contains the name of the device and services. |
Properties
Name | Data Type | Class | Default | Cardinality | Description |
Event | Event | Term | - | [1] | The event that is raised after the execution of a device services. |
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;
String DeviceName;
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);
}
}
DeviceName = Measure.GetDeviceServiceNameFromEvent(Event);
}