[hal,wpilib] Move Alert to HAL (#8646)

SystemCore implementation is not yet connected to MRCComm.
This commit is contained in:
Peter Johnson
2026-03-03 21:58:47 -07:00
committed by GitHub
parent f4935a2ea9
commit 733cfa4b07
33 changed files with 1719 additions and 1121 deletions

View File

@@ -105,6 +105,7 @@ MecanumDrive = "wpi/drive/MecanumDrive.hpp"
RobotDriveBase = "wpi/drive/RobotDriveBase.hpp"
# wpi/driverstation
Alert = "wpi/driverstation/Alert.hpp"
DriverStation = "wpi/driverstation/DriverStation.hpp"
Gamepad = "wpi/driverstation/Gamepad.hpp"
GenericHID = "wpi/driverstation/GenericHID.hpp"
@@ -228,7 +229,6 @@ Tracer = "wpi/system/Tracer.hpp"
Watchdog = "wpi/system/Watchdog.hpp"
# wpi/util
Alert = "wpi/util/Alert.hpp"
Preferences = "wpi/util/Preferences.hpp"
SensorUtil = "wpi/util/SensorUtil.hpp"
@@ -243,6 +243,7 @@ yaml_path = "semiwrap/simulation"
# wpi/simulation
ADXL345Sim = "wpi/simulation/ADXL345Sim.hpp"
AddressableLEDSim = "wpi/simulation/AddressableLEDSim.hpp"
AlertSim = "wpi/simulation/AlertSim.hpp"
AnalogEncoderSim = "wpi/simulation/AnalogEncoderSim.hpp"
AnalogInputSim = "wpi/simulation/AnalogInputSim.hpp"
BatterySim = "wpi/simulation/BatterySim.hpp"

View File

@@ -1,16 +1,12 @@
functions:
format_as:
ignore: true
classes:
wpi::Alert:
enums:
AlertType:
Level:
methods:
Alert:
overloads:
std::string_view, AlertType:
std::string_view, std::string_view, AlertType:
std::string_view, Level:
std::string_view, std::string_view, Level:
Set:
Get:
SetText:

View File

@@ -0,0 +1,24 @@
classes:
wpi::sim::AlertSim:
methods:
GetCount:
GetAll:
ResetData:
wpi::sim::AlertSim::AlertInfo:
attributes:
handle:
group:
text:
activeStartTime:
level:
ignore: true
methods:
isActive:
inline_code: |
.def_property(
"level",
[](const AlertInfo& self) { return self.level; },
[](AlertInfo& self, wpi::Alert::Level level) { self.level = level; },
py::return_value_policy::copy,
py::doc("The level of the alert (HIGH, MEDIUM, or LOW).")
);

View File

@@ -4,6 +4,7 @@ from . import _init__simulation
from ._simulation import (
ADXL345Sim,
AddressableLEDSim,
AlertSim,
AnalogEncoderSim,
AnalogInputSim,
BatterySim,