WPILibC++ 2024.3.2
|
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). More... | |
REVPHSim (int module) | |
Constructs from a PCM module number (CAN ID). More... | |
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. More... | |
bool | GetInitialized () const override |
Check whether the PCM/PH has been initialized. More... | |
void | SetInitialized (bool solenoidInitialized) override |
Define whether the PCM/PH has been initialized. More... | |
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. More... | |
bool | GetSolenoidOutput (int channel) const override |
Check the solenoid output on a specific channel. More... | |
void | SetSolenoidOutput (int channel, bool solenoidOutput) override |
Change the solenoid output on a specific channel. More... | |
std::unique_ptr< CallbackStore > | RegisterCompressorOnCallback (NotifyCallback callback, bool initialNotify) override |
Register a callback to be run when the compressor activates. More... | |
bool | GetCompressorOn () const override |
Check if the compressor is on. More... | |
void | SetCompressorOn (bool compressorOn) override |
Set whether the compressor is active. More... | |
std::unique_ptr< CallbackStore > | RegisterCompressorConfigTypeCallback (NotifyCallback callback, bool initialNotify) |
Register a callback to be run whenever the closed loop state changes. More... | |
int | GetCompressorConfigType () const |
Check whether the closed loop compressor control is active. More... | |
void | SetCompressorConfigType (int compressorConfigType) |
Turn on/off the closed loop control of the compressor. More... | |
std::unique_ptr< CallbackStore > | RegisterPressureSwitchCallback (NotifyCallback callback, bool initialNotify) override |
Register a callback to be run whenever the pressure switch value changes. More... | |
bool | GetPressureSwitch () const override |
Check the value of the pressure switch. More... | |
void | SetPressureSwitch (bool pressureSwitch) override |
Set the value of the pressure switch. More... | |
std::unique_ptr< CallbackStore > | RegisterCompressorCurrentCallback (NotifyCallback callback, bool initialNotify) override |
Register a callback to be run whenever the compressor current changes. More... | |
double | GetCompressorCurrent () const override |
Read the compressor current. More... | |
void | SetCompressorCurrent (double compressorCurrent) override |
Set the compressor current. More... | |
uint8_t | GetAllSolenoidOutputs () const override |
Get the current value of all solenoid outputs. More... | |
void | SetAllSolenoidOutputs (uint8_t outputs) override |
Change all of the solenoid outputs. More... | |
void | ResetData () override |
Reset all simulation data for this object. More... | |
Public Member Functions inherited from frc::sim::PneumaticsBaseSim | |
virtual | ~PneumaticsBaseSim ()=default |
virtual bool | GetInitialized () const =0 |
Check whether the PCM/PH has been initialized. More... | |
virtual void | SetInitialized (bool initialized)=0 |
Define whether the PCM/PH has been initialized. More... | |
virtual std::unique_ptr< CallbackStore > | RegisterInitializedCallback (NotifyCallback callback, bool initialNotify)=0 |
Register a callback to be run when the PCM/PH is initialized. More... | |
virtual bool | GetCompressorOn () const =0 |
Check if the compressor is on. More... | |
virtual void | SetCompressorOn (bool compressorOn)=0 |
Set whether the compressor is active. More... | |
virtual std::unique_ptr< CallbackStore > | RegisterCompressorOnCallback (NotifyCallback callback, bool initialNotify)=0 |
Register a callback to be run when the compressor activates. More... | |
virtual bool | GetSolenoidOutput (int channel) const =0 |
Check the solenoid output on a specific channel. More... | |
virtual void | SetSolenoidOutput (int channel, bool solenoidOutput)=0 |
Change the solenoid output on a specific channel. More... | |
virtual std::unique_ptr< CallbackStore > | RegisterSolenoidOutputCallback (int channel, NotifyCallback callback, bool initialNotify)=0 |
Register a callback to be run when the solenoid output on a channel changes. More... | |
virtual bool | GetPressureSwitch () const =0 |
Check the value of the pressure switch. More... | |
virtual void | SetPressureSwitch (bool pressureSwitch)=0 |
Set the value of the pressure switch. More... | |
virtual std::unique_ptr< CallbackStore > | RegisterPressureSwitchCallback (NotifyCallback callback, bool initialNotify)=0 |
Register a callback to be run whenever the pressure switch value changes. More... | |
virtual double | GetCompressorCurrent () const =0 |
Read the compressor current. More... | |
virtual void | SetCompressorCurrent (double compressorCurrent)=0 |
Set the compressor current. More... | |
virtual std::unique_ptr< CallbackStore > | RegisterCompressorCurrentCallback (NotifyCallback callback, bool initialNotify)=0 |
Register a callback to be run whenever the compressor current changes. More... | |
virtual uint8_t | GetAllSolenoidOutputs () const =0 |
Get the current value of all solenoid outputs. More... | |
virtual void | SetAllSolenoidOutputs (uint8_t outputs)=0 |
Change all of the solenoid outputs. More... | |
virtual void | ResetData ()=0 |
Reset all simulation data for this object. More... | |
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. More... | |
PneumaticsBaseSim (const PneumaticsBase &module) | |
Constructs a PneumaticsBaseSim for the given module. More... | |
Protected Attributes inherited from frc::sim::PneumaticsBaseSim | |
const int | m_index |
PneumaticsBase index. More... | |
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.
std::unique_ptr< CallbackStore > frc::sim::REVPHSim::RegisterCompressorConfigTypeCallback | ( | NotifyCallback | callback, |
bool | initialNotify | ||
) |
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 |
|
overridevirtual |
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.
|
overridevirtual |
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.
|
overridevirtual |
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.
|
overridevirtual |
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.
|
overridevirtual |
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.