|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgov.aps.jca.cas.ProcessVariable
com.cosylab.epics.caj.cas.util.NumericProcessVariable
public abstract class NumericProcessVariable
Enum process variable implementation. Implementation does not handle status, severity and alarms.
| Field Summary |
|---|
| Fields inherited from class gov.aps.jca.cas.ProcessVariable |
|---|
ackS, ackT, channelCount, eventCallback, interest, name |
| Constructor Summary | |
|---|---|
NumericProcessVariable(String name,
gov.aps.jca.cas.ProcessVariableEventCallback eventCallback)
Numeric PV constructor. |
|
| Method Summary | |
|---|---|
void |
fillInDBR(gov.aps.jca.dbr.DBR value)
Set data (units, limits, ...) to DBR. |
Number |
getLowerAlarmLimit()
Get lower alarm limit. |
Number |
getLowerCtrlLimit()
Get lower control limit. |
Number |
getLowerDispLimit()
Get lower display limit. |
Number |
getLowerWarningLimit()
Get lower warning limit. |
String |
getUnits()
Get units. |
Number |
getUpperAlarmLimit()
Get upper alarm limit. |
Number |
getUpperCtrlLimit()
Get upper control limit. |
Number |
getUpperDispLimit()
Get upper display limit. |
Number |
getUpperWarningLimit()
Get upper warning limit. |
gov.aps.jca.CAStatus |
read(gov.aps.jca.dbr.DBR value,
gov.aps.jca.cas.ProcessVariableReadCallback asyncReadCallback)
|
protected abstract gov.aps.jca.CAStatus |
readValue(gov.aps.jca.dbr.DBR value,
gov.aps.jca.cas.ProcessVariableReadCallback asyncReadCallback)
Read value. |
gov.aps.jca.CAStatus |
write(gov.aps.jca.dbr.DBR value,
gov.aps.jca.cas.ProcessVariableWriteCallback asyncWriteCallback)
|
protected abstract gov.aps.jca.CAStatus |
writeValue(gov.aps.jca.dbr.DBR value,
gov.aps.jca.cas.ProcessVariableWriteCallback asyncWriteCallback)
Write value. |
| Methods inherited from class gov.aps.jca.cas.ProcessVariable |
|---|
createChannel, destroy, getAckS, getDimensionSize, getEnumLabels, getEventCallback, getMaxDimension, getName, getType, interestDelete, interestRegister, isAckT, printInfo, printInfo, registerChannel, setAckS, setAckT, setEventCallback, unregisterChannel |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NumericProcessVariable(String name,
gov.aps.jca.cas.ProcessVariableEventCallback eventCallback)
name - process variable name.eventCallback - event callback, can be null.| Method Detail |
|---|
public String getUnits()
non-null.public Number getUpperDispLimit()
non-null.public Number getLowerDispLimit()
non-null.public Number getUpperAlarmLimit()
non-null.public Number getUpperWarningLimit()
non-null.public Number getLowerWarningLimit()
non-null.public Number getLowerAlarmLimit()
non-null.public Number getUpperCtrlLimit()
non-null.public Number getLowerCtrlLimit()
non-null.
public gov.aps.jca.CAStatus read(gov.aps.jca.dbr.DBR value,
gov.aps.jca.cas.ProcessVariableReadCallback asyncReadCallback)
throws gov.aps.jca.CAException
read in class gov.aps.jca.cas.ProcessVariablegov.aps.jca.CAExceptionpublic void fillInDBR(gov.aps.jca.dbr.DBR value)
isCTRLSupported returns true.
value - DBR to fill-in.
protected abstract gov.aps.jca.CAStatus readValue(gov.aps.jca.dbr.DBR value,
gov.aps.jca.cas.ProcessVariableReadCallback asyncReadCallback)
throws gov.aps.jca.CAException
{
// for async. completion, return null,
// set value (and status) to enumValue and
// report completion using asyncReadCallback callback.
// return null;
// BEGIN optional (to override defaults)
// set status and severity
value.setStatus(Status.);
value.setSeverity(Severity.);
// set timestamp
value.setTimestamp(timestamp);
// END optional (to override defaults)
// set value to given DBR (example of copying value for DOUBLE type process variable)
// given DBR has already allocated an array of elements client has requested
// it contains maximum number of elements to fill
double[] arrayValue = (DBR_Double)value.getDoubleValue();
int elementCount = Math.min(.length, arrayValue.length);
System.arraycopy(, 0, arrayValue, 0, elementCount);
// return read completion status
return CAStatus.NORMAL;
}
gov.aps.jca.CAExceptionProcessVariable.read(gov.aps.jca.dbr.DBR, gov.aps.jca.cas.ProcessVariableReadCallback)
public gov.aps.jca.CAStatus write(gov.aps.jca.dbr.DBR value,
gov.aps.jca.cas.ProcessVariableWriteCallback asyncWriteCallback)
throws gov.aps.jca.CAException
write in class gov.aps.jca.cas.ProcessVariablegov.aps.jca.CAException
protected abstract gov.aps.jca.CAStatus writeValue(gov.aps.jca.dbr.DBR value,
gov.aps.jca.cas.ProcessVariableWriteCallback asyncWriteCallback)
throws gov.aps.jca.CAException
{
// for async. completion, return null,
// set value (and status) from enumValue,
// notify if there is an interest and
// report completion using asyncWriteCallback callback.
// return null;
// set value from given DBR here
...
// notify, set appropirate Monitor mask (VALUE, LOG, ALARM)
if (status == CAStatus.NORMAL && interest)
{
DBR monitorDBR = AbstractCASResponseHandler.createDBRforReading(this);
((DBR_Double)monitorDBR).getDoubleValue()[0] = this.value;
fillInDBR(monitorDBR);
fillInStatusAndTime((TIME)monitorDBR);
eventCallback.postEvent(Monitor.VALUE|Monitor.LOG, value);
}
// return read completion status
return CAStatus.NORMAL;
}
gov.aps.jca.CAExceptionProcessVariable.write(gov.aps.jca.dbr.DBR, gov.aps.jca.cas.ProcessVariableWriteCallback)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||