Package alarm
Class AlarmCounter
java.lang.Object
alarm.AlarmCounter
- Direct Known Subclasses:
AlarmDecibelCounter
,SimpleAlarmCounter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
addCount
(double currentValue, double countToAdd, int countType) Add a count to the total.String[]
Get extra data to go into the new fields.String[]
Get the number of extra data fields to add to alarm data outputabstract double
getValue
(int countType, PamDataUnit dataUnit) Get a count value from a source of alarm trigger databoolean
abstract void
boolean
showOptions
(Window parent) Show module specific optionsdouble
subtractCount
(double currentValue, double countToSubtract, int countType) Subtract a count from the total.
-
Constructor Details
-
AlarmCounter
-
-
Method Details
-
getValue
Get a count value from a source of alarm trigger dataTwo types of counting are available. COUNT_SIMPLE in which case each data unit scores either 0 or 1 and COUNT_SCORES in which case each unit is assigned a value (could still be 0 or 1 !)
- Parameters:
countType
- type of countingdataUnit
- dataunit to consider- Returns:
- value to add to trigger count.
-
hasOptions
public boolean hasOptions()- Returns:
- true if the counter has module specific options.
-
showOptions
Show module specific options- Parameters:
parent
- parent frame for dialog- Returns:
- true if options were changed (false if cancel button pressed on dialog)
-
addCount
public double addCount(double currentValue, double countToAdd, int countType) Add a count to the total. This has been put in this abstract class so that individual modules can override how they add things up, e.g. a noise measurement in dB may need to be converted to energy before adding.- Parameters:
currentValue
- current valuecountToAdd
- amount to addcountType
- type of counting- Returns:
- the two added together in whichever way is most appropriate.
-
subtractCount
public double subtractCount(double currentValue, double countToSubtract, int countType) Subtract a count from the total. This has been put in this abstract class so that individual modules can override how they subtract things, e.g. a noise measurement in dB may need to be converted to energy before subtracting.- Parameters:
currentValue
- current valuecountToSubtract
- amount to subtract offcountType
- type of counting- Returns:
- the two subtracted from one another in whichever way is most appropriate.
-
resetCounter
public abstract void resetCounter() -
getExtraFieldNames
Get the number of extra data fields to add to alarm data output- Returns:
- array of extra field names to append to output
-
getExtraFieldData
Get extra data to go into the new fields.
(very generic type - may have to also return SQL types ?)- Returns:
- extra data to go into the fields.
-
getAlarmControl
- Returns:
- the alarmControl
-