Brian Silverman | 26e4e52 | 2015-12-17 01:56:40 -0500 | [diff] [blame] | 1 | /*----------------------------------------------------------------------------*/ |
Brian Silverman | 1a67511 | 2016-02-20 20:42:49 -0500 | [diff] [blame^] | 2 | /* Copyright (c) FIRST 2008-2016. All Rights Reserved. */ |
Brian Silverman | 26e4e52 | 2015-12-17 01:56:40 -0500 | [diff] [blame] | 3 | /* Open Source Software - may be modified and shared by FRC teams. The code */ |
Brian Silverman | 1a67511 | 2016-02-20 20:42:49 -0500 | [diff] [blame^] | 4 | /* must be accompanied by the FIRST BSD license file in the root directory of */ |
| 5 | /* the project. */ |
Brian Silverman | 26e4e52 | 2015-12-17 01:56:40 -0500 | [diff] [blame] | 6 | /*----------------------------------------------------------------------------*/ |
Brian Silverman | 1a67511 | 2016-02-20 20:42:49 -0500 | [diff] [blame^] | 7 | |
Brian Silverman | 26e4e52 | 2015-12-17 01:56:40 -0500 | [diff] [blame] | 8 | #pragma once |
| 9 | |
| 10 | #include "SensorBase.h" |
| 11 | #include "PIDSource.h" |
| 12 | #include "interfaces/Gyro.h" |
| 13 | #include "LiveWindow/LiveWindowSendable.h" |
| 14 | |
| 15 | #include <memory> |
| 16 | |
| 17 | /** |
| 18 | * GyroBase is the common base class for Gyro implementations such as |
| 19 | * AnalogGyro. |
| 20 | */ |
| 21 | class GyroBase : public Gyro, public SensorBase, public PIDSource, public LiveWindowSendable { |
| 22 | public: |
| 23 | virtual ~GyroBase() = default; |
| 24 | |
| 25 | // PIDSource interface |
| 26 | double PIDGet() override; |
| 27 | |
| 28 | void UpdateTable() override; |
| 29 | void StartLiveWindowMode() override; |
| 30 | void StopLiveWindowMode() override; |
| 31 | std::string GetSmartDashboardType() const override; |
| 32 | void InitTable(std::shared_ptr<ITable> subTable) override; |
| 33 | std::shared_ptr<ITable> GetTable() const override; |
| 34 | |
| 35 | private: |
| 36 | std::shared_ptr<ITable> m_table; |
| 37 | }; |