From f74f6f1d429d73100b651dcfe1677c06b85c7c0b Mon Sep 17 00:00:00 2001 From: sciencewhiz Date: Mon, 11 Mar 2024 20:22:33 -0700 Subject: [PATCH] [docs] Add docs for features not supported on PDH (NFC) (#6436) --- .../wpi/first/hal/PowerDistributionJNI.java | 14 +++++++++++--- .../native/include/hal/PowerDistribution.h | 14 +++++++++++--- .../native/include/frc/PowerDistribution.h | 17 +++++++++++++---- .../wpi/first/wpilibj/PowerDistribution.java | 18 ++++++++++++++---- 4 files changed, 49 insertions(+), 14 deletions(-) diff --git a/hal/src/main/java/edu/wpi/first/hal/PowerDistributionJNI.java b/hal/src/main/java/edu/wpi/first/hal/PowerDistributionJNI.java index 93f9a3dccac..f2b096ccf72 100644 --- a/hal/src/main/java/edu/wpi/first/hal/PowerDistributionJNI.java +++ b/hal/src/main/java/edu/wpi/first/hal/PowerDistributionJNI.java @@ -83,6 +83,8 @@ public class PowerDistributionJNI extends JNIWrapper { /** * Gets the temperature of the PowerDistribution. * + *

Not supported on the Rev PDH and returns 0. + * * @param handle the module handle * @return the module temperature (celsius) * @see "HAL_GetPowerDistributionTemperature" @@ -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. + * + *

Not supported on the Rev PDH and returns 0. * * @param handle the module handle * @return the total power (watts) @@ -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. + * + *

Not supported on the Rev PDH and does nothing. * * @param handle the module handle * @return the total energy (joules) @@ -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. + * + *

Not supported on the Rev PDH and returns 0. * * @param handle the module handle * @see "HAL_ClearPowerDistributionStickyFaults" diff --git a/hal/src/main/native/include/hal/PowerDistribution.h b/hal/src/main/native/include/hal/PowerDistribution.h index c2dc3cd705e..835f2eaf4cf 100644 --- a/hal/src/main/native/include/hal/PowerDistribution.h +++ b/hal/src/main/native/include/hal/PowerDistribution.h @@ -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. @@ -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. @@ -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. @@ -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. */ diff --git a/wpilibc/src/main/native/include/frc/PowerDistribution.h b/wpilibc/src/main/native/include/frc/PowerDistribution.h index 4a6eb4fa185..9a219472ddd 100644 --- a/wpilibc/src/main/native/include/frc/PowerDistribution.h +++ b/wpilibc/src/main/native/include/frc/PowerDistribution.h @@ -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 */ @@ -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 */ diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/PowerDistribution.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/PowerDistribution.java index 57709b77e1c..9aa1b7c743d 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/PowerDistribution.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/PowerDistribution.java @@ -93,7 +93,9 @@ public double getVoltage() { } /** - * 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 */ @@ -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. + * + *

Not supported on the Rev PDH and returns 0. * * @return the total power in Watts */ @@ -130,7 +134,9 @@ public double getTotalPower() { } /** - * Query the total energy drawn from the monitored channels. + * Query the total energy drawn from the monitored channels of the PDP. + * + *

Not supported on the Rev PDH and returns 0. * * @return the total energy in Joules */ @@ -138,7 +144,11 @@ public double getTotalEnergy() { return PowerDistributionJNI.getTotalEnergy(m_handle); } - /** Reset the total energy to 0. */ + /** + * Reset the total energy to 0 of the PDP. + * + *

Not supported on the Rev PDH and does nothing. + */ public void resetTotalEnergy() { PowerDistributionJNI.resetTotalEnergy(m_handle); }