[wpilib] Fix PowerDistribution.GetAllCurrents() (#6025)

This commit is contained in:
scarmain
2024-05-24 19:31:19 -04:00
committed by GitHub
parent f42bc45ee8
commit c62396ce4e
6 changed files with 104 additions and 7 deletions

View File

@@ -113,6 +113,17 @@ public class PowerDistribution implements Sendable, AutoCloseable {
return PowerDistributionJNI.getChannelCurrent(m_handle, channel);
}
/**
* Query all currents of the PDP.
*
* @return The current of each channel in Amperes
*/
public double[] getAllCurrents() {
double[] currents = new double[getNumChannels()];
PowerDistributionJNI.getAllCurrents(m_handle, currents);
return currents;
}
/**
* Query the current of all monitored channels.
*