2016-11-18 17:42:40 -05:00
|
|
|
/*----------------------------------------------------------------------------*/
|
2017-08-23 22:06:13 -07:00
|
|
|
/* Copyright (c) 2016-2017 FIRST. All Rights Reserved. */
|
2016-11-18 17:42:40 -05:00
|
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
|
|
|
|
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
|
|
|
|
/* the project. */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
#include "Commands/Command.h"
|
|
|
|
|
|
|
|
|
|
namespace frc {
|
|
|
|
|
|
2016-11-19 00:26:22 -08:00
|
|
|
/**
|
2017-11-16 00:33:51 -08:00
|
|
|
* A TimedCommand will wait for a timeout before finishing.
|
|
|
|
|
*
|
|
|
|
|
* TimedCommand is used to execute a command for a given amount of time.
|
2016-11-19 00:26:22 -08:00
|
|
|
*/
|
2016-11-18 17:42:40 -05:00
|
|
|
class TimedCommand : public Command {
|
|
|
|
|
public:
|
|
|
|
|
TimedCommand(const std::string& name, double timeout);
|
|
|
|
|
explicit TimedCommand(double timeout);
|
|
|
|
|
virtual ~TimedCommand() = default;
|
|
|
|
|
|
|
|
|
|
protected:
|
2016-11-19 00:26:22 -08:00
|
|
|
bool IsFinished() override;
|
2016-11-18 17:42:40 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace frc
|