2014-05-30 14:04:05 -04:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Copyright (c) FIRST 2014. All Rights Reserved. */
|
|
|
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
|
|
|
|
/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
#ifndef __WPILIB_POWER_DISTRIBUTION_PANEL_H__
|
|
|
|
|
#define __WPILIB_POWER_DISTRIBUTION_PANEL_H__
|
|
|
|
|
|
|
|
|
|
#include "SensorBase.h"
|
2014-12-30 12:02:13 -08:00
|
|
|
#include "LiveWindow/LiveWindowSendable.h"
|
2014-05-30 14:04:05 -04:00
|
|
|
|
|
|
|
|
/**
|
2015-01-02 16:08:19 -08:00
|
|
|
* Class for getting voltage, current, temperature, power and energy from the CAN PDP.
|
|
|
|
|
* The PDP must be at CAN Address 0.
|
2014-05-30 14:04:05 -04:00
|
|
|
* @author Thomas Clark
|
|
|
|
|
*/
|
2014-12-30 12:02:13 -08:00
|
|
|
class PowerDistributionPanel : public SensorBase, public LiveWindowSendable {
|
2014-05-30 14:04:05 -04:00
|
|
|
public:
|
|
|
|
|
PowerDistributionPanel();
|
2015-06-16 16:47:35 -04:00
|
|
|
PowerDistributionPanel(uint8_t module);
|
2014-05-30 14:04:05 -04:00
|
|
|
|
|
|
|
|
double GetVoltage();
|
|
|
|
|
double GetTemperature();
|
|
|
|
|
double GetCurrent(uint8_t channel);
|
2014-11-25 00:52:41 -05:00
|
|
|
double GetTotalCurrent();
|
|
|
|
|
double GetTotalPower();
|
|
|
|
|
double GetTotalEnergy();
|
|
|
|
|
void ResetTotalEnergy();
|
|
|
|
|
void ClearStickyFaults();
|
2014-12-30 12:02:13 -08:00
|
|
|
|
|
|
|
|
void UpdateTable();
|
|
|
|
|
void StartLiveWindowMode();
|
|
|
|
|
void StopLiveWindowMode();
|
|
|
|
|
std::string GetSmartDashboardType();
|
|
|
|
|
void InitTable(ITable *subTable);
|
|
|
|
|
ITable * GetTable();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
ITable *m_table;
|
2015-06-16 16:47:35 -04:00
|
|
|
uint8_t m_module;
|
2014-05-30 14:04:05 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif /* __WPILIB_POWER_DISTRIBUTION_PANEL_H__ */
|
|
|
|
|
|