[wpilib] Make IterativeRobotBase::m_period private with getter

This commit is contained in:
Tyler Veness
2019-04-13 14:26:42 -07:00
committed by Peter Johnson
parent f00dfed7ac
commit 497b712f67
6 changed files with 16 additions and 18 deletions

View File

@@ -32,8 +32,6 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
* disabledPeriodic() - autonomousPeriodic() - teleopPeriodic() - testPeriodic()
*/
public abstract class IterativeRobotBase extends RobotBase {
protected double m_period;
private enum Mode {
kNone,
kDisabled,
@@ -43,6 +41,7 @@ public abstract class IterativeRobotBase extends RobotBase {
}
private Mode m_lastMode = Mode.kNone;
private final double m_period;
private final Watchdog m_watchdog;
private boolean m_ntFlushEnabled;
@@ -204,6 +203,11 @@ public abstract class IterativeRobotBase extends RobotBase {
m_ntFlushEnabled = enabled;
}
/** Gets time period between calls to Periodic() functions. */
public double getPeriod() {
return m_period;
}
@SuppressWarnings("PMD.CyclomaticComplexity")
protected void loopFunc() {
m_watchdog.reset();

View File

@@ -137,11 +137,6 @@ public class TimedRobot extends IterativeRobotBase {
NotifierJNI.stopNotifier(m_notifier);
}
/** Get time period between calls to Periodic() functions. */
public double getPeriod() {
return m_period;
}
/**
* Add a callback to run at a specific period.
*