WPILibC++  unspecified
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 "SensorBase.h"
11 
12 namespace frc {
13 
19  public:
21  explicit PowerDistributionPanel(int module);
22 
23  double GetVoltage() const;
24  double GetTemperature() const;
25  double GetCurrent(int channel) const;
26  double GetTotalCurrent() const;
27  double GetTotalPower() const;
28  double GetTotalEnergy() const;
29  void ResetTotalEnergy();
30  void ClearStickyFaults();
31 
32  void InitSendable(SendableBuilder& builder) override;
33 
34  private:
35  int m_module;
36 };
37 
38 } // namespace frc
double GetVoltage() const
Query the input voltage of the PDP.
Definition: PowerDistributionPanel.cpp:43
Definition: RobotController.cpp:14
double GetCurrent(int channel) const
Query the current of a single channel of the PDP.
Definition: PowerDistributionPanel.cpp:77
Base class for all sensors.
Definition: SensorBase.h:25
double GetTemperature() const
Query the temperature of the PDP.
Definition: PowerDistributionPanel.cpp:60
void ResetTotalEnergy()
Reset the total energy drawn from the PDP.
Definition: PowerDistributionPanel.cpp:152
void ClearStickyFaults()
Remove all of the fault flags on the PDP.
Definition: PowerDistributionPanel.cpp:165
double GetTotalPower() const
Query the total power drawn from the monitored PDP channels.
Definition: PowerDistributionPanel.cpp:118
double GetTotalCurrent() const
Query the total current of all monitored PDP channels (0-15).
Definition: PowerDistributionPanel.cpp:101
Definition: SendableBuilder.h:23
Class for getting voltage, current, temperature, power and energy from the CAN PDP.
Definition: PowerDistributionPanel.h:18
void InitSendable(SendableBuilder &builder) override
Initializes this Sendable object.
Definition: PowerDistributionPanel.cpp:175
double GetTotalEnergy() const
Query the total energy drawn from the monitored PDP channels.
Definition: PowerDistributionPanel.cpp:135