Artifact artf3520 : Need a PDP Clear Sticky Faults API

Artifact artf3740 : C++ and Java don't implement all PDP features

Change-Id: I6a519d16de412a4d477b1f9c57e9b405b2e1aae0
This commit is contained in:
Omar Zrien
2014-11-25 00:52:41 -05:00
committed by Thomas Clark
parent 56430ccd7c
commit 4da9ebe1fd
7 changed files with 218 additions and 17 deletions

View File

@@ -69,3 +69,80 @@ PowerDistributionPanel::GetCurrent(uint8_t channel) {
return current;
}
/**
* @return The the total current drawn from the PDP channels in Amperes
*/
double
PowerDistributionPanel::GetTotalCurrent() {
int32_t status = 0;
double current = getPDPTotalCurrent(&status);
if(status) {
wpi_setWPIErrorWithContext(Timeout, "");
}
return current;
}
/**
* @return The the total power drawn from the PDP channels in Joules
*/
double
PowerDistributionPanel::GetTotalPower() {
int32_t status = 0;
double power = getPDPTotalPower(&status);
if(status) {
wpi_setWPIErrorWithContext(Timeout, "");
}
return power;
}
/**
* @return The the total energy drawn from the PDP channels in Watts
*/
double
PowerDistributionPanel::GetTotalEnergy() {
int32_t status = 0;
double energy = getPDPTotalEnergy(&status);
if(status) {
wpi_setWPIErrorWithContext(Timeout, "");
}
return energy;
}
/**
* Reset the total energy drawn from the PDP
* @see PowerDistributionPanel#GetTotalEnergy
*/
void
PowerDistributionPanel::ResetTotalEnergy() {
int32_t status = 0;
resetPDPTotalEnergy(&status);
if(status) {
wpi_setWPIErrorWithContext(Timeout, "");
}
}
/**
* Remove all of the fault flags on the PDP
*/
void
PowerDistributionPanel::ClearStickyFaults() {
int32_t status = 0;
clearPDPStickyFaults(&status);
if(status) {
wpi_setWPIErrorWithContext(Timeout, "");
}
}