mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user