Persistent alert with debouncing.
More...
#include <ctre/phoenix6/Alerts.hpp>
|
| | PhoenixAlert ()=default |
| | Creates an invalid alert.
|
| | PhoenixAlert (char const *group, char const *id, Level level, char const *text="") |
| | Creates a new alert.
|
| | PhoenixAlert (std::string const &group, std::string const &id, Level level, std::string const &text="") |
| | Creates a new alert.
|
| bool | IsValid () const |
| | operator bool () const |
| PhoenixAlert & | WithDebounce (wpi::units::second_t debounce) |
| | Sets the time debounce of this alert, default 1 second.
|
| void | SetActive (char const *text=nullptr) |
| | Sets the alert state to active and optionally changes the text.
|
| void | SetActive (std::optional< std::string > const &text) |
| | Sets the alert state to active and optionally changes the text.
|
| void | SetInactive () |
| | Sets the alert state to inactive.
|
Persistent 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.
◆ Level
Levels of urgency of the alert.
| Enumerator |
|---|
| High | High priority / Error.
|
| Medium | Medium priority / Warning.
|
| Low | Low priority / Info.
|
◆ PhoenixAlert() [1/3]
| ctre::phoenix6::PhoenixAlert::PhoenixAlert |
( |
| ) |
|
|
default |
Creates an invalid alert.
◆ PhoenixAlert() [2/3]
| ctre::phoenix6::PhoenixAlert::PhoenixAlert |
( |
char const * | group, |
|
|
char const * | id, |
|
|
Level | level, |
|
|
char const * | text = "" ) |
Creates a new alert.
- Parameters
-
| group | Group identifier |
| id | Alert identifier, unique within the group |
| level | Alert urgency level |
| text | Alert text to display when the alert is active |
◆ PhoenixAlert() [3/3]
| ctre::phoenix6::PhoenixAlert::PhoenixAlert |
( |
std::string const & | group, |
|
|
std::string const & | id, |
|
|
Level | level, |
|
|
std::string const & | text = "" ) |
|
inline |
Creates a new alert.
- Parameters
-
| group | Group identifier |
| id | Alert identifier, unique within the group |
| level | Alert urgency level |
| text | Alert text to display when the alert is active |
◆ IsValid()
| bool ctre::phoenix6::PhoenixAlert::IsValid |
( |
| ) |
const |
|
inline |
- Returns
- Whether this alert is valid
◆ operator bool()
| ctre::phoenix6::PhoenixAlert::operator bool |
( |
| ) |
const |
|
inlineexplicit |
- Returns
- Whether this alert is valid
◆ SetActive() [1/2]
| void ctre::phoenix6::PhoenixAlert::SetActive |
( |
char const * | text = nullptr | ) |
|
Sets the alert state to active and optionally changes the text.
This should be called periodically, even if the active state does not change.
- Parameters
-
◆ SetActive() [2/2]
| void ctre::phoenix6::PhoenixAlert::SetActive |
( |
std::optional< std::string > const & | text | ) |
|
|
inline |
Sets the alert state to active and optionally changes the text.
This should be called periodically, even if the active state does not change.
- Parameters
-
◆ SetInactive()
| void ctre::phoenix6::PhoenixAlert::SetInactive |
( |
| ) |
|
Sets the alert state to inactive.
◆ WithDebounce()
| PhoenixAlert & ctre::phoenix6::PhoenixAlert::WithDebounce |
( |
wpi::units::second_t | debounce | ) |
|
Sets the time debounce of this alert, default 1 second.
- Parameters
-
- Returns
- This alert
The documentation for this class was generated from the following file: