cdev
Class DeviceContext
java.lang.Object
|
+--cdev.DeviceContext
- public class DeviceContext
- extends java.lang.Object
The DeviceContext class provides the encapsulation into an object of the parameters
that condition the execution of the I/O methods (analogous to a graphics context for screen I/O).
Devices can (and do by default) share the same DeviceContext.
A default DeviceContext is provided for an "application", based on the thread group name.
The DeviceContext is implemented as a cdev.Data, a collection of name-value pairs, and a context
number which changes whenever any of the entries change.
This class includes a static device context which has a number of flags (entries with value=1)
preset to force a read of a property to also retrieve a large number of characteristics
(limits, units, etc.).
Convenience routines have been created to manipulate a number of commonly used flags:
Valid tags | Data type | Usage |
cycleType | String or int | Cycle type condition. |
timingEvent | String | Timing event. |
timeOut | double | A time out value for I/O methods execution, in seconds. |
count | int | User-specified number of values to return. |
referenceKey | String | Reference value set identifier |
onChange | any | If present, the "on-change" mode is active for monitors |
Constructors use the following system properties: (this list should later be made configurable)
- cdev.context.cycleType
- cdev.context.onChange
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
DeviceContext
public DeviceContext()
DeviceContext
public DeviceContext(Data d)
setDefault
public static void setDefault(DeviceContext ctx)
setDefault
public static void setDefault(java.lang.String name,
DeviceContext ctx)
getDefault
public static DeviceContext getDefault()
getDefault
public static DeviceContext getDefault(java.lang.String name)
setData
public void setData(Data d)
getData
public Data getData()
getSequenceNumber
public int getSequenceNumber()
setCycleType
public void setCycleType(java.lang.String cycleType)
- Stores a cycle type selection into this DeviceContext.
Checks first if new selection.
setTimingEvent
public void setTimingEvent(java.lang.String timingEvent)
- Stores a timing event selection into this DeviceContext.
Checks first if new selection.
setReferenceKey
public void setReferenceKey(java.lang.String referenceKey)
- Stores a referenceKey (archive name) selection into this DeviceContext.
Checks first if new selection.
setTimeOut
public void setTimeOut(double timeOut)
- Stores a timeOut value into this DeviceContext.
Checks first if new value.