Class ActiveAlarm<T>


  • public class ActiveAlarm<T>
    extends Object
    Keeps track of the alarm for one parameter or event.

    This will only exist for an alarm that has been triggered. A parameter that has limits definition but never had an out of limits value, will not have an active alarm.

    Note: generics parameter T can effectively be either ParameterValue or Db.Event

    • Field Detail

      • acknowledgeTime

        public long acknowledgeTime
      • clearTime

        public long clearTime
      • triggerValue

        public T triggerValue
      • mostSevereValue

        public T mostSevereValue
      • currentValue

        public T currentValue
      • clearMessage

        public String clearMessage
      • violations

        public int violations
      • valueCount

        public int valueCount
      • usernameThatAcknowledged

        public String usernameThatAcknowledged
      • usernameThatCleared

        public String usernameThatCleared
    • Constructor Detail

      • ActiveAlarm

        public ActiveAlarm​(T pv,
                           boolean autoAck,
                           boolean latching)
      • ActiveAlarm

        public ActiveAlarm​(T pv)
    • Method Detail

      • isAutoAcknowledge

        public boolean isAutoAcknowledge()
      • isAcknowledged

        public boolean isAcknowledged()
      • setAcknowledged

        public void setAcknowledged​(boolean acknowledged)
      • getId

        public int getId()
      • getAckMessage

        public String getAckMessage()
      • setAckMessage

        public void setAckMessage​(String ackMessage)
      • triggered

        public boolean triggered()
      • clear

        public void clear​(String username,
                          long time,
                          String message)
      • trigger

        public void trigger()
        Trigger the alarm if not already triggered
      • acknowledge

        public void acknowledge​(String username,
                                long ackTime,
                                String message)
        Acknowledge the alarm. This method does nothing if the alarm is already acknowledged.
        Parameters:
        username -
        ackTime -
        message -
      • processRTN

        public boolean processRTN()
        Called when the process returns to normal (i.e. parameter is back in limits)
        Returns:
        true if the alarm has been updated
      • reset

        public void reset()
        Called when the operator resets a latching alarm
      • shelve

        public void shelve​(String username,
                           String message,
                           long shelveDuration)
      • isShelved

        public boolean isShelved()
      • unshelve

        public void unshelve()
      • getShelveUsername

        public String getShelveUsername()
      • getShelveTime

        public long getShelveTime()
      • setShelveTime

        public void setShelveTime​(long shelveTime)
      • getShelveMessage

        public String getShelveMessage()
      • setShelveMessage

        public void setShelveMessage​(String shelveMessage)
      • getShelveDuration

        public long getShelveDuration()
      • setShelveDuration

        public void setShelveDuration​(long shelveDuration)
      • isNormal

        public boolean isNormal()
      • getShelveExpiration

        public long getShelveExpiration()
      • isProcessOK

        public boolean isProcessOK()
      • isTriggered

        public boolean isTriggered()
      • getClearTime

        public long getClearTime()
      • getClearMessage

        public String getClearMessage()
      • getUsernameThatShelved

        public String getUsernameThatShelved()
      • setUsernameThatShelved

        public void setUsernameThatShelved​(String usernameThatShelved)
      • getUsernameThatCleared

        public String getUsernameThatCleared()