mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[wpilib] Use IsSimulation() consistently (#3534)
This commit is contained in:
@@ -39,7 +39,7 @@ public final class Filesystem {
|
||||
* @return The operating directory
|
||||
*/
|
||||
public static File getOperatingDirectory() {
|
||||
if (RobotBase.isReal()) {
|
||||
if (!RobotBase.isSimulation()) {
|
||||
return new File("/home/lvuser");
|
||||
} else {
|
||||
return getLaunchDirectory();
|
||||
@@ -54,7 +54,7 @@ public final class Filesystem {
|
||||
* @return The 'deploy' directory
|
||||
*/
|
||||
public static File getDeployDirectory() {
|
||||
if (RobotBase.isReal()) {
|
||||
if (!RobotBase.isSimulation()) {
|
||||
return new File(getOperatingDirectory(), "deploy");
|
||||
} else {
|
||||
return new File(
|
||||
|
||||
@@ -74,7 +74,7 @@ public abstract class RobotBase implements AutoCloseable {
|
||||
|
||||
@Override
|
||||
public boolean isRoboRIO() {
|
||||
return RobotBase.isReal();
|
||||
return !RobotBase.isSimulation();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -154,7 +154,7 @@ public abstract class RobotBase implements AutoCloseable {
|
||||
setupMathShared();
|
||||
// subscribe to "" to force persistent values to propagate to local
|
||||
m_suball = new MultiSubscriber(inst, new String[] {""});
|
||||
if (isReal()) {
|
||||
if (!isSimulation()) {
|
||||
inst.startServer("/home/lvuser/networktables.json");
|
||||
} else {
|
||||
inst.startServer();
|
||||
@@ -202,7 +202,7 @@ public abstract class RobotBase implements AutoCloseable {
|
||||
* @return If the robot is running in simulation.
|
||||
*/
|
||||
public static boolean isSimulation() {
|
||||
return !isReal();
|
||||
return HALUtil.getHALRuntimeType() != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -337,7 +337,7 @@ public abstract class RobotBase implements AutoCloseable {
|
||||
m_robotCopy = robot;
|
||||
m_runMutex.unlock();
|
||||
|
||||
if (isReal()) {
|
||||
if (!isSimulation()) {
|
||||
final File file = new File("/tmp/frc_versions/FRC_Lib_Version.ini");
|
||||
try {
|
||||
if (file.exists() && !file.delete()) {
|
||||
|
||||
Reference in New Issue
Block a user