[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

@@ -4,6 +4,8 @@
#pragma once
#include <vector>
#include <hal/Types.h>
#include <wpi/sendable/Sendable.h>
#include <wpi/sendable/SendableHelper.h>
@@ -50,6 +52,13 @@ class PowerDistribution : public wpi::Sendable,
PowerDistribution(PowerDistribution&&) = default;
PowerDistribution& operator=(PowerDistribution&&) = default;
/**
* Gets the number of channels for this power distribution object.
*
* @return Number of output channels (16 for PDP, 24 for PDH).
*/
int GetNumChannels() const;
/**
* Query the input voltage of the PDP/PDH.
*
@@ -75,6 +84,13 @@ class PowerDistribution : public wpi::Sendable,
*/
double GetCurrent(int channel) const;
/**
* Query all currents of the PDP.
*
* @return The current of each channel in Amperes
*/
std::vector<double> GetAllCurrents() const;
/**
* Query the total current of all monitored PDP/PDH channels.
*