Packagetwaver
Classpublic class AlarmStateStatistics
InheritanceAlarmStateStatistics Inheritance flash.events.EventDispatcher

This is an alarm state statistics like a calculator for an ElementBox. This class always work with an element box. It will calculate all alarm count information for the connected element box automatically when any inside element's alarm state information is changed. This is very useful to drive some chart objects like bar chart, pie chart to display the overall alarm information for this element box.

Check TWaver Flex demo source code to find more example of this class usage.



Public Properties
 PropertyDefined By
  elementBox : ElementBox
Get the connecting element box.
AlarmStateStatistics
  filterFunction : Function
Get the filter for this alarm statistics.
AlarmStateStatistics
Public Methods
 MethodDefined By
  
Creator.
AlarmStateStatistics
  
addPropertyChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add a property change listener to this class to monitoring the property change event.
AlarmStateStatistics
  
dispatchPropertyChangeEvent(property:String, oldValue:Object, newValue:Object):Boolean
Dispatch property change event.
AlarmStateStatistics
  
dispose():void
Dispose all resourced used by this class.
AlarmStateStatistics
  
Get total acknowledged alarm count for the connected element box and the specified alarm severity.
AlarmStateStatistics
  
getNewAlarmCount(severity:AlarmSeverity = null):int
Get total new alarm count for the connected element box and the specified alarm severity.
AlarmStateStatistics
  
getTotalAlarmCount(severity:AlarmSeverity = null):int
Get total alarm count for specified alarm severity.
AlarmStateStatistics
  
removePropertyChangeListener(listener:Function):void
Remove the specified property change listener from this class.
AlarmStateStatistics
  
reset():void
Call this to reset all numbers to zero.
AlarmStateStatistics
Property Detail
elementBoxproperty
elementBox:ElementBox

Get the connecting element box.


Implementation
    public function get elementBox():ElementBox
    public function set elementBox(value:ElementBox):void
filterFunctionproperty 
filterFunction:Function

Get the filter for this alarm statistics. The filter give your a chance to filter out some elements or alarms that you don't want be calculated by this statistics. Default value is null, this means calculate all alarms for the connecting element box.


Implementation
    public function get filterFunction():Function
    public function set filterFunction(value:Function):void
Constructor Detail
AlarmStateStatistics()Constructor
public function AlarmStateStatistics(box:ElementBox)

Creator. This will create an alarm state statistics connecting to the specified element box.

Parameters
box:ElementBox — the element box will connect to current alarm state object.
Method Detail
addPropertyChangeListener()method
public function addPropertyChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void

Add a property change listener to this class to monitoring the property change event.

Parameters

listener:Function — the listener to be added
 
priority:int (default = 0) — listener priority
 
useWeakReference:Boolean (default = false) — whether use weak reference

dispatchPropertyChangeEvent()method 
public function dispatchPropertyChangeEvent(property:String, oldValue:Object, newValue:Object):Boolean

Dispatch property change event.

Parameters

property:String — the property name changed
 
oldValue:Object — the old value before changed
 
newValue:Object — the new value to be changed

Returns
Boolean — true true means dispatched, false means not.
dispose()method 
public function dispose():void

Dispose all resourced used by this class. Call this method if you want disconnect the connecting element databox. Most of the time you don't need to invoke this to dispose the resourced unless you really want disconnect to an element box.

getAcknowledgedAlarmCount()method 
public function getAcknowledgedAlarmCount(severity:AlarmSeverity = null):int

Get total acknowledged alarm count for the connected element box and the specified alarm severity.

Parameters

severity:AlarmSeverity (default = null) — the alarm severity to be counted

Returns
int — the total acknowledged alarm count for the connected element box and the specified alarm severity.
getNewAlarmCount()method 
public function getNewAlarmCount(severity:AlarmSeverity = null):int

Get total new alarm count for the connected element box and the specified alarm severity.

Parameters

severity:AlarmSeverity (default = null) — the alarm severity to be counted

Returns
int — the total new alarm count for the connected element box and the specified alarm severity.
getTotalAlarmCount()method 
public function getTotalAlarmCount(severity:AlarmSeverity = null):int

Get total alarm count for specified alarm severity. This will include new alarms and acknowledged alarms.

Parameters

severity:AlarmSeverity (default = null) — the alarm severity need to count.

Returns
int — total alarm count for specified alarm severity. This will include new alarms and acknowledged alarms.
removePropertyChangeListener()method 
public function removePropertyChangeListener(listener:Function):void

Remove the specified property change listener from this class.

Parameters

listener:Function — the listener need to be removed.

reset()method 
public function reset():void

Call this to reset all numbers to zero.