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 "ErrorBase.h"
11 #include "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
double GetVoltage() const
Query the input voltage of the PDP.
Definition: PowerDistributionPanel.cpp:38
Definition: Utility.cpp:119
double GetCurrent(int channel) const
Query the current of a single channel of the PDP.
Definition: PowerDistributionPanel.cpp:62
double GetTemperature() const
Query the temperature of the PDP.
Definition: PowerDistributionPanel.cpp:50
void ResetTotalEnergy()
Reset the total energy drawn from the PDP.
Definition: PowerDistributionPanel.cpp:117
void ClearStickyFaults()
Remove all of the fault flags on the PDP.
Definition: PowerDistributionPanel.cpp:127
double GetTotalPower() const
Query the total power drawn from the monitored PDP channels.
Definition: PowerDistributionPanel.cpp:93
double GetTotalCurrent() const
Query the total current of all monitored PDP channels (0-15).
Definition: PowerDistributionPanel.cpp:81
Base class for most objects.
Definition: ErrorBase.h:74
Definition: SendableBase.h:19
Definition: SendableBuilder.h:23
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.
Definition: PowerDistributionPanel.cpp:137
double GetTotalEnergy() const
Query the total energy drawn from the monitored PDP channels.
Definition: PowerDistributionPanel.cpp:105