From 5c659fdcdfdd5b898b0de4a150348134b7364818 Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Thu, 23 Nov 2017 01:21:36 -0800 Subject: [PATCH] Deprecated PIDController::SetTolerance() (#764) PIDController::SetPercentTolerance() behaves identically to it, so removing SetTolerance() leaves one obvious way to do absolute or percent tolerance. --- wpilibc/src/main/native/include/PIDController.h | 1 + .../src/main/java/edu/wpi/first/wpilibj/PIDController.java | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/wpilibc/src/main/native/include/PIDController.h b/wpilibc/src/main/native/include/PIDController.h index 60d8ae10a4..9dd2307a8c 100644 --- a/wpilibc/src/main/native/include/PIDController.h +++ b/wpilibc/src/main/native/include/PIDController.h @@ -75,6 +75,7 @@ class PIDController : public LiveWindowSendable, public PIDInterface { virtual void SetPIDSourceType(PIDSourceType pidSource); virtual PIDSourceType GetPIDSourceType() const; + WPI_DEPRECATED("Use SetPercentTolerance() instead.") virtual void SetTolerance(double percent); virtual void SetAbsoluteTolerance(double absValue); virtual void SetPercentTolerance(double percentValue); diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/PIDController.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/PIDController.java index 96a7b52c85..3a54a3f989 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/PIDController.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/PIDController.java @@ -554,9 +554,11 @@ public class PIDController implements PIDInterface, LiveWindowSendable, Controll * object. Use it by creating the type of tolerance that you want to use: setTolerance(new * PIDController.AbsoluteTolerance(0.1)) * - * @param tolerance a tolerance object of the right type, e.g. PercentTolerance or + * @deprecated Use setPercentTolerance() instead. + * @param tolerance A tolerance object of the right type, e.g. PercentTolerance or * AbsoluteTolerance */ + @Deprecated public void setTolerance(Tolerance tolerance) { m_tolerance = tolerance; }