mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[hal,wpilib] Rename RuntimeType constants to all caps
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user