WPILibC++  unspecified
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
PowerDistributionPanel.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) FIRST 2014-2016. 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 #ifndef __WPILIB_POWER_DISTRIBUTION_PANEL_H__
10 #define __WPILIB_POWER_DISTRIBUTION_PANEL_H__
11 
12 #include "SensorBase.h"
13 #include "LiveWindow/LiveWindowSendable.h"
14 
15 #include <memory>
16 
23  public:
25  PowerDistributionPanel(uint8_t module);
26 
27  double GetVoltage() const;
28  double GetTemperature() const;
29  double GetCurrent(uint8_t channel) const;
30  double GetTotalCurrent() const;
31  double GetTotalPower() const;
32  double GetTotalEnergy() const;
33  void ResetTotalEnergy();
34  void ClearStickyFaults();
35 
36  void UpdateTable() override;
37  void StartLiveWindowMode() override;
38  void StopLiveWindowMode() override;
39  std::string GetSmartDashboardType() const override;
40  void InitTable(std::shared_ptr<ITable> subTable) override;
41  std::shared_ptr<ITable> GetTable() const override;
42 
43  private:
44  std::shared_ptr<ITable> m_table;
45  uint8_t m_module;
46 };
47 
48 #endif /* __WPILIB_POWER_DISTRIBUTION_PANEL_H__ */
void ClearStickyFaults()
Remove all of the fault flags on the PDP.
Definition: PowerDistributionPanel.cpp:144
void StopLiveWindowMode() override
Stop having this sendable object automatically respond to value changes.
Definition: PowerDistributionPanel.cpp:179
Live Window Sendable is a special type of object sendable to the live window.
Definition: LiveWindowSendable.h:18
double GetTotalCurrent() const
Query the total current of all monitored PDP channels (0-15)
Definition: PowerDistributionPanel.cpp:83
void UpdateTable() override
Update the table for this sendable object with the latest values.
Definition: PowerDistributionPanel.cpp:154
void StartLiveWindowMode() override
Start having this sendable object automatically respond to value changes reflect the value on the tab...
Definition: PowerDistributionPanel.cpp:177
void ResetTotalEnergy()
Reset the total energy drawn from the PDP.
Definition: PowerDistributionPanel.cpp:131
Base class for all sensors.
Definition: SensorBase.h:20
void InitTable(std::shared_ptr< ITable > subTable) override
Initializes a table for this sendable object.
Definition: PowerDistributionPanel.cpp:185
double GetCurrent(uint8_t channel) const
Query the current of a single channel of the PDP.
Definition: PowerDistributionPanel.cpp:61
double GetTemperature() const
Query the temperature of the PDP.
Definition: PowerDistributionPanel.cpp:45
std::shared_ptr< ITable > GetTable() const override
Definition: PowerDistributionPanel.cpp:190
std::string GetSmartDashboardType() const override
Definition: PowerDistributionPanel.cpp:181
double GetTotalPower() const
Query the total power drawn from the monitored PDP channels.
Definition: PowerDistributionPanel.cpp:99
Class for getting voltage, current, temperature, power and energy from the CAN PDP.
Definition: PowerDistributionPanel.h:22
double GetTotalEnergy() const
Query the total energy drawn from the monitored PDP channels.
Definition: PowerDistributionPanel.cpp:115
double GetVoltage() const
Query the input voltage of the PDP.
Definition: PowerDistributionPanel.cpp:29