Interface IDeviceTypeTemplate
public interface IDeviceTypeTemplate
Interface used to handle the device types 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.List<research.ch.cern.unicos.utilities.IDeviceInstance> Method used to get a vector containing all the instances of the device type.Get the device type description as specified in the device type sheet.research.ch.cern.unicos.utilities.IDeviceInstancegetDeviceTypeInstance(int instanceNumber) Method used to get a device type instance by its instance number.Method used to get the device type name.Method used to get the ObjectTypeFamily from the device type definition.Method used to get the name of the package which the device belongs to (CPC, CRYO, ...).List<research.ch.cern.unicos.utilities.ISpecificationAttribute> Get the list of specification attributes (e.g.: DeviceIdentification:Name, DeviceIdentification:Expert Name, ...)
-
Method Details
-
getAllDeviceTypeInstances
List<research.ch.cern.unicos.utilities.IDeviceInstance> getAllDeviceTypeInstances()Method used to get a vector containing all the instances of the device type.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"))- Returns:
- A vector containing all the instances of the device type.
- See Also:
-
getDeviceTypeInstance
research.ch.cern.unicos.utilities.IDeviceInstance getDeviceTypeInstance(int instanceNumber) Method used to get a device type instance by its instance number.Example: Get the instance number 5 of the DigitalInput device type.
# Get the DigitalInput device type diDeviceType = theUnicosProject.getDeviceType("DigitalInput") # Get the DigitalInput instance number 5 diInstance = diDeviceType.getDeviceTypeInstance(5) # Display the name of the DigitalInput instance in the UAB log file (as a debug message) thePlugin.writeDebugInUABLog(diInstance.getAttributeData("DeviceIdentification:Name"))- Parameters:
instanceNumber- The instance number.- Returns:
- The requested instance object as specified by the user if it exists, otherwise null.
- See Also:
-
getDeviceTypeName
String getDeviceTypeName()Method used to get the device type name.- Returns:
- A String containing the device type name.
-
getPackageName
String getPackageName()Method used to get the name of the package which the device belongs to (CPC, CRYO, ...).- Returns:
- A String containing the package name.
-
getObjectType
String getObjectType()Method used to get the ObjectTypeFamily from the device type definition.- Returns:
- A String containing the family type of the device type.
Currently, the available families are:
- IOObjectFamily
- InterfaceObjectFamily
- FieldObjectFamily
- ControlObjectFamily
-
getDescription
String getDescription()Get the device type description as specified in the device type sheet.- Returns:
- A String containing the device type description if exists, otherwise an empty string.
-
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
-
getSpecificationAttributes
List<research.ch.cern.unicos.utilities.ISpecificationAttribute> getSpecificationAttributes()Get the list of specification attributes (e.g.: DeviceIdentification:Name, DeviceIdentification:Expert Name, ...)- Returns:
- - The list of specification attributes
-