Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame] | 1 | /*----------------------------------------------------------------------------*/ |
| 2 | /* Copyright (c) FIRST 2014-2017. 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 the root directory of */ |
| 5 | /* the project. */ |
| 6 | /*----------------------------------------------------------------------------*/ |
| 7 | |
| 8 | #pragma once |
| 9 | |
| 10 | #include <memory> |
| 11 | #include <string> |
| 12 | |
| 13 | #include "frc971/wpilib/ahal/SensorBase.h" |
| 14 | |
| 15 | namespace frc { |
| 16 | |
| 17 | /** |
| 18 | * Class for getting voltage, current, temperature, power and energy from the |
| 19 | * CAN PDP. |
| 20 | */ |
| 21 | class PowerDistributionPanel { |
| 22 | public: |
| 23 | PowerDistributionPanel(); |
| 24 | explicit PowerDistributionPanel(int module); |
| 25 | |
| 26 | double GetVoltage() const; |
| 27 | double GetTemperature() const; |
| 28 | double GetCurrent(int channel) const; |
| 29 | double GetTotalCurrent() const; |
| 30 | double GetTotalPower() const; |
| 31 | double GetTotalEnergy() const; |
| 32 | void ResetTotalEnergy(); |
| 33 | void ClearStickyFaults(); |
| 34 | |
| 35 | private: |
| 36 | int m_module; |
| 37 | }; |
| 38 | |
| 39 | } // namespace frc |