mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Fix cancel of inner commands in ConditionalCommands (#858)
This commit is contained in:
committed by
Peter Johnson
parent
0e8ff4663d
commit
e4e1eab413
@@ -10,23 +10,25 @@
|
||||
#include <llvm/Twine.h>
|
||||
|
||||
#include "Commands/Command.h"
|
||||
#include "Commands/InstantCommand.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
/**
|
||||
* A ConditionalCommand is a Command that starts one of two commands.
|
||||
*
|
||||
* A ConditionalCommand uses m_condition to determine whether it should run
|
||||
* m_onTrue or m_onFalse.
|
||||
* A ConditionalCommand uses the Condition method to determine whether it should
|
||||
* run onTrue or onFalse.
|
||||
*
|
||||
* A ConditionalCommand adds the proper Command to the Scheduler during
|
||||
* Initialize() and then IsFinished() will return true once that Command has
|
||||
* finished executing.
|
||||
*
|
||||
* If no Command is specified for m_onFalse, the occurrence of that condition
|
||||
* If no Command is specified for onFalse, the occurrence of that condition
|
||||
* will be a no-op.
|
||||
*
|
||||
* A CondtionalCommand will require the superset of subsystems of the onTrue
|
||||
* and onFalse commands.
|
||||
*
|
||||
* @see Command
|
||||
* @see Scheduler
|
||||
*/
|
||||
@@ -48,7 +50,7 @@ class ConditionalCommand : public Command {
|
||||
void _Initialize() override;
|
||||
void _Cancel() override;
|
||||
bool IsFinished() override;
|
||||
void Interrupted() override;
|
||||
void _Interrupted() override;
|
||||
|
||||
private:
|
||||
// The Command to execute if Condition() returns true
|
||||
|
||||
Reference in New Issue
Block a user