[commands] Remove deprecated classes and functions (#5409)

Removes:
- PerpetualCommand
- Command.perpetually()
- CommandGroupBase
- Command.IsGrouped() (C++ only)
- Command.SetGrouped() (C++ only)
- Command.withInterrupt()
- ProxyScheduleCommand
- Button
- InternalButton, JoystickButton, NetworkButton and POVButton now subclass Trigger
- Old style Trigger functions:
    - Trigger.whenActive
    - Trigger.whileActiveOnce
    - Trigger.whileActiveContinuous
    - Trigger.whenInactive
    - Trigger.toggleWhenActive
    - Trigger.cancelWhenActive
- CommandScheduler.clearButtons()
- CommandScheduler.addButtons() (Java only)
- Command supplier constructor of SelectCommand
This commit is contained in:
Ryan Blue
2023-07-10 12:56:18 -04:00
committed by GitHub
parent b250a03944
commit 7a099cb02a
49 changed files with 82 additions and 2031 deletions

View File

@@ -5,9 +5,8 @@
#pragma once
#include <frc/GenericHID.h>
#include <wpi/deprecated.h>
#include "Button.h"
#include "Trigger.h"
namespace frc2 {
/**
@@ -18,7 +17,7 @@ namespace frc2 {
*
* @see Trigger
*/
class POVButton : public Button {
class POVButton : public Trigger {
public:
/**
* Creates a POVButton that commands can be bound to.
@@ -27,11 +26,9 @@ class POVButton : public Button {
* @param angle The angle of the POV corresponding to a button press.
* @param povNumber The number of the POV on the joystick.
*/
WPI_IGNORE_DEPRECATED
POVButton(frc::GenericHID* joystick, int angle, int povNumber = 0)
: Button([joystick, angle, povNumber] {
: Trigger([joystick, angle, povNumber] {
return joystick->GetPOV(povNumber) == angle;
}) {}
WPI_UNIGNORE_DEPRECATED
};
} // namespace frc2