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
cycleTypeString or intCycle type condition.
timingEventStringTiming event.
timeOutdouble A time out value for I/O methods execution, in seconds.
countintUser-specified number of values to return.
referenceKeyStringReference value set identifier
onChangeanyIf present, the "on-change" mode is active for monitors

Constructors use the following system properties: (this list should later be made configurable)


Constructor Summary
DeviceContext()
           
DeviceContext(Data d)
           
 
Method Summary
 Data getData()
           
static DeviceContext getDefault()
           
static DeviceContext getDefault(java.lang.String name)
           
 int getSequenceNumber()
           
 void setCycleType(java.lang.String cycleType)
          Stores a cycle type selection into this DeviceContext.
 void setData(Data d)
           
static void setDefault(DeviceContext ctx)
           
static void setDefault(java.lang.String name, DeviceContext ctx)
           
 void setReferenceKey(java.lang.String referenceKey)
          Stores a referenceKey (archive name) selection into this DeviceContext.
 void setTimeOut(double timeOut)
          Stores a timeOut value into this DeviceContext.
 void setTimingEvent(java.lang.String timingEvent)
          Stores a timing event selection into this DeviceContext.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeviceContext

public DeviceContext()

DeviceContext

public DeviceContext(Data d)
Method Detail

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.