Package org.yamcs.alarms
Class ActiveAlarm<T>
- java.lang.Object
-
- org.yamcs.alarms.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
ParameterValueorDb.Event
-
-
Constructor Summary
Constructors Constructor Description ActiveAlarm(T pv)ActiveAlarm(T pv, boolean autoAck, boolean latching)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacknowledge(String username, long ackTime, String message)Acknowledge the alarm.voidclear(String username, long time, String message)StringgetAckMessage()longgetAcknowledgeTime()StringgetClearMessage()longgetClearTime()TgetCurrentValue()intgetId()TgetMostSevereValue()longgetShelveDuration()longgetShelveExpiration()StringgetShelveMessage()longgetShelveTime()StringgetShelveUsername()TgetTriggerValue()StringgetUsernameThatAcknowledged()StringgetUsernameThatCleared()StringgetUsernameThatShelved()intgetValueCount()intgetViolations()voidincrementValueCount()voidincrementViolations()booleanisAcknowledged()booleanisAutoAcknowledge()booleanisNormal()booleanisProcessOK()booleanisShelved()booleanisTriggered()booleanprocessRTN()Called when the process returns to normal (i.e. parameter is back in limits)voidreset()Called when the operator resets a latching alarmvoidsetAckMessage(String ackMessage)voidsetAcknowledged(boolean acknowledged)voidsetCurrentValue(T value)TsetMostSevereValue(T mostSevereValue)voidsetShelveDuration(long shelveDuration)voidsetShelveMessage(String shelveMessage)voidsetShelveTime(long shelveTime)voidsetUsernameThatShelved(String usernameThatShelved)voidshelve(String username, String message, long shelveDuration)StringtoString()voidtrigger()Trigger the alarm if not already triggeredbooleantriggered()voidunshelve()
-
-
-
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()
-
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
-
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()
-
getUsernameThatAcknowledged
public String getUsernameThatAcknowledged()
-
getTriggerValue
public T getTriggerValue()
-
getCurrentValue
public T getCurrentValue()
-
setCurrentValue
public void setCurrentValue(T value)
-
getMostSevereValue
public T getMostSevereValue()
-
getAcknowledgeTime
public long getAcknowledgeTime()
-
incrementValueCount
public void incrementValueCount()
-
getValueCount
public int getValueCount()
-
incrementViolations
public void incrementViolations()
-
getViolations
public int getViolations()
-
-