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
FieldsModifier and TypeFieldDescriptionprotected booleanValue is fixed.protected gov.aps.jca.dbr.TimeStampTimestamp of last value change.protected gov.aps.jca.dbr.TimeStampTimestamp of last value update.protected ObjectValue held by this processor.Fields inherited from class org.scictrl.csshell.epics.server.processor.AbstractValueProcessor
log, record, trigger, type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanUpdates 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.voidactivate()Record has now reference to Database.voidConfigures the internals of value processor, provides reference to parent record and to configuration with root inside processor tag.protected Objectconvert.gov.aps.jca.dbr.TimeStampReturns timestamp of last value change.gov.aps.jca.dbr.TimeStampTimestamp indicates last time value has been updated or confirmed.getValue()getValue.booleangetValueAsBoolean.booleanisFixed()isFixed.static final AbstractValueProcessornewBooleanProcessor(String name, String description, boolean value, boolean fixed, boolean undefined) newBooleanProcessor.static final AbstractValueProcessornewDoubleProcessor(String name, String description, double value, boolean fixed) newDoubleProcessor.static final AbstractValueProcessornewProcessor(String name, gov.aps.jca.dbr.DBRType type, int count, String description, Object value, boolean fixed, boolean undefined) newProcessor.static final AbstractValueProcessornewProcessor(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.voidsetFixed(boolean fixed) Setter for the fieldfixed.voidSets 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- aStringobjectdescription- aStringobjectvalue- a doublefixed- a boolean- Returns:
- a
AbstractValueProcessorobject
-
newBooleanProcessor
public static final AbstractValueProcessor newBooleanProcessor(String name, String description, boolean value, boolean fixed, boolean undefined) newBooleanProcessor.
- Parameters:
name- aStringobjectdescription- aStringobjectvalue- a booleanfixed- a booleanundefined- a boolean- Returns:
- a
AbstractValueProcessorobject
-
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- aStringobjecttype- aDBRTypeobjectcount- a intdescription- aStringobjectvalue- aObjectobjectfixed- a booleanundefined- a boolean- Returns:
- a
AbstractValueProcessorobject
-
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
TimeStampobject
-
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- aObjectobject
-
_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. Ifnullno alarm update is fired.status- the status to be used together with the value update. Ifnullno alarm update is fired.notify- iftruefire notify event if value was change,falsesuppresses 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. Ifnullno alarm update is fired.status- the status to be used together with the value update. Ifnullno alarm update is fired.notify- iftruefire notify event if value was change,falsesuppresses eventsforce- iftrueit 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. Ifnullno alarm update is fired.status- the status to be used together with the value update. Ifnullno alarm update is fired.notify- iftruefire notify event if value was change,falsesuppresses 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. Ifnullno alarm update is fired.status- the status to be used together with the value update. Ifnullno alarm update is fired.notify- iftruefire notify event if value was change,falsesuppresses eventsforce- iftrueit 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
Objectobject
-
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:
configurein interfaceValueProcessor- Overrides:
configurein 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:
activatein interfaceValueProcessor- Overrides:
activatein classAbstractValueProcessor
-