|
||||||||||
| 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
com.cosylab.epics.caj.cas.util.examples.CounterProcessVariable
public class CounterProcessVariable
Example implementation of process variable - counter.
Counter starts counting at startValue incrementing by incrementValue every periodInMS milliseconds.
When counter value riches envValue counter is reset to startValue.
Implementation also triggers alarms (seting status and severity) regarding to set warning and alarm limits.
| Field Summary | |
|---|---|
protected int |
endValue
Counter end (stop) value. |
protected int |
incrementValue
Increment value (counter stepping). |
protected Number |
lowerAlarmValue
Lower alarm value. |
protected Number |
lowerControlValue
Lower control value (= start value). |
protected Number |
lowerDisplayValue
Lower display value (= start value). |
protected Number |
lowerWarningValue
Lower warning value. |
protected int |
periodInMS
Period between value increments. |
protected gov.aps.jca.dbr.Severity |
severity
Value status severity. |
protected int |
startValue
Counter start value. |
protected gov.aps.jca.dbr.Status |
status
Value status. |
protected gov.aps.jca.dbr.TimeStamp |
timestamp
Timestamp of last value change. |
protected Number |
upperAlarmValue
Upper alarm value. |
protected Number |
upperControlValue
Upper control value (= end value). |
protected Number |
upperDisplayValue
Upper display value (= end value). |
protected Number |
upperWarningValue
Upper warning value. |
protected int |
value
Counter value. |
| Fields inherited from class gov.aps.jca.cas.ProcessVariable |
|---|
ackS, ackT, channelCount, eventCallback, interest, name |
| Constructor Summary | |
|---|---|
CounterProcessVariable(String name,
gov.aps.jca.cas.ProcessVariableEventCallback eventCallback,
int startValue,
int endValue,
int incrementValue,
int periodInMS,
int lowerWarningValue,
int upperWarningValue,
int lowerAlarmValue,
int upperAlarmValue)
Construct a counter PV instance. |
|
| Method Summary | |
|---|---|
protected void |
checkForAlarms()
Checks for alarms (sets status and severity). |
protected void |
fillInStatusAndTime(gov.aps.jca.dbr.TIME timeDBR)
Fill-in status and time 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. |
gov.aps.jca.dbr.DBRType |
getType()
Return DBRType.INT type as native type. |
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. |
protected void |
initialize()
Initialize PV. |
protected gov.aps.jca.CAStatus |
readValue(gov.aps.jca.dbr.DBR value,
gov.aps.jca.cas.ProcessVariableReadCallback asyncReadCallback)
Read value. |
void |
run()
Couting (external trigger) is done in this separate thread. |
protected gov.aps.jca.CAStatus |
writeValue(gov.aps.jca.dbr.DBR value,
gov.aps.jca.cas.ProcessVariableWriteCallback asyncWriteCallback)
Write value. |
| Methods inherited from class com.cosylab.epics.caj.cas.util.NumericProcessVariable |
|---|
fillInDBR, read, write |
| Methods inherited from class gov.aps.jca.cas.ProcessVariable |
|---|
createChannel, destroy, getAckS, getDimensionSize, getEnumLabels, getEventCallback, getMaxDimension, getName, 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 |
| Field Detail |
|---|
protected int startValue
protected int endValue
protected int incrementValue
protected int periodInMS
protected Number lowerWarningValue
protected Number upperWarningValue
protected Number lowerAlarmValue
protected Number upperAlarmValue
protected Number lowerDisplayValue
protected Number upperDisplayValue
protected Number lowerControlValue
protected Number upperControlValue
protected int value
protected gov.aps.jca.dbr.TimeStamp timestamp
protected gov.aps.jca.dbr.Status status
protected gov.aps.jca.dbr.Severity severity
| Constructor Detail |
|---|
public CounterProcessVariable(String name,
gov.aps.jca.cas.ProcessVariableEventCallback eventCallback,
int startValue,
int endValue,
int incrementValue,
int periodInMS,
int lowerWarningValue,
int upperWarningValue,
int lowerAlarmValue,
int upperAlarmValue)
name - PV name.eventCallback - event callback, where to report value change events.startValue - counter start value, where to start counting.endValue - counter end value, where to stop counting.incrementValue - counter increment value, count steps.periodInMS - period in milliseconds between two increments.lowerWarningValue - lower warning limit value.upperWarningValue - upper warning limit value.lowerAlarmValue - lower alarm limit value.upperAlarmValue - upper alarm limit value.| Method Detail |
|---|
protected void initialize()
protected void checkForAlarms()
status and severity).
public gov.aps.jca.dbr.DBRType getType()
DBRType.INT type as native type.
getType in class gov.aps.jca.cas.ProcessVariableProcessVariable.getType()public Number getLowerAlarmLimit()
NumericProcessVariable
getLowerAlarmLimit in class NumericProcessVariablenon-null.NumericProcessVariable.getLowerAlarmLimit()public Number getLowerCtrlLimit()
NumericProcessVariable
getLowerCtrlLimit in class NumericProcessVariablenon-null.NumericProcessVariable.getLowerCtrlLimit()public Number getLowerDispLimit()
NumericProcessVariable
getLowerDispLimit in class NumericProcessVariablenon-null.NumericProcessVariable.getLowerDispLimit()public Number getLowerWarningLimit()
NumericProcessVariable
getLowerWarningLimit in class NumericProcessVariablenon-null.NumericProcessVariable.getLowerWarningLimit()public String getUnits()
NumericProcessVariable
getUnits in class NumericProcessVariablenon-null.NumericProcessVariable.getUnits()public Number getUpperAlarmLimit()
NumericProcessVariable
getUpperAlarmLimit in class NumericProcessVariablenon-null.NumericProcessVariable.getUpperAlarmLimit()public Number getUpperCtrlLimit()
NumericProcessVariable
getUpperCtrlLimit in class NumericProcessVariablenon-null.NumericProcessVariable.getUpperCtrlLimit()public Number getUpperDispLimit()
NumericProcessVariable
getUpperDispLimit in class NumericProcessVariablenon-null.NumericProcessVariable.getUpperDispLimit()public Number getUpperWarningLimit()
NumericProcessVariable
getUpperWarningLimit in class NumericProcessVariablenon-null.NumericProcessVariable.getUpperWarningLimit()
protected gov.aps.jca.CAStatus readValue(gov.aps.jca.dbr.DBR value,
gov.aps.jca.cas.ProcessVariableReadCallback asyncReadCallback)
throws gov.aps.jca.CAException
com.cosylab.epics.caj.cas.util.NumericProcessVariable#read() method.
readValue in class NumericProcessVariablegov.aps.jca.CAExceptionNumericProcessVariable.readValue(gov.aps.jca.dbr.DBR, gov.aps.jca.cas.ProcessVariableReadCallback)protected void fillInStatusAndTime(gov.aps.jca.dbr.TIME timeDBR)
timeDBR - DBR to fill-in.
protected gov.aps.jca.CAStatus writeValue(gov.aps.jca.dbr.DBR value,
gov.aps.jca.cas.ProcessVariableWriteCallback asyncWriteCallback)
throws gov.aps.jca.CAException
writeValue in class NumericProcessVariablegov.aps.jca.CAExceptionNumericProcessVariable.writeValue(gov.aps.jca.dbr.DBR, gov.aps.jca.cas.ProcessVariableWriteCallback)public void run()
run in interface RunnableRunnable.run()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||