Class DefaultAlarmProcessor
java.lang.Object
org.scictrl.csshell.epics.server.processor.AbstractValueProcessor
org.scictrl.csshell.epics.server.processor.MemoryValueProcessor
org.scictrl.csshell.epics.server.processor.DefaultAlarmProcessor
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
,ValueProcessor
- Direct Known Subclasses:
HostPingAlarmProcessor
,StateWatchdogProcessor
,StatusCheckAlarmProcessor
,SummaryAlarmProcessor
,SystemProcessWatchdogProcessor
,ValueDiffAlarmProcessor
,ValueLevelAlarmProcessor
DefaultAlarmProcessor class.
- Author:
- igor@scictrl.com
-
Field Summary
Fields inherited from class org.scictrl.csshell.epics.server.processor.MemoryValueProcessor
fixed, lastChangeTimestamp, timestamp, value
Fields inherited from class org.scictrl.csshell.epics.server.processor.AbstractValueProcessor
log, record, trigger, type
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.void
disableSupressTime.static final DefaultAlarmProcessor
newProcessor
(String name, String description, boolean value, boolean fixed, org.apache.commons.configuration.HierarchicalConfiguration conf) Creates new instance of DefaultAlarmProcessor and initializes it with Record from provided parameters.void
void
update
(boolean value, gov.aps.jca.dbr.Severity newSeverity, gov.aps.jca.dbr.Status newStatus, boolean notify) Updates value and alarm values.void
Alarm processor should check connections and other parameters and update alarm status.boolean
updateOrSupress
(gov.aps.jca.dbr.Severity newSeverity, gov.aps.jca.dbr.Status newStatus, boolean notify) Updates alarm state.Methods inherited from class org.scictrl.csshell.epics.server.processor.MemoryValueProcessor
_forceValueUpdateEvent, _setValue, _setValue, _setValue, _setValue, convert, getChangeAccessTimestamp, getTimestamp, getValue, getValueAsBoolean, isFixed, newBooleanProcessor, newDoubleProcessor, newProcessor, newProcessor, setFixed, setValue
Methods inherited from class org.scictrl.csshell.epics.server.processor.AbstractValueProcessor
getName, getRecord, getTrigger, getType, process, toString
-
Constructor Details
-
DefaultAlarmProcessor
public DefaultAlarmProcessor()Constructor for DefaultAlarmProcessor.
-
-
Method Details
-
newProcessor
public static final DefaultAlarmProcessor newProcessor(String name, String description, boolean value, boolean fixed, org.apache.commons.configuration.HierarchicalConfiguration conf) Creates new instance of DefaultAlarmProcessor and initializes it with Record from provided parameters.- Parameters:
name
- the name of the record/processordescription
- the description of the record/processorvalue
- the alarm value, high or lowfixed
- if value is fixedconf
- configuration which could include parameters gate.mask and gate.link.- Returns:
- new instance of DefaultAlarmProvider, configured with own Record
-
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 classMemoryValueProcessor
- Parameters:
record
- the parent record.config
- configuration with room inside processor tag.
-
propertyChange
- Specified by:
propertyChange
in interfacePropertyChangeListener
-
updateOrSupress
public boolean updateOrSupress(gov.aps.jca.dbr.Severity newSeverity, gov.aps.jca.dbr.Status newStatus, boolean notify) Updates alarm state. It looks at newSeverity and newStatus fields and sets them to record if necessary.- Parameters:
newSeverity
- aSeverity
objectnewStatus
- aStatus
objectnotify
- if notification event should be fired from the record.- Returns:
true
if alarm status was changed
-
update
public void update(boolean value, gov.aps.jca.dbr.Severity newSeverity, gov.aps.jca.dbr.Status newStatus, boolean notify) Updates value and alarm values. Alarm values go trough gate filter.- Parameters:
value
- new alarm valuenewSeverity
- new alarm severitynewStatus
- new alarm statusnotify
- if listeners of this objects should be notified
-
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 classMemoryValueProcessor
-
updateAlarmStatus
public void updateAlarmStatus()Alarm processor should check connections and other parameters and update alarm status.
This method should be called by processor itself, for example from PropertyChange update loop.
As well could be called by asynchronous update loop, which does the supress_time handling.
-
disableSupressTime
public void disableSupressTime()disableSupressTime.
-