[wpilibc] Add doxygen deprecated tag to deprecated methods (#2336)

This commit is contained in:
sciencewhiz
2020-03-31 20:43:04 -07:00
committed by GitHub
parent 43574128b3
commit 3a5e541b2d
18 changed files with 125 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -17,10 +17,12 @@ namespace frc {
* Common interface for controllers. Controllers run control loops, the most
* common are PID controllers and their variants, but this includes anything
* that is controlling an actuator in a separate thread.
*
* @deprecated Only used by the deprecated PIDController
*/
class Controller {
public:
WPI_DEPRECATED("None of the 2020 FRC controllers use this.")
WPI_DEPRECATED("Only used by the deprecated PIDController")
Controller() = default;
virtual ~Controller() = default;

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -192,6 +192,9 @@ class Encoder : public ErrorBase,
* the FPGA will report the device stopped. This is expressed
* in seconds.
*/
WPI_DEPRECATED(
"Use SetMinRate() in favor of this method. This takes unscaled periods "
"and SetMinRate() scales using value from SetDistancePerPulse().")
void SetMaxPeriod(double maxPeriod) override;
/**

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -22,6 +22,8 @@ namespace frc {
* Implements the gear tooth sensor supplied by FIRST. Currently there is no
* reverse sensing on the gear tooth sensor, but in future versions we might
* implement the necessary timing in the FPGA to sense direction.
*
* @deprecated No longer used per FMS usage reporting
*/
class GearTooth : public Counter {
public:

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -21,6 +21,9 @@ namespace frc {
*
* Periodic() functions from the base class are called each time a new packet is
* received from the driver station.
*
* @deprecated Use TimedRobot instead. It's a drop-in replacement that provides
* more regular execution periods.
*/
class IterativeRobot : public IterativeRobotBase {
public:

View File

@@ -159,8 +159,11 @@ class IterativeRobotBase : public RobotBase {
* Constructor for IterativeRobotBase.
*
* @param period Period in seconds.
*
* @deprecated Use IterativeRobotBase(units::second_t period) with unit-safety
* instead
*/
WPI_DEPRECATED("Use ctor with unit-safety instead.")
WPI_DEPRECATED("Use constructor with unit-safety instead.")
explicit IterativeRobotBase(double period);
/**

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -66,6 +66,9 @@ class Notifier : public ErrorBase {
*
* A timer event is queued for a single event after the specified delay.
*
* @deprecated Use unit-safe StartSingle(units::second_t delay) method
* instead.
*
* @param delay Seconds to wait before the handler is called.
*/
WPI_DEPRECATED("Use unit-safe StartSingle method instead.")
@@ -87,6 +90,9 @@ class Notifier : public ErrorBase {
* interrupt occurs, the event will be immediately requeued for the same time
* interval.
*
* @deprecated Use unit-safe StartPeriodic(units::second_t period) method
* instead
*
* @param period Period in seconds to call the handler starting one period
* after the call to this method.
*/

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -35,6 +35,8 @@ class SendableBuilder;
* This feedback controller runs in discrete time, so time deltas are not used
* in the integral and derivative calculations. Therefore, the sample rate
* affects the controller's behavior for a given set of PID constants.
*
* @deprecated All APIs which use this have been deprecated.
*/
class PIDBase : public PIDInterface,
public PIDOutput,

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -33,6 +33,8 @@ class PIDOutput;
* This feedback controller runs in discrete time, so time deltas are not used
* in the integral and derivative calculations. Therefore, the sample rate
* affects the controller's behavior for a given set of PID constants.
*
* @deprecated Use frc2::PIDController class instead.
*/
class PIDController : public PIDBase, public Controller {
public:

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2016-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -11,6 +11,11 @@
namespace frc {
/**
* Interface for PID Control Loop.
*
* @deprecated All APIs which use this have been deprecated.
*/
class PIDInterface {
public:
WPI_DEPRECATED("All APIs which use this have been deprecated.")

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -30,6 +30,9 @@ class GenericHID;
* supplied on creation of the class. Those are used for either the Drive
* function (intended for hand created drive code, such as autonomous) or with
* the Tank/Arcade functions intended to be used for Operator Control driving.
*
* @deprecated Use DifferentialDrive or MecanumDrive classes instead.
*
*/
class RobotDrive : public MotorSafety {
public:

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -82,15 +82,21 @@ class SPI : public ErrorBase {
/**
* Configure that the data is stable on the falling edge and the data
* changes on the rising edge.
*
* @deprecated Use SetSampleDataOnTrailingEdge() instead.
*
*/
WPI_DEPRECATED("Use SetSampleDataOnTrailingEdge in most cases.")
WPI_DEPRECATED("Use SetSampleDataOnTrailingEdge instead.")
void SetSampleDataOnFalling();
/**
* Configure that the data is stable on the rising edge and the data
* changes on the falling edge.
*
* @deprecated Use SetSampleDataOnLeadingEdge() instead.
*
*/
WPI_DEPRECATED("Use SetSampleDataOnLeadingEdge in most cases")
WPI_DEPRECATED("Use SetSampleDataOnLeadingEdge instead")
void SetSampleDataOnRising();
/**
@@ -190,6 +196,8 @@ class SPI : public ErrorBase {
* InitAuto() and SetAutoTransmitData() must be called before calling this
* function.
*
* @deprecated use unit-safe StartAutoRate(units::second_t period) instead.
*
* @param period period between transfers, in seconds (us resolution)
*/
WPI_DEPRECATED("Use StartAutoRate with unit-safety instead")
@@ -253,6 +261,10 @@ class SPI : public ErrorBase {
* Blocks until numToRead words have been read or timeout expires.
* May be called with numToRead=0 to retrieve how many words are available.
*
* @deprecated Use unit safe version instead.
* ReadAutoReceivedData(uint32_t* buffer, int numToRead, <!--
* --> units::second_t timeout)
*
* @param buffer buffer where read words are stored
* @param numToRead number of words to read
* @param timeout timeout in seconds (ms resolution)
@@ -304,6 +316,11 @@ class SPI : public ErrorBase {
/**
* Initialize the accumulator.
*
* @deprecated Use unit-safe version instead.
* InitAccumulator(units::second_t period, int cmd, int <!--
* --> xferSize, int validMask, int validValue, int dataShift, <!--
* --> int dataSize, bool isSigned, bool bigEndian)
*
* @param period Time between reads
* @param cmd SPI command to send to request data
* @param xferSize SPI transfer size, in bytes

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2017-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -47,6 +47,9 @@ class TimedRobot : public IterativeRobotBase, public ErrorBase {
/**
* Constructor for TimedRobot.
*
* @deprecated use unit safe constructor instead.
* TimedRobot(units::second_t period = kDefaultPeriod)
*
* @param period Period in seconds.
*/
WPI_DEPRECATED("Use constructor with unit-safety instead.")

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -34,6 +34,9 @@ class Watchdog {
/**
* Watchdog constructor.
*
* @deprecated use unit-safe version instead.
* Watchdog(units::second_t timeout, std::function<void()> callback)
*
* @param timeout The watchdog's timeout in seconds with microsecond
* resolution.
* @param callback This function is called when the timeout expires.
@@ -74,6 +77,9 @@ class Watchdog {
/**
* Sets the watchdog's timeout.
*
* @deprecated use the unit safe version instead.
* SetTimeout(units::second_t timeout)
*
* @param timeout The watchdog's timeout in seconds with microsecond
* resolution.
*/

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2015-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2015-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -17,6 +17,8 @@ namespace frc {
/**
* Interface for filters
*
* @deprecated only used by the deprecated LinearDigitalFilter
*/
class Filter : public PIDSource {
public:

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2015-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2015-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -68,6 +68,8 @@ namespace frc {
* definitely need to adjust the gains if you then want to run it at 200Hz!
* Combining this with Note 1 - the impetus is on YOU as a developer to make
* sure PIDGet() gets called at the desired, constant frequency!
*
* @deprecated Use LinearFilter class instead
*/
class LinearDigitalFilter : public Filter {
public:

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2017-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -17,7 +17,9 @@ namespace frc {
class SendableBase : public Sendable, public SendableHelper<SendableBase> {
public:
/**
* Creates an instance of the sensor base.
* Creates an instance of the sensor base
*
* @deprecated use Sendable and SendableHelper
*
* @param addLiveWindow if true, add this Sendable to LiveWindow
*/

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2011-2018 FIRST. All Rights Reserved. */
/* Copyright (c) 2011-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -50,9 +50,31 @@ class SendableChooser : public SendableChooserBase {
void AddOption(wpi::StringRef name, T object);
void SetDefaultOption(wpi::StringRef name, T object);
/**
* Adds the given object to the list of options.
*
* On the SmartDashboard on the desktop, the object will appear as the given
* name.
*
* @deprecated use AddOption(wpi::StringRef name, T object) instead.
*
* @param name the name of the option
* @param object the option
*/
WPI_DEPRECATED("use AddOption() instead")
void AddObject(wpi::StringRef name, T object) { AddOption(name, object); }
/**
* Add the given object to the list of options and marks it as the default.
*
* Functionally, this is very close to AddOption() except that it will use
* this as the default option if none other is explicitly selected.
*
* @deprecated use SetDefaultOption(wpi::StringRef name, T object) instead.
*
* @param name the name of the option
* @param object the option
*/
WPI_DEPRECATED("use SetDefaultOption() instead")
void AddDefault(wpi::StringRef name, T object) {
SetDefaultOption(name, object);

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -46,6 +46,8 @@ class SendableHelper {
/**
* Gets the name of this Sendable object.
*
* @deprecated use SendableRegistry::GetName()
*
* @return Name
*/
WPI_DEPRECATED("use SendableRegistry::GetName()")
@@ -57,6 +59,8 @@ class SendableHelper {
/**
* Sets the name of this Sendable object.
*
* @deprecated use SendableRegistry::SetName()
*
* @param name name
*/
WPI_DEPRECATED("use SendableRegistry::SetName()")
@@ -67,6 +71,8 @@ class SendableHelper {
/**
* Sets both the subsystem name and device name of this Sendable object.
*
* @deprecated use SendableRegistry::SetName()
*
* @param subsystem subsystem name
* @param name device name
*/
@@ -79,6 +85,8 @@ class SendableHelper {
/**
* Gets the subsystem name of this Sendable object.
*
* @deprecated use SendableRegistry::GetSubsystem().
*
* @return Subsystem name
*/
WPI_DEPRECATED("use SendableRegistry::GetSubsystem()")
@@ -90,6 +98,8 @@ class SendableHelper {
/**
* Sets the subsystem name of this Sendable object.
*
* @deprecated use SendableRegistry::SetSubsystem()
*
* @param subsystem subsystem name
*/
WPI_DEPRECATED("use SendableRegistry::SetSubsystem()")
@@ -102,6 +112,8 @@ class SendableHelper {
/**
* Add a child component.
*
* @deprecated use SendableRegistry::AddChild()
*
* @param child child component
*/
WPI_DEPRECATED("use SendableRegistry::AddChild()")
@@ -113,6 +125,8 @@ class SendableHelper {
/**
* Add a child component.
*
* @deprecated use SendableRegistry::AddChild()
*
* @param child child component
*/
WPI_DEPRECATED("use SendableRegistry::AddChild()")
@@ -124,6 +138,8 @@ class SendableHelper {
/**
* Sets the name of the sensor with a channel number.
*
* @deprecated use SendableRegistry::SetName()
*
* @param moduleType A string that defines the module name in the label for
* the value
* @param channel The channel number the device is plugged into
@@ -137,6 +153,8 @@ class SendableHelper {
/**
* Sets the name of the sensor with a module and channel number.
*
* @deprecated use SendableRegistry::SetName()
*
* @param moduleType A string that defines the module name in the label for
* the value
* @param moduleNumber The number of the particular module type