Class PhoenixMultiAlert

java.lang.Object
com.ctre.phoenix6.alerts.PhoenixMultiAlert

public final class PhoenixMultiAlert extends Object
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 Details

    • LevelFlag_High

      public static final long LevelFlag_High
      Include High priority / Error
    • LevelFlag_Medium

      public static final long LevelFlag_Medium
      Include Medium priority / Warning
    • LevelFlag_Low

      public static final long LevelFlag_Low
      Include Low priority / Info
  • Constructor Details

    • PhoenixMultiAlert

      public PhoenixMultiAlert()
      Creates an invalid multi-level alert.
    • PhoenixMultiAlert

      public PhoenixMultiAlert(String group, String id, long levelFlags)
      Creates a new multi-level alert.
      Parameters:
      group - Group identifier
      id - Alert identifier, unique within the group
      levelFlags - Alert urgency levels to include
    • PhoenixMultiAlert

      public PhoenixMultiAlert(String group, String id, long levelFlags, String text)
      Creates a new multi-level alert.
      Parameters:
      group - Group identifier
      id - Alert identifier, unique within the group
      levelFlags - Alert urgency levels to include
      text - Alert text to display when the alert is active
  • Method Details

    • isValid

      public boolean isValid()
      Returns:
      Whether this alert is valid
    • withDebounce

      public PhoenixMultiAlert withDebounce(double debounceSeconds)
      Sets the time debounce of this alert, default 1 second.
      Parameters:
      debounceSeconds - Debounce time in seconds
      Returns:
      This alert
    • setActive

      public void setActive(PhoenixAlert.Level level)
      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

      public void setActive(PhoenixAlert.Level level, String text)
      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 level
      text - New text to display
    • setInactive

      public void setInactive()
      Sets the alert state to inactive.