mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[hal] Rename SimDevice constants to all caps
Also use enum class for SimDevice C++ wrapper.
This commit is contained in:
@@ -119,13 +119,13 @@ public class ADXL345_I2C implements NTSendable, AutoCloseable {
|
||||
m_simRange =
|
||||
m_simDevice.createEnumDouble(
|
||||
"range",
|
||||
SimDevice.Direction.kOutput,
|
||||
SimDevice.Direction.OUTPUT,
|
||||
new String[] {"2G", "4G", "8G", "16G"},
|
||||
new double[] {2.0, 4.0, 8.0, 16.0},
|
||||
0);
|
||||
m_simX = m_simDevice.createDouble("x", SimDevice.Direction.kInput, 0.0);
|
||||
m_simY = m_simDevice.createDouble("y", SimDevice.Direction.kInput, 0.0);
|
||||
m_simZ = m_simDevice.createDouble("z", SimDevice.Direction.kInput, 0.0);
|
||||
m_simX = m_simDevice.createDouble("x", SimDevice.Direction.INPUT, 0.0);
|
||||
m_simY = m_simDevice.createDouble("y", SimDevice.Direction.INPUT, 0.0);
|
||||
m_simZ = m_simDevice.createDouble("z", SimDevice.Direction.INPUT, 0.0);
|
||||
}
|
||||
|
||||
// Turn on the measurements
|
||||
|
||||
@@ -48,7 +48,7 @@ public abstract class PWMMotorController extends MotorSafety
|
||||
|
||||
m_simDevice = SimDevice.create("PWMMotorController", channel);
|
||||
if (m_simDevice != null) {
|
||||
m_simDutyCycle = m_simDevice.createDouble("DutyCycle", Direction.kOutput, 0.0);
|
||||
m_simDutyCycle = m_simDevice.createDouble("DutyCycle", Direction.OUTPUT, 0.0);
|
||||
m_pwm.setSimDevice(m_simDevice);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public class SharpIR implements Sendable, AutoCloseable {
|
||||
|
||||
m_simDevice = SimDevice.create("SharpIR", m_sensor.getChannel());
|
||||
if (m_simDevice != null) {
|
||||
m_simRange = m_simDevice.createDouble("Range (m)", Direction.kInput, 0.0);
|
||||
m_simRange = m_simDevice.createDouble("Range (m)", Direction.INPUT, 0.0);
|
||||
m_sensor.setSimDevice(m_simDevice);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public class AnalogEncoder implements Sendable, AutoCloseable {
|
||||
m_simDevice = SimDevice.create("AnalogEncoder", m_analogInput.getChannel());
|
||||
|
||||
if (m_simDevice != null) {
|
||||
m_simPosition = m_simDevice.createDouble("Position", Direction.kInput, 0.0);
|
||||
m_simPosition = m_simDevice.createDouble("Position", Direction.INPUT, 0.0);
|
||||
}
|
||||
|
||||
m_fullRange = fullRange;
|
||||
|
||||
@@ -86,8 +86,8 @@ public class DutyCycleEncoder implements Sendable, AutoCloseable {
|
||||
m_simDevice = SimDevice.create("DutyCycle:DutyCycleEncoder", m_dutyCycle.getSourceChannel());
|
||||
|
||||
if (m_simDevice != null) {
|
||||
m_simPosition = m_simDevice.createDouble("Position", SimDevice.Direction.kInput, 0.0);
|
||||
m_simIsConnected = m_simDevice.createBoolean("Connected", SimDevice.Direction.kInput, true);
|
||||
m_simPosition = m_simDevice.createDouble("Position", SimDevice.Direction.INPUT, 0.0);
|
||||
m_simIsConnected = m_simDevice.createBoolean("Connected", SimDevice.Direction.INPUT, true);
|
||||
}
|
||||
|
||||
m_fullRange = fullRange;
|
||||
|
||||
Reference in New Issue
Block a user