Interface IDeviceInstanceTemplate
public interface IDeviceInstanceTemplate
Interface used to handle the device type instances available in the specifications file.
The methods described in this interface can be used by the Jython template developers to complete the logic templates.
The methods described in this interface can be used by the Jython template developers to complete the logic templates.
Note: The examples provided use the Jython syntax.
- Author:
- Ivan Prieto Barreiro
-
Method Summary
Modifier and TypeMethodDescriptionbooleandoesSpecificationAttributeExist(String attribute) Check if an specification attribute exists.getAttributeData(String theAttributeIdentifier) Returns the data associated with the instance attribute.research.ch.cern.unicos.utilities.IDeviceTypeMethod used to get the device type of the current instance.Method used to get the device type name of the current instance.intGet the number of the current instance as defined in the specifications file.
-
Method Details
-
getDeviceType
research.ch.cern.unicos.utilities.IDeviceType getDeviceType()Method used to get the device type of the current instance.- Returns:
- The device type of the current instance.
- See Also:
-
getDeviceTypeName
String getDeviceTypeName()Method used to get the device type name of the current instance.- Returns:
- The device type name of the current instance.
- See Also:
-
getInstanceNumber
int getInstanceNumber()Get the number of the current instance as defined in the specifications file.- Returns:
- The instance number as defined in the specifications file.
-
doesSpecificationAttributeExist
Check if an specification attribute exists.- Parameters:
attribute- The attribute to check. E.g. "DeviceIdentification:Name"- Returns:
- TRUE if and only if the specification attribute exists
-
getAttributeData
Returns the data associated with the instance attribute.Example: Display the name of all the DigitalInput instances.
# Get the DigitalInput device type diDeviceType = theUnicosProject.getDeviceType("DigitalInput") # Get a vector with all the DigitalInput instances diInstances = diDeviceType.getAllDeviceTypeInstances() # Display the name of all the DigitalInput instances in the UAB log file (as a debug message) for instance in diInstances: thePlugin.writeDebugInUABLog(instance.getAttributeData("DeviceIdentification:Name"))- Parameters:
theAttributeIdentifier- The instance attribute (e.g. DeviceIdentification:Name")- Returns:
- The data associated with the attribute as defined in the specifications file.
-