Persistent multi-level alert with debouncing.
More...
#include <ctre/phoenix6/Alerts.hpp>
|
| | PhoenixMultiAlert ()=default |
| | Creates an invalid multi-level alert.
|
| | PhoenixMultiAlert (char const *group, char const *id, uint32_t levelFlags, char const *text="") |
| | Creates a new multi-level alert.
|
| | PhoenixMultiAlert (std::string const &group, std::string const &id, uint32_t levelFlags, std::string const &text="") |
| | Creates a new multi-level alert.
|
| bool | IsValid () const |
| | operator bool () const |
| PhoenixMultiAlert & | WithDebounce (wpi::units::second_t debounce) |
| | Sets the time debounce of this alert, default 1 second.
|
| void | SetActive (Level level, char const *text=nullptr) |
| | Sets the alert state to active at the given level and optionally changes the text.
|
| void | SetActive (Level level, std::optional< std::string > const &text) |
| | Sets the alert state to active at the given level and optionally changes the text.
|
| void | SetInactive () |
| | Sets the alert state to inactive.
|
|
| static constexpr uint32_t | LevelFlag_High = 1 << (int)Level::High |
| | Include High priority / Error.
|
| static constexpr uint32_t | LevelFlag_Medium = 1 << (int)Level::Medium |
| | Include Medium priority / Warning.
|
| static constexpr uint32_t | LevelFlag_Low = 1 << (int)Level::Low |
| | Include Low priority / Info.
|
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.
◆ Level
◆ PhoenixMultiAlert() [1/3]
| ctre::phoenix6::PhoenixMultiAlert::PhoenixMultiAlert |
( |
| ) |
|
|
default |
Creates an invalid multi-level alert.
◆ PhoenixMultiAlert() [2/3]
| ctre::phoenix6::PhoenixMultiAlert::PhoenixMultiAlert |
( |
char const * | group, |
|
|
char const * | id, |
|
|
uint32_t | levelFlags, |
|
|
char const * | 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 |
◆ PhoenixMultiAlert() [3/3]
| ctre::phoenix6::PhoenixMultiAlert::PhoenixMultiAlert |
( |
std::string const & | group, |
|
|
std::string const & | id, |
|
|
uint32_t | levelFlags, |
|
|
std::string const & | text = "" ) |
|
inline |
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 |
◆ IsValid()
| bool ctre::phoenix6::PhoenixMultiAlert::IsValid |
( |
| ) |
const |
|
inline |
- Returns
- Whether this alert is valid
◆ operator bool()
| ctre::phoenix6::PhoenixMultiAlert::operator bool |
( |
| ) |
const |
|
inlineexplicit |
- Returns
- Whether this alert is valid
◆ SetActive() [1/2]
| void ctre::phoenix6::PhoenixMultiAlert::SetActive |
( |
Level | level, |
|
|
char const * | text = nullptr ) |
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 |
◆ SetActive() [2/2]
| void ctre::phoenix6::PhoenixMultiAlert::SetActive |
( |
Level | level, |
|
|
std::optional< std::string > const & | text ) |
|
inline |
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()
| void ctre::phoenix6::PhoenixMultiAlert::SetInactive |
( |
| ) |
|
Sets the alert state to inactive.
◆ WithDebounce()
| PhoenixMultiAlert & ctre::phoenix6::PhoenixMultiAlert::WithDebounce |
( |
wpi::units::second_t | debounce | ) |
|
Sets the time debounce of this alert, default 1 second.
- Parameters
-
- Returns
- This alert
◆ LevelFlag_High
| uint32_t ctre::phoenix6::PhoenixMultiAlert::LevelFlag_High = 1 << (int)Level::High |
|
staticconstexpr |
Include High priority / Error.
◆ LevelFlag_Low
| uint32_t ctre::phoenix6::PhoenixMultiAlert::LevelFlag_Low = 1 << (int)Level::Low |
|
staticconstexpr |
Include Low priority / Info.
◆ LevelFlag_Medium
| uint32_t ctre::phoenix6::PhoenixMultiAlert::LevelFlag_Medium = 1 << (int)Level::Medium |
|
staticconstexpr |
Include Medium priority / Warning.
The documentation for this class was generated from the following file: