public abstract class ProcessVariable extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Severity |
ackS
Alarm Acknowledge Severity.
|
protected boolean |
ackT
Alarm Acknowledge Transient.
|
protected int |
channelCount
Channel count (number of clients).
|
protected ProcessVariableEventCallback |
eventCallback
Process variable event callback.
|
protected boolean |
interest
Interess flag.
|
protected String |
name
Process variable name.
|
| Constructor and Description |
|---|
ProcessVariable(String name,
ProcessVariableEventCallback eventCallback)
Create process variable with given name.
|
| Modifier and Type | Method and Description |
|---|---|
ServerChannel |
createChannel(int cid,
int sid,
String userName,
String hostName)
This method is called each time that a PV is attached to by a client.
|
void |
destroy()
Destory process variable.
|
Severity |
getAckS()
Get acknowledged alarm severity.
|
int |
getDimensionSize(int dimension)
The method
getDimensionSize(dimension) returns the maximum
number of elements in a particular dimension of the hypercube as follows: |
String[] |
getEnumLabels()
Get enum string labels.
|
ProcessVariableEventCallback |
getEventCallback()
Get event callback.
|
int |
getMaxDimension()
Returns the maximum bounding box for all present and future data stored
within the PV.
|
String |
getName()
Get process variable name.
|
abstract DBRType |
getType()
The best type for clients to use when accessing the value of the PV.
|
void |
interestDelete()
Called by the server library each time that it wishes to remove its
subscription for PV value change events from the server tool via
ProcessVariableEventCallback.postEvent() method. |
void |
interestRegister()
Called by the server libary each time that it wishes to subscribe for PV
change notification from the server tool via
ProcessVariableEventCallback.postEvent() method. |
boolean |
isAckT()
Get acknowledged alarm transient flag.
|
void |
printInfo()
Prints detailed information about the Context to the standard output
stream.
|
void |
printInfo(PrintStream out)
Prints detailed information about the Context to the specified output
stream.
|
abstract CAStatus |
read(DBR value,
ProcessVariableReadCallback asyncReadCallback)
Read process variable value.
|
void |
registerChannel(ServerChannel channel)
Register channel to this process variable.
|
void |
setAckS(Severity ackS)
Set acknowledged alarm severity.
|
void |
setAckT(boolean ackT)
Set acknowledged alarm transient flag.
|
void |
setEventCallback(ProcessVariableEventCallback eventCallback)
Set event callback.
|
void |
unregisterChannel(ServerChannel channel)
Unregister channel from this process variable.
|
abstract CAStatus |
write(DBR value,
ProcessVariableWriteCallback asyncWriteCallback)
Write process variable value.
|
protected String name
protected ProcessVariableEventCallback eventCallback
protected volatile boolean interest
interestRegister()protected int channelCount
protected volatile Severity ackS
protected volatile boolean ackT
public ProcessVariable(String name, ProcessVariableEventCallback eventCallback)
name - process variable name.eventCallback - event callback, can be null.public String getName()
public abstract DBRType getType()
public int getMaxDimension()
getDimensionCount() returns the maximum number
of dimensions in the hypercube (0=scalar, 1=array, 2=plane, 3=cube ...).
The default (base) "getDimensionCount()" returns zero (scalar).
Clients will see that the PV's data is scalar if these routines are not
supplied in the derived class.
If the "dimension" argument to getDimensionSize() is set to zero then the
bound on the first dimension is being fetched. If the "dimension"
argument to getDimensionSize() is set to one then the bound on the second
dimension are being fetched...public int getDimensionSize(int dimension)
getDimensionSize(dimension) returns the maximum
number of elements in a particular dimension of the hypercube as follows:
scalar - getDimensionCount() returns 0
array - getDimensionCount() returns 1
getDimensionSize(0) supplies number of elements in array
plane - getDimensionCount() returns 2
getDimensionSize(0) supplies number of elements in X dimension
getDimensionSize(1) supplies number of elements in Y dimension
cube - getDimensionCount() returns 3
getDimensionSize(0) supplies number of elements in X dimension
getDimensionSize(1) supplies number of elements in Y dimension
getDimensionSize(2) supplies number of elements in Z dimension
...
The default (base) "getDimensionSize()" returns one (scalar bounds) for
all dimensions.dimension - dimension for which to fecth its size.public String[] getEnumLabels()
ENUM it should
override this method and return labels.public Severity getAckS()
public void setAckS(Severity ackS)
ackS - acknowledged alarm severity to set.public boolean isAckT()
public void setAckT(boolean ackT)
ackT - acknowledged alarm transient flag to setpublic void interestRegister()
ProcessVariableEventCallback.postEvent() method.public void interestDelete()
ProcessVariableEventCallback.postEvent() method.public abstract CAStatus read(DBR value, ProcessVariableReadCallback asyncReadCallback) throws CAException
The incoming DBR value is always (at least) of type DBR_TIME_[type] where type
is of getType(). If DBR_GR_value is instance of requested type.
Special cases:
DBR_TIME_Enum type is "upgraded" to an "artificial" TIME type DBR_TIME_LABELS_Enum.
This enables PV to set labels and time.
DBR_TIME_Double and DBR_TIME_Float are "upgraded" to an "artificial" TIME
type which also implements PRECISION interface, DBR_PRECISION_Double and DBR_PRECISION_Float.
This enables PV to set precision (-1, by default, means no precision set).
value - value of type (at least) DBR_TIME_getType().asyncReadCallback - if asynchronous completion is required method should return
null and call
ProcessVariableReadCallback.processVariableReadCompleted() method.null if request will complete
asynchronously by calling method.CAExceptionpublic abstract CAStatus write(DBR value, ProcessVariableWriteCallback asyncWriteCallback) throws CAException
getType().value - value of type getType().asyncWriteCallback - if asynchronous completion is required method should return
null and call
ProcessVariableWriteCallback.processVariableWriteCompleted() method.null if request will complete
asynchronously by calling method.CAExceptionpublic ServerChannel createChannel(int cid, int sid, String userName, String hostName) throws CAException
cid - channel CID.sid - channel SID.userName - client user name.hostName - client host name.ServerChannel instance.CAExceptionpublic void registerChannel(ServerChannel channel)
channel - channel to register.public void unregisterChannel(ServerChannel channel)
channel - channel to unregister.public void destroy()
public void printInfo()
throws IllegalStateException
IllegalStateException - if the context has been destroyed.public void printInfo(PrintStream out) throws IllegalStateException
out - the output stream.IllegalStateException - if the context has been destroyed.public ProcessVariableEventCallback getEventCallback()
public void setEventCallback(ProcessVariableEventCallback eventCallback)
eventCallback - the eventCallback to setCopyright © 2004-2020 EPICS. All Rights Reserved.