Skip to content

Commit dd22b53

Browse files
authored
RobotHardwarsStats Changes (#17)
* added new is sim logic * cleaned up code * I should look over what copilot writes for me more carefully
1 parent 0841029 commit dd22b53

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

src/main/java/org/trigon/hardware/RobotHardwareStats.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@ public class RobotHardwareStats {
55
private static boolean IS_REPLAY = false;
66
private static double PERIODIC_TIME_SECONDS = 0.02;
77

8-
public static void setCurrentRobotStats(boolean isReal, boolean isSimulation, boolean isReplay) {
9-
IS_SIMULATION = isSimulation && !isReal;
10-
IS_REPLAY = isReplay && !isReal;
8+
public static void setCurrentRobotStats(boolean isReal, ReplayType replayType) {
9+
if (isReal || replayType.equals(ReplayType.NONE)) {
10+
IS_SIMULATION = !isReal;
11+
IS_REPLAY = false;
12+
return;
13+
}
14+
15+
IS_SIMULATION = replayType.equals(ReplayType.SIMULATION_REPLAY);
16+
IS_REPLAY = true;
1117
}
1218

1319
public static void setPeriodicTimeSeconds(double periodicTimeSeconds) {
@@ -25,4 +31,10 @@ public static boolean isReplay() {
2531
public static boolean isSimulation() {
2632
return IS_SIMULATION;
2733
}
28-
}
34+
35+
public enum ReplayType {
36+
NONE,
37+
SIMULATION_REPLAY,
38+
REAL_REPLAY
39+
}
40+
}

0 commit comments

Comments
 (0)