[hal,wpilib] Remove alert level aliases (#8744)

This commit is contained in:
Sam Freund
2026-04-10 14:26:52 -05:00
committed by GitHub
parent ce77e6022f
commit 21f6bdbc1a
3 changed files with 9 additions and 30 deletions

View File

@@ -27,7 +27,6 @@ HAL_ENUM(HAL_AlertLevel) {
* require immediate attention.
*/
HAL_ALERT_HIGH = 0,
HAL_ALERT_ERROR = HAL_ALERT_HIGH,
/**
* Medium priority alert - displayed second with a yellow "!" symbol. Use this
@@ -35,7 +34,6 @@ HAL_ENUM(HAL_AlertLevel) {
* necessarily require immediate attention.
*/
HAL_ALERT_MEDIUM = 1,
HAL_ALERT_WARNING = HAL_ALERT_MEDIUM,
/**
* Low priority alert - displayed last with a green "i" symbol. Use this type
@@ -43,7 +41,6 @@ HAL_ENUM(HAL_AlertLevel) {
* other alerts which do not fall under the other categories.
*/
HAL_ALERT_LOW = 2,
HAL_ALERT_INFO = HAL_ALERT_LOW
};
/**

View File

@@ -14,7 +14,7 @@ namespace wpi {
/**
* Persistent alert to be sent to the driver station. Alerts are tagged with a
* type of HIGH/ERROR, MEDIUM/WARNING, or LOW/INFO to denote urgency. See
* type of HIGH, MEDIUM, or LOW to denote urgency. See
* Alert::Level for suggested usage of each type. Alerts can be displayed on
* supported dashboards, and are shown in a priority order based on type and
* recency of activation, with newly activated alerts first.
@@ -25,7 +25,7 @@ namespace wpi {
*
* <pre>
* class Robot {
* wpi::Alert alert{"Something went wrong", wpi::Alert::Level::WARNING};
* wpi::Alert alert{"Something went wrong", wpi::Alert::Level::MEDIUM};
* }
*
* Robot::periodic() {
@@ -46,9 +46,6 @@ class Alert {
*/
HIGH = HAL_ALERT_HIGH,
/** Alternate name for a high priority alert. */
ERROR = HIGH,
/**
* Medium priority alert - displayed second with a yellow "!" symbol.
* Use this type for problems which could affect the robot's functionality
@@ -56,18 +53,12 @@ class Alert {
*/
MEDIUM = HAL_ALERT_MEDIUM,
/** Alternate name for a medium priority alert. */
WARNING = MEDIUM,
/**
* Low priority alert - displayed last with a green "i" symbol. Use this
* type for problems which are unlikely to affect the robot's functionality,
* or any other alerts which do not fall under the other categories.
*/
LOW = HAL_ALERT_LOW,
/** Alternate name for a low priority alert. */
INFO = LOW
};
/**

View File

@@ -7,18 +7,18 @@ package org.wpilib.driverstation;
import org.wpilib.hardware.hal.AlertJNI;
/**
* Persistent alert to be sent via NetworkTables. Alerts are tagged with a type of {@code ERROR},
* {@code WARNING}, or {@code INFO} to denote urgency. See {@link
* org.wpilib.driverstation.Alert.Level Level} for suggested usage of each type. Alerts can be
* displayed on supported dashboards, and are shown in a priority order based on type and recency of
* activation, with newly activated alerts first.
* Persistent alert to be sent via NetworkTables. Alerts are tagged with a type of {@code HIGH},
* {@code MEDIUM}, or {@code LOW} to denote urgency. See {@link org.wpilib.driverstation.Alert.Level
* Level} for suggested usage of each type. Alerts can be displayed on supported dashboards, and are
* shown in a priority order based on type and recency of activation, with newly activated alerts
* first.
*
* <p>Alerts should be created once and stored persistently, then updated to "active" or "inactive"
* as necessary. {@link #set(boolean)} can be safely called periodically.
*
* <pre>
* class Robot {
* Alert alert = new Alert("Something went wrong", Alert.Level.WARNING);
* Alert alert = new Alert("Something went wrong", Alert.Level.MEDIUM);
*
* periodic() {
* alert.set(...);
@@ -30,7 +30,7 @@ import org.wpilib.hardware.hal.AlertJNI;
*
* <pre>
* public Robot() {
* new Alert("Failed to load auto paths", Alert.Level.ERROR).set(true);
* new Alert("Failed to load auto paths", Alert.Level.HIGH).set(true);
* }
* </pre>
*/
@@ -57,15 +57,6 @@ public class Alert implements AutoCloseable {
*/
LOW(AlertJNI.LEVEL_LOW);
/** Alternate name for a high priority alert. */
public static final Level ERROR = HIGH;
/** Alternate name for a medium priority alert. */
public static final Level WARNING = MEDIUM;
/** Alternate name for a low priority alert. */
public static final Level INFO = LOW;
private final int m_value;
Level(int value) {