Skip to content

Commit

Permalink
[docs] Add docs for features not supported on PDH (NFC) (wpilibsuite#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sciencewhiz authored Mar 12, 2024
1 parent 11c60df commit f74f6f1
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 14 deletions.
14 changes: 11 additions & 3 deletions hal/src/main/java/edu/wpi/first/hal/PowerDistributionJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public class PowerDistributionJNI extends JNIWrapper {
/**
* Gets the temperature of the PowerDistribution.
*
* <p>Not supported on the Rev PDH and returns 0.
*
* @param handle the module handle
* @return the module temperature (celsius)
* @see "HAL_GetPowerDistributionTemperature"
Expand Down Expand Up @@ -129,7 +131,9 @@ public class PowerDistributionJNI extends JNIWrapper {
public static native double getTotalCurrent(int handle);

/**
* Gets the total power of the PowerDistribution.
* Gets the total power of the Power Distribution Panel.
*
* <p>Not supported on the Rev PDH and returns 0.
*
* @param handle the module handle
* @return the total power (watts)
Expand All @@ -138,7 +142,9 @@ public class PowerDistributionJNI extends JNIWrapper {
public static native double getTotalPower(int handle);

/**
* Gets the total energy of the PowerDistribution.
* Gets the total energy of the Power Distribution Panel.
*
* <p>Not supported on the Rev PDH and does nothing.
*
* @param handle the module handle
* @return the total energy (joules)
Expand All @@ -147,7 +153,9 @@ public class PowerDistributionJNI extends JNIWrapper {
public static native double getTotalEnergy(int handle);

/**
* Resets the PowerDistribution accumulated energy.
* Resets the Power Distribution Panel accumulated energy.
*
* <p>Not supported on the Rev PDH and returns 0.
*
* @param handle the module handle
* @see "HAL_ClearPowerDistributionStickyFaults"
Expand Down
14 changes: 11 additions & 3 deletions hal/src/main/native/include/hal/PowerDistribution.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ int32_t HAL_GetPowerDistributionNumChannels(HAL_PowerDistributionHandle handle,
int32_t* status);

/**
* Gets the temperature of the PowerDistribution.
* Gets the temperature of the Power Distribution Panel.
*
* Not supported on the Rev PDH and returns 0.
*
* @param[in] handle the module handle
* @param[out] status Error status variable. 0 on success.
Expand Down Expand Up @@ -156,7 +158,9 @@ double HAL_GetPowerDistributionTotalCurrent(HAL_PowerDistributionHandle handle,
int32_t* status);

/**
* Gets the total power of the PowerDistribution.
* Gets the total power of the Power Distribution Panel.
*
* Not supported on the Rev PDH and returns 0.
*
* @param[in] handle the module handle
* @param[out] status Error status variable. 0 on success.
Expand All @@ -166,7 +170,9 @@ double HAL_GetPowerDistributionTotalPower(HAL_PowerDistributionHandle handle,
int32_t* status);

/**
* Gets the total energy of the PowerDistribution.
* Gets the total energy of the Power Distribution Panel.
*
* Not supported on the Rev PDH and returns 0.
*
* @param[in] handle the module handle
* @param[out] status Error status variable. 0 on success.
Expand All @@ -178,6 +184,8 @@ double HAL_GetPowerDistributionTotalEnergy(HAL_PowerDistributionHandle handle,
/**
* Resets the PowerDistribution accumulated energy.
*
* Not supported on the Rev PDH and does nothing.
*
* @param[in] handle the module handle
* @param[out] status Error status variable. 0 on success.
*/
Expand Down
17 changes: 13 additions & 4 deletions wpilibc/src/main/native/include/frc/PowerDistribution.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ class PowerDistribution : public wpi::Sendable,
double GetVoltage() const;

/**
* Query the temperature of the PDP/PDH.
* Query the temperature of the PDP.
*
* Not supported on the Rev PDH and returns 0.
*
*
* @return The temperature in degrees Celsius
*/
Expand All @@ -80,21 +83,27 @@ class PowerDistribution : public wpi::Sendable,
double GetTotalCurrent() const;

/**
* Query the total power drawn from all monitored PDP/PDH channels.
* Query the total power drawn from all monitored PDP channels.
*
* Not supported on the Rev PDH and returns 0.
*
* @return The total power drawn in Watts
*/
double GetTotalPower() const;

/**
* Query the total energy drawn from the monitored PDP/PDH channels.
* Query the total energy drawn from the monitored PDP channels.
*
* Not supported on the Rev PDH and returns 0.
*
* @return The total energy drawn in Joules
*/
double GetTotalEnergy() const;

/**
* Reset the total energy drawn from the PDP/PDH.
* Reset the total energy drawn from the PDP.
*
* Not supported on the Rev PDH and does nothing.
*
* @see PowerDistribution#GetTotalEnergy
*/
Expand Down
18 changes: 14 additions & 4 deletions wpilibj/src/main/java/edu/wpi/first/wpilibj/PowerDistribution.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ public double getVoltage() {
}

/**
* Query the temperature of the PDP/PDH.
* Query the temperature of the PDP.
*
* <p>Not supported on the Rev PDH and returns 0.
*
* @return The temperature in degrees Celsius
*/
Expand Down Expand Up @@ -121,7 +123,9 @@ public double getTotalCurrent() {
}

/**
* Query the total power drawn from the monitored channels.
* Query the total power drawn from the monitored channels of the PDP.
*
* <p>Not supported on the Rev PDH and returns 0.
*
* @return the total power in Watts
*/
Expand All @@ -130,15 +134,21 @@ public double getTotalPower() {
}

/**
* Query the total energy drawn from the monitored channels.
* Query the total energy drawn from the monitored channels of the PDP.
*
* <p>Not supported on the Rev PDH and returns 0.
*
* @return the total energy in Joules
*/
public double getTotalEnergy() {
return PowerDistributionJNI.getTotalEnergy(m_handle);
}

/** Reset the total energy to 0. */
/**
* Reset the total energy to 0 of the PDP.
*
* <p>Not supported on the Rev PDH and does nothing.
*/
public void resetTotalEnergy() {
PowerDistributionJNI.resetTotalEnergy(m_handle);
}
Expand Down

0 comments on commit f74f6f1

Please sign in to comment.