Package alarm

Class AlarmCounter

java.lang.Object
alarm.AlarmCounter
Direct Known Subclasses:
AlarmDecibelCounter, SimpleAlarmCounter

public abstract class AlarmCounter extends Object
  • Constructor Details

    • AlarmCounter

      public AlarmCounter(AlarmControl alarmControl)
  • Method Details

    • getValue

      public abstract double getValue(int countType, PamDataUnit dataUnit)
      Get a count value from a source of alarm trigger data

      Two 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 counting
      dataUnit - dataunit to consider
      Returns:
      value to add to trigger count.
    • hasOptions

      public boolean hasOptions()
      Returns:
      true if the counter has module specific options.
    • showOptions

      public boolean showOptions(Window parent)
      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 value
      countToAdd - amount to add
      countType - 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 value
      countToSubtract - amount to subtract off
      countType - type of counting
      Returns:
      the two subtracted from one another in whichever way is most appropriate.
    • resetCounter

      public abstract void resetCounter()
    • getExtraFieldNames

      public String[] 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

      public String[] 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

      public AlarmControl getAlarmControl()
      Returns:
      the alarmControl