WPILibC++ 2023.4.3-108-ge5452e3
frc::sim::PneumaticsBaseSim Class Referenceabstract

#include <frc/simulation/PneumaticsBaseSim.h>

Inheritance diagram for frc::sim::PneumaticsBaseSim:
frc::sim::CTREPCMSim frc::sim::REVPHSim

Public Member Functions

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< CallbackStoreRegisterInitializedCallback (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< CallbackStoreRegisterCompressorOnCallback (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< CallbackStoreRegisterSolenoidOutputCallback (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< CallbackStoreRegisterPressureSwitchCallback (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< CallbackStoreRegisterCompressorCurrentCallback (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...
 

Static Public Member Functions

static std::shared_ptr< PneumaticsBaseSimGetForType (int module, PneumaticsModuleType type)
 

Protected Member Functions

 PneumaticsBaseSim (const PneumaticsBase &module)
 
 PneumaticsBaseSim (const int index)
 

Protected Attributes

const int m_index
 

Constructor & Destructor Documentation

◆ ~PneumaticsBaseSim()

virtual frc::sim::PneumaticsBaseSim::~PneumaticsBaseSim ( )
virtualdefault

◆ PneumaticsBaseSim() [1/2]

frc::sim::PneumaticsBaseSim::PneumaticsBaseSim ( const PneumaticsBase module)
explicitprotected

◆ PneumaticsBaseSim() [2/2]

frc::sim::PneumaticsBaseSim::PneumaticsBaseSim ( const int  index)
explicitprotected

Member Function Documentation

◆ GetAllSolenoidOutputs()

virtual uint8_t frc::sim::PneumaticsBaseSim::GetAllSolenoidOutputs ( ) const
pure virtual

Get the current value of all solenoid outputs.

Returns
the solenoid outputs (1 bit per output)

Implemented in frc::sim::CTREPCMSim, and frc::sim::REVPHSim.

◆ GetCompressorCurrent()

virtual double frc::sim::PneumaticsBaseSim::GetCompressorCurrent ( ) const
pure virtual

Read the compressor current.

Returns
the current of the compressor connected to this module

Implemented in frc::sim::CTREPCMSim, and frc::sim::REVPHSim.

◆ GetCompressorOn()

virtual bool frc::sim::PneumaticsBaseSim::GetCompressorOn ( ) const
pure virtual

Check if the compressor is on.

Returns
true if the compressor is active

Implemented in frc::sim::CTREPCMSim, and frc::sim::REVPHSim.

◆ GetForType()

static std::shared_ptr< PneumaticsBaseSim > frc::sim::PneumaticsBaseSim::GetForType ( int  module,
PneumaticsModuleType  type 
)
static

◆ GetInitialized()

virtual bool frc::sim::PneumaticsBaseSim::GetInitialized ( ) const
pure virtual

Check whether the PCM/PH has been initialized.

Returns
true if initialized

Implemented in frc::sim::CTREPCMSim, and frc::sim::REVPHSim.

◆ GetPressureSwitch()

virtual bool frc::sim::PneumaticsBaseSim::GetPressureSwitch ( ) const
pure virtual

Check the value of the pressure switch.

Returns
the pressure switch value

Implemented in frc::sim::CTREPCMSim, and frc::sim::REVPHSim.

◆ GetSolenoidOutput()

virtual bool frc::sim::PneumaticsBaseSim::GetSolenoidOutput ( int  channel) const
pure virtual

Check the solenoid output on a specific channel.

Parameters
channelthe channel to check
Returns
the solenoid output

Implemented in frc::sim::CTREPCMSim, and frc::sim::REVPHSim.

◆ RegisterCompressorCurrentCallback()

virtual std::unique_ptr< CallbackStore > frc::sim::PneumaticsBaseSim::RegisterCompressorCurrentCallback ( NotifyCallback  callback,
bool  initialNotify 
)
pure virtual

Register a callback to be run whenever the compressor current changes.

Parameters
callbackthe callback
initialNotifywhether to call the callback with the initial state
Returns
the CallbackStore object associated with this callback. Save a reference to this object; it being deconstructed cancels the callback.

Implemented in frc::sim::CTREPCMSim, and frc::sim::REVPHSim.

◆ RegisterCompressorOnCallback()

virtual std::unique_ptr< CallbackStore > frc::sim::PneumaticsBaseSim::RegisterCompressorOnCallback ( NotifyCallback  callback,
bool  initialNotify 
)
pure virtual

Register a callback to be run when the compressor activates.

Parameters
callbackthe callback
initialNotifywhether to run the callback with the initial state
Returns
the CallbackStore object associated with this callback. Save a reference to this object; it being deconstructed cancels the callback.

Implemented in frc::sim::CTREPCMSim, and frc::sim::REVPHSim.

◆ RegisterInitializedCallback()

virtual std::unique_ptr< CallbackStore > frc::sim::PneumaticsBaseSim::RegisterInitializedCallback ( NotifyCallback  callback,
bool  initialNotify 
)
pure virtual

Register a callback to be run when the PCM/PH is initialized.

Parameters
callbackthe callback
initialNotifywhether to run the callback with the initial state
Returns
the CallbackStore object associated with this callback. Save a reference to this object; it being deconstructed cancels the callback.

Implemented in frc::sim::CTREPCMSim, and frc::sim::REVPHSim.

◆ RegisterPressureSwitchCallback()

virtual std::unique_ptr< CallbackStore > frc::sim::PneumaticsBaseSim::RegisterPressureSwitchCallback ( NotifyCallback  callback,
bool  initialNotify 
)
pure virtual

Register a callback to be run whenever the pressure switch value changes.

Parameters
callbackthe callback
initialNotifywhether the callback should be called with the initial value
Returns
the CallbackStore object associated with this callback. Save a reference to this object; it being deconstructed cancels the callback.

Implemented in frc::sim::CTREPCMSim, and frc::sim::REVPHSim.

◆ RegisterSolenoidOutputCallback()

virtual std::unique_ptr< CallbackStore > frc::sim::PneumaticsBaseSim::RegisterSolenoidOutputCallback ( int  channel,
NotifyCallback  callback,
bool  initialNotify 
)
pure virtual

Register a callback to be run when the solenoid output on a channel changes.

Parameters
channelthe channel to monitor
callbackthe callback
initialNotifyshould the callback be run with the initial value
Returns
the CallbackStore object associated with this callback. Save a reference to this object; it being deconstructed cancels the callback.

Implemented in frc::sim::CTREPCMSim, and frc::sim::REVPHSim.

◆ ResetData()

virtual void frc::sim::PneumaticsBaseSim::ResetData ( )
pure virtual

Reset all simulation data for this object.

Implemented in frc::sim::CTREPCMSim, and frc::sim::REVPHSim.

◆ SetAllSolenoidOutputs()

virtual void frc::sim::PneumaticsBaseSim::SetAllSolenoidOutputs ( uint8_t  outputs)
pure virtual

Change all of the solenoid outputs.

Parameters
outputsthe new solenoid outputs (1 bit per output)

Implemented in frc::sim::CTREPCMSim, and frc::sim::REVPHSim.

◆ SetCompressorCurrent()

virtual void frc::sim::PneumaticsBaseSim::SetCompressorCurrent ( double  compressorCurrent)
pure virtual

Set the compressor current.

Parameters
compressorCurrentthe new compressor current

Implemented in frc::sim::CTREPCMSim, and frc::sim::REVPHSim.

◆ SetCompressorOn()

virtual void frc::sim::PneumaticsBaseSim::SetCompressorOn ( bool  compressorOn)
pure virtual

Set whether the compressor is active.

Parameters
compressorOnthe new value

Implemented in frc::sim::CTREPCMSim, and frc::sim::REVPHSim.

◆ SetInitialized()

virtual void frc::sim::PneumaticsBaseSim::SetInitialized ( bool  initialized)
pure virtual

Define whether the PCM/PH has been initialized.

Parameters
initializedtrue for initialized

Implemented in frc::sim::CTREPCMSim, and frc::sim::REVPHSim.

◆ SetPressureSwitch()

virtual void frc::sim::PneumaticsBaseSim::SetPressureSwitch ( bool  pressureSwitch)
pure virtual

Set the value of the pressure switch.

Parameters
pressureSwitchthe new value

Implemented in frc::sim::CTREPCMSim, and frc::sim::REVPHSim.

◆ SetSolenoidOutput()

virtual void frc::sim::PneumaticsBaseSim::SetSolenoidOutput ( int  channel,
bool  solenoidOutput 
)
pure virtual

Change the solenoid output on a specific channel.

Parameters
channelthe channel to check
solenoidOutputthe new solenoid output

Implemented in frc::sim::CTREPCMSim, and frc::sim::REVPHSim.

Member Data Documentation

◆ m_index

const int frc::sim::PneumaticsBaseSim::m_index
protected

The documentation for this class was generated from the following file: