[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

@@ -11,7 +11,6 @@
#include "frc2/command/ParallelCommandGroup.h"
#include "frc2/command/ParallelDeadlineGroup.h"
#include "frc2/command/ParallelRaceGroup.h"
#include "frc2/command/PerpetualCommand.h"
#include "frc2/command/RepeatCommand.h"
#include "frc2/command/SequentialCommandGroup.h"
#include "frc2/command/WaitCommand.h"
@@ -54,10 +53,6 @@ CommandPtr Command::WithInterruptBehavior(
return std::move(*this).ToPtr().WithInterruptBehavior(interruptBehavior);
}
CommandPtr Command::WithInterrupt(std::function<bool()> condition) && {
return std::move(*this).ToPtr().Until(std::move(condition));
}
CommandPtr Command::BeforeStarting(
std::function<void()> toRun,
std::initializer_list<Subsystem*> requirements) && {
@@ -82,12 +77,6 @@ CommandPtr Command::AndThen(std::function<void()> toRun,
return std::move(*this).ToPtr().AndThen(std::move(toRun), requirements);
}
PerpetualCommand Command::Perpetually() && {
WPI_IGNORE_DEPRECATED
return PerpetualCommand(std::move(*this).TransferOwnership());
WPI_UNIGNORE_DEPRECATED
}
CommandPtr Command::Repeatedly() && {
return std::move(*this).ToPtr().Repeatedly();
}
@@ -150,14 +139,6 @@ void Command::SetComposed(bool isComposed) {
m_isComposed = isComposed;
}
bool Command::IsGrouped() const {
return IsComposed();
}
void Command::SetGrouped(bool grouped) {
SetComposed(grouped);
}
namespace frc2 {
bool RequirementsDisjoint(Command* first, Command* second) {
bool disjoint = true;