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
-
-
Field Summary
Fields Modifier and Type Field Description longacknowledgeTimeStringclearMessagelongclearTimeTcurrentValueTmostSevereValueTtriggerValueStringusernameThatAcknowledgedStringusernameThatClearedintvalueCountintviolations
-
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()StringgetClearMessage()longgetClearTime()intgetId()longgetShelveDuration()longgetShelveExpiration()StringgetShelveMessage()longgetShelveTime()StringgetShelveUsername()StringgetUsernameThatCleared()StringgetUsernameThatShelved()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)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()
-
-
-
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
-
-
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()
-
-