WPILibC++ 2025.2.1
|
Class to control a simulated Pneumatic Control Module (PCM). More...
#include <frc/simulation/REVPHSim.h>
Public Member Functions | |
REVPHSim () | |
Constructs with the default PCM module number (CAN ID). | |
REVPHSim (int module) | |
Constructs from a PCM module number (CAN ID). | |
REVPHSim (const PneumaticsBase &pneumatics) | |
~REVPHSim () override=default | |
std::unique_ptr< CallbackStore > | RegisterInitializedCallback (NotifyCallback callback, bool initialNotify) override |
Register a callback to be run when the PCM/PH is initialized. | |
bool | GetInitialized () const override |
Check whether the PCM/PH has been initialized. | |
void | SetInitialized (bool solenoidInitialized) override |
Define whether the PCM/PH has been initialized. | |
std::unique_ptr< CallbackStore > | RegisterSolenoidOutputCallback (int channel, NotifyCallback callback, bool initialNotify) override |
Register a callback to be run when the solenoid output on a channel changes. | |
bool | GetSolenoidOutput (int channel) const override |
Check the solenoid output on a specific channel. | |
void | SetSolenoidOutput (int channel, bool solenoidOutput) override |
Change the solenoid output on a specific channel. | |
std::unique_ptr< CallbackStore > | RegisterCompressorOnCallback (NotifyCallback callback, bool initialNotify) override |
Register a callback to be run when the compressor activates. | |
bool | GetCompressorOn () const override |
Check if the compressor is on. | |
void | SetCompressorOn (bool compressorOn) override |
Set whether the compressor is active. | |
std::unique_ptr< CallbackStore > | RegisterCompressorConfigTypeCallback (NotifyCallback callback, bool initialNotify) |
Register a callback to be run whenever the closed loop state changes. | |
int | GetCompressorConfigType () const |
Check whether the closed loop compressor control is active. | |
void | SetCompressorConfigType (int compressorConfigType) |
Turn on/off the closed loop control of the compressor. | |
std::unique_ptr< CallbackStore > | RegisterPressureSwitchCallback (NotifyCallback callback, bool initialNotify) override |
Register a callback to be run whenever the pressure switch value changes. | |
bool | GetPressureSwitch () const override |
Check the value of the pressure switch. | |
void | SetPressureSwitch (bool pressureSwitch) override |
Set the value of the pressure switch. | |
std::unique_ptr< CallbackStore > | RegisterCompressorCurrentCallback (NotifyCallback callback, bool initialNotify) override |
Register a callback to be run whenever the compressor current changes. | |
double | GetCompressorCurrent () const override |
Read the compressor current. | |
void | SetCompressorCurrent (double compressorCurrent) override |
Set the compressor current. | |
uint8_t | GetAllSolenoidOutputs () const override |
Get the current value of all solenoid outputs. | |
void | SetAllSolenoidOutputs (uint8_t outputs) override |
Change all of the solenoid outputs. | |
void | ResetData () override |
Reset all simulation data for this object. | |
Public Member Functions inherited from frc::sim::PneumaticsBaseSim | |
virtual | ~PneumaticsBaseSim ()=default |
Additional Inherited Members | |
Static Public Member Functions inherited from frc::sim::PneumaticsBaseSim | |
static std::shared_ptr< PneumaticsBaseSim > | GetForType (int module, PneumaticsModuleType type) |
Protected Member Functions inherited from frc::sim::PneumaticsBaseSim | |
PneumaticsBaseSim (const int index) | |
Constructs a PneumaticsBaseSim with the given index. | |
PneumaticsBaseSim (const PneumaticsBase &module) | |
Constructs a PneumaticsBaseSim for the given module. | |
Protected Attributes inherited from frc::sim::PneumaticsBaseSim | |
const int | m_index |
PneumaticsBase index. | |
Class to control a simulated Pneumatic Control Module (PCM).
frc::sim::REVPHSim::REVPHSim | ( | ) |
Constructs with the default PCM module number (CAN ID).
|
explicit |
Constructs from a PCM module number (CAN ID).
module | module number |
|
explicit |
|
overridedefault |
|
overridevirtual |
Get the current value of all solenoid outputs.
Implements frc::sim::PneumaticsBaseSim.
int frc::sim::REVPHSim::GetCompressorConfigType | ( | ) | const |
Check whether the closed loop compressor control is active.
|
overridevirtual |
Read the compressor current.
Implements frc::sim::PneumaticsBaseSim.
|
overridevirtual |
Check if the compressor is on.
Implements frc::sim::PneumaticsBaseSim.
|
overridevirtual |
Check whether the PCM/PH has been initialized.
Implements frc::sim::PneumaticsBaseSim.
|
overridevirtual |
Check the value of the pressure switch.
Implements frc::sim::PneumaticsBaseSim.
|
overridevirtual |
Check the solenoid output on a specific channel.
channel | the channel to check |
Implements frc::sim::PneumaticsBaseSim.
|
nodiscard |
Register a callback to be run whenever the closed loop state changes.
callback | the callback |
initialNotify | whether the callback should be called with the initial value |
|
nodiscardoverridevirtual |
Register a callback to be run whenever the compressor current changes.
callback | the callback |
initialNotify | whether to call the callback with the initial state |
CallbackStore
object associated with this callback. Save a reference to this object; it being deconstructed cancels the callback. Implements frc::sim::PneumaticsBaseSim.
|
nodiscardoverridevirtual |
Register a callback to be run when the compressor activates.
callback | the callback |
initialNotify | whether to run the callback with the initial state |
CallbackStore
object associated with this callback. Save a reference to this object; it being deconstructed cancels the callback. Implements frc::sim::PneumaticsBaseSim.
|
nodiscardoverridevirtual |
Register a callback to be run when the PCM/PH is initialized.
callback | the callback |
initialNotify | whether to run the callback with the initial state |
CallbackStore
object associated with this callback. Save a reference to this object; it being deconstructed cancels the callback. Implements frc::sim::PneumaticsBaseSim.
|
nodiscardoverridevirtual |
Register a callback to be run whenever the pressure switch value changes.
callback | the callback |
initialNotify | whether the callback should be called with the initial value |
CallbackStore
object associated with this callback. Save a reference to this object; it being deconstructed cancels the callback. Implements frc::sim::PneumaticsBaseSim.
|
nodiscardoverridevirtual |
Register a callback to be run when the solenoid output on a channel changes.
channel | the channel to monitor |
callback | the callback |
initialNotify | should the callback be run with the initial value |
CallbackStore
object associated with this callback. Save a reference to this object; it being deconstructed cancels the callback. Implements frc::sim::PneumaticsBaseSim.
|
overridevirtual |
Reset all simulation data for this object.
Implements frc::sim::PneumaticsBaseSim.
|
overridevirtual |
Change all of the solenoid outputs.
outputs | the new solenoid outputs (1 bit per output) |
Implements frc::sim::PneumaticsBaseSim.
void frc::sim::REVPHSim::SetCompressorConfigType | ( | int | compressorConfigType | ) |
Turn on/off the closed loop control of the compressor.
compressorConfigType | compressor config type |
|
overridevirtual |
Set the compressor current.
compressorCurrent | the new compressor current |
Implements frc::sim::PneumaticsBaseSim.
|
overridevirtual |
Set whether the compressor is active.
compressorOn | the new value |
Implements frc::sim::PneumaticsBaseSim.
|
overridevirtual |
Define whether the PCM/PH has been initialized.
initialized | true for initialized |
Implements frc::sim::PneumaticsBaseSim.
|
overridevirtual |
Set the value of the pressure switch.
pressureSwitch | the new value |
Implements frc::sim::PneumaticsBaseSim.
|
overridevirtual |
Change the solenoid output on a specific channel.
channel | the channel to check |
solenoidOutput | the new solenoid output |
Implements frc::sim::PneumaticsBaseSim.