[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

@@ -17,7 +17,7 @@
#include <wpi/DecayedDerivedFrom.h>
#include "frc2/command/CommandGroupBase.h"
#include "frc2/command/CommandBase.h"
#include "frc2/command/CommandHelper.h"
namespace frc2 {
@@ -33,7 +33,7 @@ namespace frc2 {
* This class is provided by the NewCommands VendorDep
*/
class ParallelCommandGroup
: public CommandHelper<CommandGroupBase, ParallelCommandGroup> {
: public CommandHelper<CommandBase, ParallelCommandGroup> {
public:
/**
* Creates a new ParallelCommandGroup. The given commands will be executed
@@ -67,6 +67,11 @@ class ParallelCommandGroup
// Prevent template expansion from emulating copy ctor
ParallelCommandGroup(ParallelCommandGroup&) = delete;
/**
* Adds the given commands to the group.
*
* @param commands Commands to add to the group.
*/
template <wpi::DecayedDerivedFrom<Command>... Commands>
void AddCommands(Commands&&... commands) {
std::vector<std::unique_ptr<Command>> foo;
@@ -89,7 +94,7 @@ class ParallelCommandGroup
Command::InterruptionBehavior GetInterruptionBehavior() const override;
private:
void AddCommands(std::vector<std::unique_ptr<Command>>&& commands) final;
void AddCommands(std::vector<std::unique_ptr<Command>>&& commands);
std::vector<std::pair<std::unique_ptr<Command>, bool>> m_commands;
bool m_runWhenDisabled{true};