[hal,wpilib] Rename DriverStation constants to all caps

This commit is contained in:
Peter Johnson
2026-03-13 01:04:29 -07:00
parent 614eb1db18
commit 227f01f3bd
51 changed files with 555 additions and 550 deletions

View File

@@ -106,7 +106,7 @@ public class CommandGenericHID {
* @return a Trigger instance based around the up direction of a POV on the HID.
*/
public Trigger povUp() {
return pov(POVDirection.Up);
return pov(POVDirection.UP);
}
/**
@@ -117,7 +117,7 @@ public class CommandGenericHID {
* @return a Trigger instance based around the up right direction of a POV on the HID.
*/
public Trigger povUpRight() {
return pov(POVDirection.UpRight);
return pov(POVDirection.UP_RIGHT);
}
/**
@@ -128,7 +128,7 @@ public class CommandGenericHID {
* @return a Trigger instance based around the right direction of a POV on the HID.
*/
public Trigger povRight() {
return pov(POVDirection.Right);
return pov(POVDirection.RIGHT);
}
/**
@@ -139,7 +139,7 @@ public class CommandGenericHID {
* @return a Trigger instance based around the down right direction of a POV on the HID.
*/
public Trigger povDownRight() {
return pov(POVDirection.DownRight);
return pov(POVDirection.DOWN_RIGHT);
}
/**
@@ -150,7 +150,7 @@ public class CommandGenericHID {
* @return a Trigger instance based around the down direction of a POV on the HID.
*/
public Trigger povDown() {
return pov(POVDirection.Down);
return pov(POVDirection.DOWN);
}
/**
@@ -161,7 +161,7 @@ public class CommandGenericHID {
* @return a Trigger instance based around the down left POV direction of a POV on the HID.
*/
public Trigger povDownLeft() {
return pov(POVDirection.DownLeft);
return pov(POVDirection.DOWN_LEFT);
}
/**
@@ -172,7 +172,7 @@ public class CommandGenericHID {
* @return a Trigger instance based around the left direction of a POV on the HID.
*/
public Trigger povLeft() {
return pov(POVDirection.Left);
return pov(POVDirection.LEFT);
}
/**
@@ -183,7 +183,7 @@ public class CommandGenericHID {
* @return a Trigger instance based around the up left direction of a POV on the HID.
*/
public Trigger povUpLeft() {
return pov(POVDirection.UpLeft);
return pov(POVDirection.UP_LEFT);
}
/**
@@ -194,7 +194,7 @@ public class CommandGenericHID {
* @return a Trigger instance based around the center position of a POV on the HID.
*/
public Trigger povCenter() {
return pov(POVDirection.Center);
return pov(POVDirection.CENTER);
}
/**

View File

@@ -28,39 +28,39 @@ Trigger CommandGenericHID::POV(int pov, wpi::DriverStation::POVDirection angle,
}
Trigger CommandGenericHID::POVUp(wpi::EventLoop* loop) const {
return POV(wpi::DriverStation::POVDirection::kUp, loop);
return POV(wpi::DriverStation::POVDirection::UP, loop);
}
Trigger CommandGenericHID::POVUpRight(wpi::EventLoop* loop) const {
return POV(wpi::DriverStation::POVDirection::kUpRight, loop);
return POV(wpi::DriverStation::POVDirection::UP_RIGHT, loop);
}
Trigger CommandGenericHID::POVRight(wpi::EventLoop* loop) const {
return POV(wpi::DriverStation::POVDirection::kRight, loop);
return POV(wpi::DriverStation::POVDirection::RIGHT, loop);
}
Trigger CommandGenericHID::POVDownRight(wpi::EventLoop* loop) const {
return POV(wpi::DriverStation::POVDirection::kDownRight, loop);
return POV(wpi::DriverStation::POVDirection::DOWN_RIGHT, loop);
}
Trigger CommandGenericHID::POVDown(wpi::EventLoop* loop) const {
return POV(wpi::DriverStation::POVDirection::kDown, loop);
return POV(wpi::DriverStation::POVDirection::DOWN, loop);
}
Trigger CommandGenericHID::POVDownLeft(wpi::EventLoop* loop) const {
return POV(wpi::DriverStation::POVDirection::kDownLeft, loop);
return POV(wpi::DriverStation::POVDirection::DOWN_LEFT, loop);
}
Trigger CommandGenericHID::POVLeft(wpi::EventLoop* loop) const {
return POV(wpi::DriverStation::POVDirection::kLeft, loop);
return POV(wpi::DriverStation::POVDirection::LEFT, loop);
}
Trigger CommandGenericHID::POVUpLeft(wpi::EventLoop* loop) const {
return POV(wpi::DriverStation::POVDirection::kUpLeft, loop);
return POV(wpi::DriverStation::POVDirection::UP_LEFT, loop);
}
Trigger CommandGenericHID::POVCenter(wpi::EventLoop* loop) const {
return POV(wpi::DriverStation::POVDirection::kCenter, loop);
return POV(wpi::DriverStation::POVDirection::CENTER, loop);
}
Trigger CommandGenericHID::AxisLessThan(int axis, double threshold,

View File

@@ -19,7 +19,7 @@ class POVButtonTest : public CommandTestBase {};
TEST_F(POVButtonTest, SetPOV) {
wpi::sim::JoystickSim joysim(1);
joysim.SetPOV(wpi::DriverStation::kUp);
joysim.SetPOV(wpi::DriverStation::POVDirection::UP);
joysim.NotifyNewData();
auto& scheduler = CommandScheduler::GetInstance();
@@ -28,11 +28,11 @@ TEST_F(POVButtonTest, SetPOV) {
WaitUntilCommand command([&finished] { return finished; });
wpi::Joystick joy(1);
POVButton(&joy, wpi::DriverStation::kRight).OnTrue(&command);
POVButton(&joy, wpi::DriverStation::POVDirection::RIGHT).OnTrue(&command);
scheduler.Run();
EXPECT_FALSE(scheduler.IsScheduled(&command));
joysim.SetPOV(wpi::DriverStation::kRight);
joysim.SetPOV(wpi::DriverStation::POVDirection::RIGHT);
joysim.NotifyNewData();
scheduler.Run();

View File

@@ -16,7 +16,7 @@ class RobotModeTriggersTest : public CommandTestBase {};
TEST(RobotModeTriggersTest, Autonomous) {
DriverStationSim::ResetData();
DriverStationSim::SetRobotMode(HAL_ROBOTMODE_AUTONOMOUS);
DriverStationSim::SetRobotMode(HAL_ROBOT_MODE_AUTONOMOUS);
DriverStationSim::SetEnabled(true);
DriverStationSim::NotifyNewData();
Trigger autonomous = RobotModeTriggers::Autonomous();
@@ -25,7 +25,7 @@ TEST(RobotModeTriggersTest, Autonomous) {
TEST(RobotModeTriggersTest, Teleop) {
DriverStationSim::ResetData();
DriverStationSim::SetRobotMode(HAL_ROBOTMODE_TELEOPERATED);
DriverStationSim::SetRobotMode(HAL_ROBOT_MODE_TELEOPERATED);
DriverStationSim::SetEnabled(true);
DriverStationSim::NotifyNewData();
Trigger teleop = RobotModeTriggers::Teleop();
@@ -42,7 +42,7 @@ TEST(RobotModeTriggersTest, Disabled) {
TEST(RobotModeTriggersTest, TestMode) {
DriverStationSim::ResetData();
DriverStationSim::SetRobotMode(HAL_ROBOTMODE_TEST);
DriverStationSim::SetRobotMode(HAL_ROBOT_MODE_TEST);
DriverStationSim::SetEnabled(true);
DriverStationSim::NotifyNewData();
Trigger test = RobotModeTriggers::Test();