[hal] Rename SimDevice constants to all caps

Also use enum class for SimDevice C++ wrapper.
This commit is contained in:
Peter Johnson
2026-03-14 12:57:37 -07:00
parent 70f77a1f8e
commit aad08b9ad1
29 changed files with 145 additions and 131 deletions

View File

@@ -31,14 +31,14 @@ public class RomiGyro {
public RomiGyro() {
m_simDevice = SimDevice.create("Gyro:RomiGyro");
if (m_simDevice != null) {
m_simDevice.createBoolean("init", Direction.kOutput, true);
m_simRateX = m_simDevice.createDouble("rate_x", Direction.kInput, 0.0);
m_simRateY = m_simDevice.createDouble("rate_y", Direction.kInput, 0.0);
m_simRateZ = m_simDevice.createDouble("rate_z", Direction.kInput, 0.0);
m_simDevice.createBoolean("init", Direction.OUTPUT, true);
m_simRateX = m_simDevice.createDouble("rate_x", Direction.INPUT, 0.0);
m_simRateY = m_simDevice.createDouble("rate_y", Direction.INPUT, 0.0);
m_simRateZ = m_simDevice.createDouble("rate_z", Direction.INPUT, 0.0);
m_simAngleX = m_simDevice.createDouble("angle_x", Direction.kInput, 0.0);
m_simAngleY = m_simDevice.createDouble("angle_y", Direction.kInput, 0.0);
m_simAngleZ = m_simDevice.createDouble("angle_z", Direction.kInput, 0.0);
m_simAngleX = m_simDevice.createDouble("angle_x", Direction.INPUT, 0.0);
m_simAngleY = m_simDevice.createDouble("angle_y", Direction.INPUT, 0.0);
m_simAngleZ = m_simDevice.createDouble("angle_z", Direction.INPUT, 0.0);
} else {
m_simRateX = null;
m_simRateY = null;

View File

@@ -8,19 +8,19 @@ using namespace wpi::romi;
RomiGyro::RomiGyro() : m_simDevice("Gyro:RomiGyro") {
if (m_simDevice) {
m_simDevice.CreateBoolean("init", hal::SimDevice::kOutput, true);
m_simRateX =
m_simDevice.CreateDouble("rate_x", hal::SimDevice::kInput, 0.0);
m_simRateY =
m_simDevice.CreateDouble("rate_y", hal::SimDevice::kInput, 0.0);
m_simRateZ =
m_simDevice.CreateDouble("rate_z", hal::SimDevice::kInput, 0.0);
m_simAngleX =
m_simDevice.CreateDouble("angle_x", hal::SimDevice::kInput, 0.0);
m_simAngleY =
m_simDevice.CreateDouble("angle_y", hal::SimDevice::kInput, 0.0);
m_simAngleZ =
m_simDevice.CreateDouble("angle_z", hal::SimDevice::kInput, 0.0);
m_simDevice.CreateBoolean("init", hal::SimDevice::Direction::OUTPUT, true);
m_simRateX = m_simDevice.CreateDouble(
"rate_x", hal::SimDevice::Direction::INPUT, 0.0);
m_simRateY = m_simDevice.CreateDouble(
"rate_y", hal::SimDevice::Direction::INPUT, 0.0);
m_simRateZ = m_simDevice.CreateDouble(
"rate_z", hal::SimDevice::Direction::INPUT, 0.0);
m_simAngleX = m_simDevice.CreateDouble(
"angle_x", hal::SimDevice::Direction::INPUT, 0.0);
m_simAngleY = m_simDevice.CreateDouble(
"angle_y", hal::SimDevice::Direction::INPUT, 0.0);
m_simAngleZ = m_simDevice.CreateDouble(
"angle_z", hal::SimDevice::Direction::INPUT, 0.0);
}
}