2014-05-30 14:04:05 -04:00
|
|
|
/*----------------------------------------------------------------------------*/
|
2016-01-02 03:02:34 -08:00
|
|
|
/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */
|
2014-05-30 14:04:05 -04:00
|
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
2016-01-02 03:02:34 -08:00
|
|
|
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
|
|
|
|
/* the project. */
|
2014-05-30 14:04:05 -04:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2016-05-25 22:38:11 -07:00
|
|
|
#include <memory>
|
2016-09-05 13:55:31 -07:00
|
|
|
#include <string>
|
2016-05-25 22:38:11 -07:00
|
|
|
|
2014-12-30 12:02:13 -08:00
|
|
|
#include "LiveWindow/LiveWindowSendable.h"
|
2016-05-20 17:30:37 -07:00
|
|
|
#include "SensorBase.h"
|
2014-05-30 14:04:05 -04:00
|
|
|
|
|
|
|
|
/**
|
2015-06-25 15:07:55 -04:00
|
|
|
* Class for getting voltage, current, temperature, power and energy from the
|
|
|
|
|
* CAN PDP.
|
2014-05-30 14:04:05 -04:00
|
|
|
*/
|
2014-12-30 12:02:13 -08:00
|
|
|
class PowerDistributionPanel : public SensorBase, public LiveWindowSendable {
|
2015-06-25 15:07:55 -04:00
|
|
|
public:
|
|
|
|
|
PowerDistributionPanel();
|
2016-09-06 00:01:45 -07:00
|
|
|
explicit PowerDistributionPanel(int module);
|
2015-06-25 15:07:55 -04:00
|
|
|
|
2016-07-12 10:45:14 -07:00
|
|
|
float GetVoltage() const;
|
|
|
|
|
float GetTemperature() const;
|
2016-09-06 00:01:45 -07:00
|
|
|
float GetCurrent(int channel) const;
|
2016-07-12 10:45:14 -07:00
|
|
|
float GetTotalCurrent() const;
|
|
|
|
|
float GetTotalPower() const;
|
|
|
|
|
float GetTotalEnergy() const;
|
2015-06-25 15:07:55 -04:00
|
|
|
void ResetTotalEnergy();
|
|
|
|
|
void ClearStickyFaults();
|
2014-12-30 12:02:13 -08:00
|
|
|
|
2015-06-25 15:07:55 -04:00
|
|
|
void UpdateTable() override;
|
|
|
|
|
void StartLiveWindowMode() override;
|
|
|
|
|
void StopLiveWindowMode() override;
|
|
|
|
|
std::string GetSmartDashboardType() const override;
|
2015-07-29 16:48:04 -04:00
|
|
|
void InitTable(std::shared_ptr<ITable> subTable) override;
|
|
|
|
|
std::shared_ptr<ITable> GetTable() const override;
|
2014-12-30 12:02:13 -08:00
|
|
|
|
2015-06-25 15:07:55 -04:00
|
|
|
private:
|
2015-11-23 00:46:05 -08:00
|
|
|
std::shared_ptr<ITable> m_table;
|
2016-09-06 00:01:45 -07:00
|
|
|
int m_module;
|
2014-05-30 14:04:05 -04:00
|
|
|
};
|