Class to control a simulated Power Distribution Panel (PowerDistribution).
More...
#include <frc/simulation/PowerDistributionSim.h>
Class to control a simulated Power Distribution Panel (PowerDistribution).
◆ PowerDistributionSim() [1/2]
frc::sim::PowerDistributionSim::PowerDistributionSim |
( |
int |
module = 0 | ) |
|
|
explicit |
◆ PowerDistributionSim() [2/2]
frc::sim::PowerDistributionSim::PowerDistributionSim |
( |
const PowerDistribution & |
pdp | ) |
|
|
explicit |
◆ GetAllCurrents()
void frc::sim::PowerDistributionSim::GetAllCurrents |
( |
double * |
currents, |
|
|
int |
length |
|
) |
| const |
Read the current of all of the PowerDistribution channels.
- Parameters
-
currents | output array; set to the current in each channel. The array must be big enough to hold all the PowerDistribution channels |
length | length of output array |
◆ GetCurrent()
double frc::sim::PowerDistributionSim::GetCurrent |
( |
int |
channel | ) |
const |
Read the current in one of the PowerDistribution channels.
- Parameters
-
channel | the channel to check |
- Returns
- the current in the given channel
◆ GetInitialized()
bool frc::sim::PowerDistributionSim::GetInitialized |
( |
| ) |
const |
◆ GetTemperature()
double frc::sim::PowerDistributionSim::GetTemperature |
( |
| ) |
const |
◆ GetVoltage()
double frc::sim::PowerDistributionSim::GetVoltage |
( |
| ) |
const |
◆ RegisterCurrentCallback()
std::unique_ptr< CallbackStore > frc::sim::PowerDistributionSim::RegisterCurrentCallback |
( |
int |
channel, |
|
|
NotifyCallback |
callback, |
|
|
bool |
initialNotify |
|
) |
| |
Register a callback to be run whenever the current of a specific channel changes.
- Parameters
-
channel | the channel |
callback | the callback |
initialNotify | whether to call the callback with the initial state |
- Returns
- the CallbackStore object associated with this callback
◆ RegisterInitializedCallback()
std::unique_ptr< CallbackStore > frc::sim::PowerDistributionSim::RegisterInitializedCallback |
( |
NotifyCallback |
callback, |
|
|
bool |
initialNotify |
|
) |
| |
Register a callback to be run when the PowerDistribution is initialized.
- Parameters
-
callback | the callback |
initialNotify | whether to run the callback with the initial state |
- Returns
- the CallbackStore object associated with this callback
◆ RegisterTemperatureCallback()
std::unique_ptr< CallbackStore > frc::sim::PowerDistributionSim::RegisterTemperatureCallback |
( |
NotifyCallback |
callback, |
|
|
bool |
initialNotify |
|
) |
| |
Register a callback to be run whenever the PowerDistribution temperature changes.
- Parameters
-
callback | the callback |
initialNotify | whether to call the callback with the initial state |
- Returns
- the CallbackStore object associated with this callback
◆ RegisterVoltageCallback()
std::unique_ptr< CallbackStore > frc::sim::PowerDistributionSim::RegisterVoltageCallback |
( |
NotifyCallback |
callback, |
|
|
bool |
initialNotify |
|
) |
| |
Register a callback to be run whenever the PowerDistribution voltage changes.
- Parameters
-
callback | the callback |
initialNotify | whether to call the callback with the initial state |
- Returns
- the CallbackStore object associated with this callback
◆ ResetData()
void frc::sim::PowerDistributionSim::ResetData |
( |
| ) |
|
◆ SetAllCurrents()
void frc::sim::PowerDistributionSim::SetAllCurrents |
( |
const double * |
currents, |
|
|
int |
length |
|
) |
| |
Change the current in all of the PowerDistribution channels.
- Parameters
-
currents | array containing the current values for each channel. The array must be big enough to hold all the PowerDistribution channels |
length | length of array |
◆ SetCurrent()
void frc::sim::PowerDistributionSim::SetCurrent |
( |
int |
channel, |
|
|
double |
current |
|
) |
| |
Change the current in the given channel.
- Parameters
-
channel | the channel to edit |
current | the new current for the channel |
◆ SetInitialized()
void frc::sim::PowerDistributionSim::SetInitialized |
( |
bool |
initialized | ) |
|
Define whether the PowerDistribution has been initialized.
- Parameters
-
initialized | whether this object is initialized |
◆ SetTemperature()
void frc::sim::PowerDistributionSim::SetTemperature |
( |
double |
temperature | ) |
|
◆ SetVoltage()
void frc::sim::PowerDistributionSim::SetVoltage |
( |
double |
voltage | ) |
|
The documentation for this class was generated from the following file: