WPILibC++  2018.4.1-20180920010257-1187-gd2a5aaa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
PowerDistributionPanel.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2014-2018 FIRST. 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 "frc/ErrorBase.h"
11 #include "frc/smartdashboard/SendableBase.h"
12 
13 namespace frc {
14 
20  public:
22  explicit PowerDistributionPanel(int module);
23 
29  double GetVoltage() const;
30 
36  double GetTemperature() const;
37 
43  double GetCurrent(int channel) const;
44 
50  double GetTotalCurrent() const;
51 
57  double GetTotalPower() const;
58 
64  double GetTotalEnergy() const;
65 
71  void ResetTotalEnergy();
72 
76  void ClearStickyFaults();
77 
78  void InitSendable(SendableBuilder& builder) override;
79 
80  private:
81  int m_handle;
82 };
83 
84 } // namespace frc
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
double GetVoltage() const
Query the input voltage of the PDP.
double GetTemperature() const
Query the temperature of the PDP.
double GetTotalCurrent() const
Query the total current of all monitored PDP channels (0-15).
double GetTotalEnergy() const
Query the total energy drawn from the monitored PDP channels.
double GetTotalPower() const
Query the total power drawn from the monitored PDP channels.
Base class for most objects.
Definition: ErrorBase.h:74
Definition: SendableBase.h:19
void ClearStickyFaults()
Remove all of the fault flags on the PDP.
Definition: SendableBuilder.h:23
double GetCurrent(int channel) const
Query the current of a single channel of the PDP.
Class for getting voltage, current, temperature, power and energy from the CAN PDP.
Definition: PowerDistributionPanel.h:19
void InitSendable(SendableBuilder &builder) override
Initializes this Sendable object.
void ResetTotalEnergy()
Reset the total energy drawn from the PDP.