Class MemoryValueProcessor
java.lang.Object
org.scictrl.csshell.epics.server.processor.AbstractValueProcessor
org.scictrl.csshell.epics.server.processor.MemoryValueProcessor
- All Implemented Interfaces:
ValueProcessor
- Direct Known Subclasses:
CommandValueProcessor
,DefaultAlarmProcessor
,EnumValueProcessor
,ForwardValueProcessor
,HeartbeatValueProcessor
,InterlockValueProcessor
,LinkedValueProcessor
,ManagementProcessor
,MemorySwitchValueProcessor
,PolyTransValueProcessor
,RunningAverageValueProcessor
,SemaphoreProcessor
,SimAlarmProcessor
,TimeCounterProcessor
,TimeValueProcessor
,UpdateRateProcessor
,ValueCheckProcessor
MemoryValueProcessor class.
- Author:
- igor@scictrl.com
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Value is fixed.protected gov.aps.jca.dbr.TimeStamp
Timestamp of last value change.protected gov.aps.jca.dbr.TimeStamp
Timestamp of last value update.protected Object
Value held by this processor.Fields inherited from class org.scictrl.csshell.epics.server.processor.AbstractValueProcessor
log, record, trigger, type
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Updates the timestamp and fires value update event, if processor has value other thannull
.protected boolean
_setValue
(boolean value, gov.aps.jca.dbr.Severity severity, gov.aps.jca.dbr.Status status, boolean notify) Internal set: sets new value to this processor.protected boolean
_setValue
(boolean value, gov.aps.jca.dbr.Severity severity, gov.aps.jca.dbr.Status status, boolean notify, boolean force) Internal set: sets new value to this processor.protected boolean
_setValue
(Object value, gov.aps.jca.dbr.Severity severity, gov.aps.jca.dbr.Status status, boolean notify) Internal set: sets new value to this processor.protected boolean
_setValue
(Object value, gov.aps.jca.dbr.Severity severity, gov.aps.jca.dbr.Status status, boolean notify, boolean force) Internal set: sets new value to this processor.void
activate()
Record has now reference to Database.void
Configures the internals of value processor, provides reference to parent record and to configuration with root inside processor tag.protected Object
convert.gov.aps.jca.dbr.TimeStamp
Returns timestamp of last value change.gov.aps.jca.dbr.TimeStamp
Timestamp indicates last time value has been updated or confirmed.getValue()
getValue.boolean
getValueAsBoolean.boolean
isFixed()
isFixed.static final AbstractValueProcessor
newBooleanProcessor
(String name, String description, boolean value, boolean fixed, boolean undefined) newBooleanProcessor.static final AbstractValueProcessor
newDoubleProcessor
(String name, String description, double value, boolean fixed) newDoubleProcessor.static final AbstractValueProcessor
newProcessor
(String name, gov.aps.jca.dbr.DBRType type, int count, String description, Object value, boolean fixed, boolean undefined) newProcessor.static final AbstractValueProcessor
newProcessor
(String name, gov.aps.jca.dbr.DBRType type, int count, String description, Object value, boolean fixed, Number min, Number max, String units, short precision) newProcessor.void
setFixed
(boolean fixed) Setter for the fieldfixed
.void
Sets new value to the processor.Methods inherited from class org.scictrl.csshell.epics.server.processor.AbstractValueProcessor
getName, getRecord, getTrigger, getType, process, toString
-
Field Details
-
value
Value held by this processor. -
fixed
protected boolean fixedValue is fixed. -
timestamp
protected gov.aps.jca.dbr.TimeStamp timestampTimestamp of last value update. -
lastChangeTimestamp
protected gov.aps.jca.dbr.TimeStamp lastChangeTimestampTimestamp of last value change.
-
-
Constructor Details
-
MemoryValueProcessor
public MemoryValueProcessor()Constructor for MemoryValueProcessor.
-
-
Method Details
-
newDoubleProcessor
public static final AbstractValueProcessor newDoubleProcessor(String name, String description, double value, boolean fixed) newDoubleProcessor.
- Parameters:
name
- aString
objectdescription
- aString
objectvalue
- a doublefixed
- a boolean- Returns:
- a
AbstractValueProcessor
object
-
newBooleanProcessor
public static final AbstractValueProcessor newBooleanProcessor(String name, String description, boolean value, boolean fixed, boolean undefined) newBooleanProcessor.
- Parameters:
name
- aString
objectdescription
- aString
objectvalue
- a booleanfixed
- a booleanundefined
- a boolean- Returns:
- a
AbstractValueProcessor
object
-
newProcessor
public static final AbstractValueProcessor newProcessor(String name, gov.aps.jca.dbr.DBRType type, int count, String description, Object value, boolean fixed, boolean undefined) newProcessor.
- Parameters:
name
- aString
objecttype
- aDBRType
objectcount
- a intdescription
- aString
objectvalue
- aObject
objectfixed
- a booleanundefined
- a boolean- Returns:
- a
AbstractValueProcessor
object
-
newProcessor
public static final AbstractValueProcessor newProcessor(String name, gov.aps.jca.dbr.DBRType type, int count, String description, Object value, boolean fixed, Number min, Number max, String units, short precision) newProcessor.
-
getTimestamp
public gov.aps.jca.dbr.TimeStamp getTimestamp()Timestamp indicates last time value has been updated or confirmed. This does not necessary means value change.- Returns:
- a
TimeStamp
object
-
setValue
Sets new value to the processor. If value is different from current processor value, then event is fired. Timestamp is updated regardless if value is changed, since timestamp indicates last value update or confirmation. This method is used by remote EPICS entity or other record within same Database. By definition calling setValue must always update value, because further processing must be triggered.- Parameters:
value
- aObject
object
-
_setValue
protected boolean _setValue(Object value, gov.aps.jca.dbr.Severity severity, gov.aps.jca.dbr.Status status, boolean notify) Internal set: sets new value to this processor. It checks if it is fixed, it never sets fixed value. Fires value update event only if value was changes and notify is true. If value was not changed, update is not forced. If the value is not an array it tries to convert it to a single element array. Updates timestamp. If required fires notify event.- Parameters:
value
- value to be setseverity
- the severity to be used together with the value update. Ifnull
no alarm update is fired.status
- the status to be used together with the value update. Ifnull
no alarm update is fired.notify
- iftrue
fire notify event if value was change,false
suppresses events- Returns:
- true if value was updated, regardless if based on difference or force
-
_setValue
protected boolean _setValue(Object value, gov.aps.jca.dbr.Severity severity, gov.aps.jca.dbr.Status status, boolean notify, boolean force) Internal set: sets new value to this processor. It checks if it is fixed, it never sets fixed value. Fires value update event only if value was changes and notify is true. If force is true, then updates value and fires notify, if notify is true, even if value was not changed. If the value is not an array it tries to convert it to a single element array. Updates timestamp. If required fires notify event.- Parameters:
value
- value to be setseverity
- the severity to be used together with the value update. Ifnull
no alarm update is fired.status
- the status to be used together with the value update. Ifnull
no alarm update is fired.notify
- iftrue
fire notify event if value was change,false
suppresses eventsforce
- iftrue
it will update value and timestamp even if there is not new value and proceeds with notify- Returns:
- true if value was updated, regardless if based on difference or force
-
convert
convert.
-
_forceValueUpdateEvent
protected boolean _forceValueUpdateEvent()Updates the timestamp and fires value update event, if processor has value other thannull
.- Returns:
- true if update was fired
-
_setValue
protected boolean _setValue(boolean value, gov.aps.jca.dbr.Severity severity, gov.aps.jca.dbr.Status status, boolean notify) Internal set: sets new value to this processor. It checks if it is fixed, it never sets fixed value. Fires value update event only if value was changes and notify is true. If force is true, then updates value and fires notify, if notify is true, even if value was not changed. If the value is not an array it tries to convert it to a single element array. Updates timestamp. If required fires notify event.- Parameters:
value
- value to be setseverity
- the severity to be used together with the value update. Ifnull
no alarm update is fired.status
- the status to be used together with the value update. Ifnull
no alarm update is fired.notify
- iftrue
fire notify event if value was change,false
suppresses events- Returns:
- true if value was updated, regardless if based on difference or force
-
_setValue
protected boolean _setValue(boolean value, gov.aps.jca.dbr.Severity severity, gov.aps.jca.dbr.Status status, boolean notify, boolean force) Internal set: sets new value to this processor. It checks if it is fixed, it never sets fixed value. Fires value update event only if value was changes and notify is true. If force is true, then updates value and fires notify, if notify is true, even if value was not changed. If the value is not an array it tries to convert it to a single element array. Updates timestamp. If required fires notify event.- Parameters:
value
- value to be setseverity
- the severity to be used together with the value update. Ifnull
no alarm update is fired.status
- the status to be used together with the value update. Ifnull
no alarm update is fired.notify
- iftrue
fire notify event if value was change,false
suppresses eventsforce
- iftrue
it will update value and timestamp even if there is not new value and proceeds with notify- Returns:
- true if value was updated, regardless if based on difference or force
-
getValueAsBoolean
public boolean getValueAsBoolean()getValueAsBoolean.
- Returns:
- a boolean
-
getValue
getValue.
- Returns:
- a
Object
object
-
getChangeAccessTimestamp
public gov.aps.jca.dbr.TimeStamp getChangeAccessTimestamp()Returns timestamp of last value change.- Returns:
- timestamp of last value change
-
isFixed
public boolean isFixed()isFixed.
- Returns:
- a boolean
-
setFixed
public void setFixed(boolean fixed) Setter for the field
fixed
.- Parameters:
fixed
- a boolean
-
configure
public void configure(Record record, org.apache.commons.configuration.HierarchicalConfiguration config) Configures the internals of value processor, provides reference to parent record and to configuration with root inside processor tag. Parent record is not yet initialized, so does not have reference to Database, the Database reference will be available during activate call.- Specified by:
configure
in interfaceValueProcessor
- Overrides:
configure
in classAbstractValueProcessor
- Parameters:
record
- the parent record.config
- configuration with room inside processor tag.
-
activate
public void activate()Record has now reference to Database. processor might want to connect to other records on this server or PVs on other servers. This can not be done until all records from configuration has been loaded. Call to this method signals to the processor that records has been loaded and linking to other values can be commenced.- Specified by:
activate
in interfaceValueProcessor
- Overrides:
activate
in classAbstractValueProcessor
-