Brian Silverman | 26e4e52 | 2015-12-17 01:56:40 -0500 | [diff] [blame^] | 1 | /*----------------------------------------------------------------------------*/ |
| 2 | /* Copyright (c) FIRST 2008. All Rights Reserved. */ |
| 3 | /* Open Source Software - may be modified and shared by FRC teams. The code */ |
| 4 | /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ |
| 5 | /*----------------------------------------------------------------------------*/ |
| 6 | #pragma once |
| 7 | |
| 8 | #define DEFAULT_SAFETY_EXPIRATION 0.1 |
| 9 | |
| 10 | #include <sstream> |
| 11 | |
| 12 | class MotorSafety |
| 13 | { |
| 14 | public: |
| 15 | virtual void SetExpiration(float timeout) = 0; |
| 16 | virtual float GetExpiration() const = 0; |
| 17 | virtual bool IsAlive() const = 0; |
| 18 | virtual void StopMotor() = 0; |
| 19 | virtual void SetSafetyEnabled(bool enabled) = 0; |
| 20 | virtual bool IsSafetyEnabled() const = 0; |
| 21 | virtual void GetDescription(std::ostringstream& desc) const = 0; |
| 22 | }; |