[hal,wpilib] Rename RuntimeType constants to all caps

This commit is contained in:
Peter Johnson
2026-03-14 10:33:36 -07:00
parent 227f01f3bd
commit f6fdae3212
11 changed files with 38 additions and 38 deletions

View File

@@ -162,7 +162,7 @@ public abstract class RobotBase implements AutoCloseable {
* @return If the robot is running in simulation.
*/
public static boolean isSimulation() {
return getRuntimeType() == RuntimeType.kSimulation;
return getRuntimeType() == RuntimeType.SIMULATION;
}
/**
@@ -172,7 +172,7 @@ public abstract class RobotBase implements AutoCloseable {
*/
public static boolean isReal() {
RuntimeType runtimeType = getRuntimeType();
return runtimeType == RuntimeType.kSystemcore;
return runtimeType == RuntimeType.SYSTEMCORE;
}
/**

View File

@@ -9,13 +9,13 @@ import org.wpilib.hardware.hal.HALUtil;
/** Runtime type. */
public enum RuntimeType {
/** roboRIO 1.0. */
kRoboRIO(HALUtil.RUNTIME_ROBORIO),
ROBORIO(HALUtil.RUNTIME_ROBORIO),
/** roboRIO 2.0. */
kRoboRIO2(HALUtil.RUNTIME_ROBORIO2),
ROBORIO_2(HALUtil.RUNTIME_ROBORIO_2),
/** Simulation runtime. */
kSimulation(HALUtil.RUNTIME_SIMULATION),
SIMULATION(HALUtil.RUNTIME_SIMULATION),
/** Systemcore. */
kSystemcore(HALUtil.RUNTIME_SYSTEMCORE);
SYSTEMCORE(HALUtil.RUNTIME_SYSTEMCORE);
/** RuntimeType value. */
public final int value;
@@ -32,10 +32,10 @@ public enum RuntimeType {
*/
public static RuntimeType getValue(int type) {
return switch (type) {
case HALUtil.RUNTIME_ROBORIO -> RuntimeType.kRoboRIO;
case HALUtil.RUNTIME_ROBORIO2 -> RuntimeType.kRoboRIO2;
case HALUtil.RUNTIME_SYSTEMCORE -> RuntimeType.kSystemcore;
default -> RuntimeType.kSimulation;
case HALUtil.RUNTIME_ROBORIO -> RuntimeType.ROBORIO;
case HALUtil.RUNTIME_ROBORIO_2 -> RuntimeType.ROBORIO_2;
case HALUtil.RUNTIME_SYSTEMCORE -> RuntimeType.SYSTEMCORE;
default -> RuntimeType.SIMULATION;
};
}
}