Class PhoenixMultiAlert
java.lang.Object
com.ctre.phoenix6.alerts.PhoenixMultiAlert
Persistent multi-level alert with debouncing.
On a FIRST robot controller, this shows up as a persistent alert in the Driver Station and compatible NetworkTables dashboards. Otherwise, this is a no-op.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longInclude High priority / Errorstatic final longInclude Low priority / Infostatic final longInclude Medium priority / Warning -
Constructor Summary
ConstructorsConstructorDescriptionCreates an invalid multi-level alert.PhoenixMultiAlert(String group, String id, long levelFlags) Creates a new multi-level alert.PhoenixMultiAlert(String group, String id, long levelFlags, String text) Creates a new multi-level alert. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisValid()voidsetActive(PhoenixAlert.Level level) Sets the alert state to active at the given level without changing the text.voidsetActive(PhoenixAlert.Level level, String text) Sets the alert state to active at the given level and optionally changes the text.voidSets the alert state to inactive.withDebounce(double debounceSeconds) Sets the time debounce of this alert, default 1 second.
-
Field Details
-
LevelFlag_High
public static final long LevelFlag_HighInclude High priority / Error -
LevelFlag_Medium
public static final long LevelFlag_MediumInclude Medium priority / Warning -
LevelFlag_Low
public static final long LevelFlag_LowInclude Low priority / Info
-
-
Constructor Details
-
PhoenixMultiAlert
public PhoenixMultiAlert()Creates an invalid multi-level alert. -
PhoenixMultiAlert
-
PhoenixMultiAlert
-
-
Method Details
-
isValid
public boolean isValid()- Returns:
- Whether this alert is valid
-
withDebounce
Sets the time debounce of this alert, default 1 second.- Parameters:
debounceSeconds- Debounce time in seconds- Returns:
- This alert
-
setActive
Sets the alert state to active at the given level without changing the text. This should be called periodically, even if the active state does not change.- Parameters:
level- New alert urgency level
-
setActive
Sets the alert state to active at the given level and optionally changes the text. This should be called periodically, even if the active state does not change.- Parameters:
level- New alert urgency leveltext- New text to display
-
setInactive
public void setInactive()Sets the alert state to inactive.
-