mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
[hal] Rename PowerDistributionPanel to PowerDistribution (#3466)
Makes HAL more generic for the PDP, to enable the Rev PDH in the future.
This commit is contained in:
@@ -10,31 +10,31 @@
|
||||
|
||||
namespace frc {
|
||||
|
||||
class PowerDistributionPanel;
|
||||
class PowerDistribution;
|
||||
|
||||
namespace sim {
|
||||
|
||||
/**
|
||||
* Class to control a simulated Power Distribution Panel (PDP).
|
||||
* Class to control a simulated Power Distribution Panel (PowerDistribution).
|
||||
*/
|
||||
class PDPSim {
|
||||
class PowerDistributionSim {
|
||||
public:
|
||||
/**
|
||||
* Constructs from a PDP module number (CAN ID).
|
||||
* Constructs from a PowerDistribution module number (CAN ID).
|
||||
*
|
||||
* @param module module number
|
||||
*/
|
||||
explicit PDPSim(int module = 0);
|
||||
explicit PowerDistributionSim(int module = 0);
|
||||
|
||||
/**
|
||||
* Constructs from a PowerDistributionPanel object.
|
||||
* Constructs from a PowerDistribution object.
|
||||
*
|
||||
* @param pdp PowerDistributionPanel to simulate
|
||||
* @param pdp PowerDistribution to simulate
|
||||
*/
|
||||
explicit PDPSim(const PowerDistributionPanel& pdp);
|
||||
explicit PowerDistributionSim(const PowerDistribution& pdp);
|
||||
|
||||
/**
|
||||
* Register a callback to be run when the PDP is initialized.
|
||||
* Register a callback to be run when the PowerDistribution is initialized.
|
||||
*
|
||||
* @param callback the callback
|
||||
* @param initialNotify whether to run the callback with the initial state
|
||||
@@ -44,21 +44,22 @@ class PDPSim {
|
||||
NotifyCallback callback, bool initialNotify);
|
||||
|
||||
/**
|
||||
* Check whether the PDP has been initialized.
|
||||
* Check whether the PowerDistribution has been initialized.
|
||||
*
|
||||
* @return true if initialized
|
||||
*/
|
||||
bool GetInitialized() const;
|
||||
|
||||
/**
|
||||
* Define whether the PDP has been initialized.
|
||||
* Define whether the PowerDistribution has been initialized.
|
||||
*
|
||||
* @param initialized whether this object is initialized
|
||||
*/
|
||||
void SetInitialized(bool initialized);
|
||||
|
||||
/**
|
||||
* Register a callback to be run whenever the PDP temperature changes.
|
||||
* Register a callback to be run whenever the PowerDistribution temperature
|
||||
* changes.
|
||||
*
|
||||
* @param callback the callback
|
||||
* @param initialNotify whether to call the callback with the initial state
|
||||
@@ -68,21 +69,22 @@ class PDPSim {
|
||||
NotifyCallback callback, bool initialNotify);
|
||||
|
||||
/**
|
||||
* Check the temperature of the PDP.
|
||||
* Check the temperature of the PowerDistribution.
|
||||
*
|
||||
* @return the PDP temperature
|
||||
* @return the PowerDistribution temperature
|
||||
*/
|
||||
double GetTemperature() const;
|
||||
|
||||
/**
|
||||
* Define the PDP temperature.
|
||||
* Define the PowerDistribution temperature.
|
||||
*
|
||||
* @param temperature the new PDP temperature
|
||||
* @param temperature the new PowerDistribution temperature
|
||||
*/
|
||||
void SetTemperature(double temperature);
|
||||
|
||||
/**
|
||||
* Register a callback to be run whenever the PDP voltage changes.
|
||||
* Register a callback to be run whenever the PowerDistribution voltage
|
||||
* changes.
|
||||
*
|
||||
* @param callback the callback
|
||||
* @param initialNotify whether to call the callback with the initial state
|
||||
@@ -92,16 +94,16 @@ class PDPSim {
|
||||
NotifyCallback callback, bool initialNotify);
|
||||
|
||||
/**
|
||||
* Check the PDP voltage.
|
||||
* Check the PowerDistribution voltage.
|
||||
*
|
||||
* @return the PDP voltage.
|
||||
* @return the PowerDistribution voltage.
|
||||
*/
|
||||
double GetVoltage() const;
|
||||
|
||||
/**
|
||||
* Set the PDP voltage.
|
||||
* Set the PowerDistribution voltage.
|
||||
*
|
||||
* @param voltage the new PDP voltage
|
||||
* @param voltage the new PowerDistribution voltage
|
||||
*/
|
||||
void SetVoltage(double voltage);
|
||||
|
||||
@@ -118,7 +120,7 @@ class PDPSim {
|
||||
int channel, NotifyCallback callback, bool initialNotify);
|
||||
|
||||
/**
|
||||
* Read the current in one of the PDP channels.
|
||||
* Read the current in one of the PowerDistribution channels.
|
||||
*
|
||||
* @param channel the channel to check
|
||||
* @return the current in the given channel
|
||||
@@ -134,23 +136,25 @@ class PDPSim {
|
||||
void SetCurrent(int channel, double current);
|
||||
|
||||
/**
|
||||
* Read the current of all of the PDP channels.
|
||||
* Read the current of all of the PowerDistribution channels.
|
||||
*
|
||||
* @param currents output array; set to the current in each channel. The
|
||||
* array must be big enough to hold all the PDP channels
|
||||
* array must be big enough to hold all the PowerDistribution
|
||||
* channels
|
||||
*/
|
||||
void GetAllCurrents(double* currents) const;
|
||||
|
||||
/**
|
||||
* Change the current in all of the PDP channels.
|
||||
* Change the current in all of the PowerDistribution channels.
|
||||
*
|
||||
* @param currents array containing the current values for each channel. The
|
||||
* array must be big enough to hold all the PDP channels
|
||||
* array must be big enough to hold all the PowerDistribution
|
||||
* channels
|
||||
*/
|
||||
void SetAllCurrents(const double* currents);
|
||||
|
||||
/**
|
||||
* Reset all PDP simulation data.
|
||||
* Reset all PowerDistribution simulation data.
|
||||
*/
|
||||
void ResetData();
|
||||
|
||||
Reference in New Issue
Block a user