WPILibC++ 2024.3.2
frc::PneumaticsControlModule Class Reference

Module class for controlling a Cross The Road Electronics Pneumatics Control Module. More...

#include <frc/PneumaticsControlModule.h>

Inheritance diagram for frc::PneumaticsControlModule:
frc::PneumaticsBase

Public Member Functions

 PneumaticsControlModule ()
 Constructs a PneumaticsControlModule with the default ID (0). More...
 
 PneumaticsControlModule (int module)
 Constructs a PneumaticsControlModule. More...
 
 ~PneumaticsControlModule () override=default
 
bool GetCompressor () const override
 Returns whether the compressor is active or not. More...
 
void DisableCompressor () override
 Disables the compressor. More...
 
void EnableCompressorDigital () override
 Enables the compressor in digital mode using the digital pressure switch. More...
 
void EnableCompressorAnalog (units::pounds_per_square_inch_t minPressure, units::pounds_per_square_inch_t maxPressure) override
 Enables the compressor in digital mode. More...
 
void EnableCompressorHybrid (units::pounds_per_square_inch_t minPressure, units::pounds_per_square_inch_t maxPressure) override
 Enables the compressor in digital mode. More...
 
CompressorConfigType GetCompressorConfigType () const override
 Returns the active compressor configuration. More...
 
bool GetPressureSwitch () const override
 Returns the state of the pressure switch. More...
 
units::ampere_t GetCompressorCurrent () const override
 Returns the current drawn by the compressor. More...
 
bool GetCompressorCurrentTooHighFault () const
 Return whether the compressor current is currently too high. More...
 
bool GetCompressorCurrentTooHighStickyFault () const
 Returns whether the compressor current has been too high since sticky faults were last cleared. More...
 
bool GetCompressorShortedFault () const
 Returns whether the compressor is currently shorted. More...
 
bool GetCompressorShortedStickyFault () const
 Returns whether the compressor has been shorted since sticky faults were last cleared. More...
 
bool GetCompressorNotConnectedFault () const
 Returns whether the compressor is currently disconnected. More...
 
bool GetCompressorNotConnectedStickyFault () const
 Returns whether the compressor has been disconnected since sticky faults were last cleared. More...
 
bool GetSolenoidVoltageFault () const
 Returns whether the solenoid is currently reporting a voltage fault. More...
 
bool GetSolenoidVoltageStickyFault () const
 Returns whether the solenoid has reported a voltage fault since sticky faults were last cleared. More...
 
void ClearAllStickyFaults ()
 Clears all sticky faults on this device. More...
 
void SetSolenoids (int mask, int values) override
 Sets solenoids on a pneumatics module. More...
 
int GetSolenoids () const override
 Gets a bitmask of solenoid values. More...
 
int GetModuleNumber () const override
 Get module number for this module. More...
 
int GetSolenoidDisabledList () const override
 Get a bitmask of disabled solenoids. More...
 
void FireOneShot (int index) override
 Fire a single solenoid shot. More...
 
void SetOneShotDuration (int index, units::second_t duration) override
 Set the duration for a single solenoid shot. More...
 
bool CheckSolenoidChannel (int channel) const override
 Check if a solenoid channel is valid. More...
 
int CheckAndReserveSolenoids (int mask) override
 Check to see if the masked solenoids can be reserved, and if not reserve them. More...
 
void UnreserveSolenoids (int mask) override
 Unreserve the masked solenoids. More...
 
bool ReserveCompressor () override
 Reserve the compressor. More...
 
void UnreserveCompressor () override
 Unreserve the compressor. More...
 
units::volt_t GetAnalogVoltage (int channel) const override
 Unsupported by the CTRE PCM. More...
 
units::pounds_per_square_inch_t GetPressure (int channel) const override
 Unsupported by the CTRE PCM. More...
 
Solenoid MakeSolenoid (int channel) override
 Create a solenoid object for the specified channel. More...
 
DoubleSolenoid MakeDoubleSolenoid (int forwardChannel, int reverseChannel) override
 Create a double solenoid object for the specified channels. More...
 
Compressor MakeCompressor () override
 Create a compressor object. More...
 
- Public Member Functions inherited from frc::PneumaticsBase
virtual ~PneumaticsBase ()=default
 
virtual bool GetCompressor () const =0
 Returns whether the compressor is active or not. More...
 
virtual bool GetPressureSwitch () const =0
 Returns the state of the pressure switch. More...
 
virtual units::ampere_t GetCompressorCurrent () const =0
 Returns the current drawn by the compressor. More...
 
virtual void DisableCompressor ()=0
 Disables the compressor. More...
 
virtual void EnableCompressorDigital ()=0
 Enables the compressor in digital mode using the digital pressure switch. More...
 
virtual void EnableCompressorAnalog (units::pounds_per_square_inch_t minPressure, units::pounds_per_square_inch_t maxPressure)=0
 If supported by the device, enables the compressor in analog mode. More...
 
virtual void EnableCompressorHybrid (units::pounds_per_square_inch_t minPressure, units::pounds_per_square_inch_t maxPressure)=0
 If supported by the device, enables the compressor in hybrid mode. More...
 
virtual CompressorConfigType GetCompressorConfigType () const =0
 Returns the active compressor configuration. More...
 
virtual void SetSolenoids (int mask, int values)=0
 Sets solenoids on a pneumatics module. More...
 
virtual int GetSolenoids () const =0
 Gets a bitmask of solenoid values. More...
 
virtual int GetModuleNumber () const =0
 Get module number for this module. More...
 
virtual int GetSolenoidDisabledList () const =0
 Get a bitmask of disabled solenoids. More...
 
virtual void FireOneShot (int index)=0
 Fire a single solenoid shot. More...
 
virtual void SetOneShotDuration (int index, units::second_t duration)=0
 Set the duration for a single solenoid shot. More...
 
virtual bool CheckSolenoidChannel (int channel) const =0
 Check if a solenoid channel is valid. More...
 
virtual int CheckAndReserveSolenoids (int mask)=0
 Check to see if the masked solenoids can be reserved, and if not reserve them. More...
 
virtual void UnreserveSolenoids (int mask)=0
 Unreserve the masked solenoids. More...
 
virtual bool ReserveCompressor ()=0
 Reserve the compressor. More...
 
virtual void UnreserveCompressor ()=0
 Unreserve the compressor. More...
 
virtual units::volt_t GetAnalogVoltage (int channel) const =0
 If supported by the device, returns the raw voltage of the specified analog input channel. More...
 
virtual units::pounds_per_square_inch_t GetPressure (int channel) const =0
 If supported by the device, returns the pressure read by an analog pressure sensor on the specified analog input channel. More...
 
virtual Solenoid MakeSolenoid (int channel)=0
 Create a solenoid object for the specified channel. More...
 
virtual DoubleSolenoid MakeDoubleSolenoid (int forwardChannel, int reverseChannel)=0
 Create a double solenoid object for the specified channels. More...
 
virtual Compressor MakeCompressor ()=0
 Create a compressor object. More...
 

Friends

class DataStore
 
class PneumaticsBase
 

Additional Inherited Members

- Static Public Member Functions inherited from frc::PneumaticsBase
static std::shared_ptr< PneumaticsBaseGetForType (int module, PneumaticsModuleType moduleType)
 For internal use to get a module for a specific type. More...
 
static int GetDefaultForType (PneumaticsModuleType moduleType)
 For internal use to get the default for a specific type. More...
 

Detailed Description

Module class for controlling a Cross The Road Electronics Pneumatics Control Module.

Constructor & Destructor Documentation

◆ PneumaticsControlModule() [1/2]

frc::PneumaticsControlModule::PneumaticsControlModule ( )

Constructs a PneumaticsControlModule with the default ID (0).

◆ PneumaticsControlModule() [2/2]

frc::PneumaticsControlModule::PneumaticsControlModule ( int  module)
explicit

Constructs a PneumaticsControlModule.

Parameters
modulemodule number to construct

◆ ~PneumaticsControlModule()

frc::PneumaticsControlModule::~PneumaticsControlModule ( )
overridedefault

Member Function Documentation

◆ CheckAndReserveSolenoids()

int frc::PneumaticsControlModule::CheckAndReserveSolenoids ( int  mask)
overridevirtual

Check to see if the masked solenoids can be reserved, and if not reserve them.

Parameters
maskThe bitmask of solenoids to reserve
Returns
0 if successful; mask of solenoids that couldn't be allocated otherwise

Implements frc::PneumaticsBase.

◆ CheckSolenoidChannel()

bool frc::PneumaticsControlModule::CheckSolenoidChannel ( int  channel) const
overridevirtual

Check if a solenoid channel is valid.

Parameters
channelChannel to check
Returns
True if channel exists

Implements frc::PneumaticsBase.

◆ ClearAllStickyFaults()

void frc::PneumaticsControlModule::ClearAllStickyFaults ( )

Clears all sticky faults on this device.

◆ DisableCompressor()

void frc::PneumaticsControlModule::DisableCompressor ( )
overridevirtual

Disables the compressor.

The compressor will not turn on until EnableCompressorDigital() is called.

Implements frc::PneumaticsBase.

◆ EnableCompressorAnalog()

void frc::PneumaticsControlModule::EnableCompressorAnalog ( units::pounds_per_square_inch_t  minPressure,
units::pounds_per_square_inch_t  maxPressure 
)
overridevirtual

Enables the compressor in digital mode.

Analog mode is unsupported by the CTRE PCM.

Parameters
minPressureUnsupported.
maxPressureUnsupported.
See also
EnableCompressorDigital()

Implements frc::PneumaticsBase.

◆ EnableCompressorDigital()

void frc::PneumaticsControlModule::EnableCompressorDigital ( )
overridevirtual

Enables the compressor in digital mode using the digital pressure switch.

The compressor will turn on when the pressure switch indicates that the system is not full, and will turn off when the pressure switch indicates that the system is full.

Implements frc::PneumaticsBase.

◆ EnableCompressorHybrid()

void frc::PneumaticsControlModule::EnableCompressorHybrid ( units::pounds_per_square_inch_t  minPressure,
units::pounds_per_square_inch_t  maxPressure 
)
overridevirtual

Enables the compressor in digital mode.

Hybrid mode is unsupported by the CTRE PCM.

Parameters
minPressureUnsupported.
maxPressureUnsupported.
See also
EnableCompressorDigital()

Implements frc::PneumaticsBase.

◆ FireOneShot()

void frc::PneumaticsControlModule::FireOneShot ( int  index)
overridevirtual

Fire a single solenoid shot.

Parameters
indexsolenoid index

Implements frc::PneumaticsBase.

◆ GetAnalogVoltage()

units::volt_t frc::PneumaticsControlModule::GetAnalogVoltage ( int  channel) const
overridevirtual

Unsupported by the CTRE PCM.

Parameters
channelUnsupported.
Returns
0

Implements frc::PneumaticsBase.

◆ GetCompressor()

bool frc::PneumaticsControlModule::GetCompressor ( ) const
overridevirtual

Returns whether the compressor is active or not.

Returns
True if the compressor is on - otherwise false.

Implements frc::PneumaticsBase.

◆ GetCompressorConfigType()

CompressorConfigType frc::PneumaticsControlModule::GetCompressorConfigType ( ) const
overridevirtual

Returns the active compressor configuration.

Returns
The active compressor configuration.

Implements frc::PneumaticsBase.

◆ GetCompressorCurrent()

units::ampere_t frc::PneumaticsControlModule::GetCompressorCurrent ( ) const
overridevirtual

Returns the current drawn by the compressor.

Returns
The current drawn by the compressor.

Implements frc::PneumaticsBase.

◆ GetCompressorCurrentTooHighFault()

bool frc::PneumaticsControlModule::GetCompressorCurrentTooHighFault ( ) const

Return whether the compressor current is currently too high.

Returns
True if the compressor current is too high, otherwise false.
See also
GetCompressorCurrentTooHighStickyFault()

◆ GetCompressorCurrentTooHighStickyFault()

bool frc::PneumaticsControlModule::GetCompressorCurrentTooHighStickyFault ( ) const

Returns whether the compressor current has been too high since sticky faults were last cleared.

This fault is persistent and can be cleared by ClearAllStickyFaults()

Returns
True if the compressor current has been too high since sticky faults were last cleared.
See also
GetCompressorCurrentTooHighFault()

◆ GetCompressorNotConnectedFault()

bool frc::PneumaticsControlModule::GetCompressorNotConnectedFault ( ) const

Returns whether the compressor is currently disconnected.

Returns
True if compressor is currently disconnected, otherwise false.
See also
GetCompressorNotConnectedStickyFault()

◆ GetCompressorNotConnectedStickyFault()

bool frc::PneumaticsControlModule::GetCompressorNotConnectedStickyFault ( ) const

Returns whether the compressor has been disconnected since sticky faults were last cleared.

This fault is persistent and can be cleared by ClearAllStickyFaults()

Returns
True if the compressor has been disconnected since sticky faults were last cleared, otherwise false.
See also
GetCompressorNotConnectedFault()

◆ GetCompressorShortedFault()

bool frc::PneumaticsControlModule::GetCompressorShortedFault ( ) const

Returns whether the compressor is currently shorted.

Returns
True if the compressor is currently shorted, otherwise false.
See also
GetCompressorShortedStickyFault()

◆ GetCompressorShortedStickyFault()

bool frc::PneumaticsControlModule::GetCompressorShortedStickyFault ( ) const

Returns whether the compressor has been shorted since sticky faults were last cleared.

This fault is persistent and can be cleared by ClearAllStickyFaults()

Returns
True if the compressor has been shorted since sticky faults were last cleared, otherwise false.
See also
GetCompressorShortedFault()

◆ GetModuleNumber()

int frc::PneumaticsControlModule::GetModuleNumber ( ) const
overridevirtual

Get module number for this module.

Returns
module number

Implements frc::PneumaticsBase.

◆ GetPressure()

units::pounds_per_square_inch_t frc::PneumaticsControlModule::GetPressure ( int  channel) const
overridevirtual

Unsupported by the CTRE PCM.

Parameters
channelUnsupported.
Returns
0

Implements frc::PneumaticsBase.

◆ GetPressureSwitch()

bool frc::PneumaticsControlModule::GetPressureSwitch ( ) const
overridevirtual

Returns the state of the pressure switch.

Returns
True if pressure switch indicates that the system is full, otherwise false.

Implements frc::PneumaticsBase.

◆ GetSolenoidDisabledList()

int frc::PneumaticsControlModule::GetSolenoidDisabledList ( ) const
overridevirtual

Get a bitmask of disabled solenoids.

Returns
bitmask of disabled solenoids

Implements frc::PneumaticsBase.

◆ GetSolenoids()

int frc::PneumaticsControlModule::GetSolenoids ( ) const
overridevirtual

Gets a bitmask of solenoid values.

Returns
solenoid values

Implements frc::PneumaticsBase.

◆ GetSolenoidVoltageFault()

bool frc::PneumaticsControlModule::GetSolenoidVoltageFault ( ) const

Returns whether the solenoid is currently reporting a voltage fault.

Returns
True if solenoid is reporting a fault, otherwise false.
See also
GetSolenoidVoltageStickyFault()

◆ GetSolenoidVoltageStickyFault()

bool frc::PneumaticsControlModule::GetSolenoidVoltageStickyFault ( ) const

Returns whether the solenoid has reported a voltage fault since sticky faults were last cleared.

This fault is persistent and can be cleared by ClearAllStickyFaults()

Returns
True if solenoid is reporting a fault, otherwise false.
See also
GetSolenoidVoltageFault()

◆ MakeCompressor()

Compressor frc::PneumaticsControlModule::MakeCompressor ( )
overridevirtual

Create a compressor object.

Returns
Compressor object

Implements frc::PneumaticsBase.

◆ MakeDoubleSolenoid()

DoubleSolenoid frc::PneumaticsControlModule::MakeDoubleSolenoid ( int  forwardChannel,
int  reverseChannel 
)
overridevirtual

Create a double solenoid object for the specified channels.

Parameters
forwardChannelsolenoid channel for forward
reverseChannelsolenoid channel for reverse
Returns
DoubleSolenoid object

Implements frc::PneumaticsBase.

◆ MakeSolenoid()

Solenoid frc::PneumaticsControlModule::MakeSolenoid ( int  channel)
overridevirtual

Create a solenoid object for the specified channel.

Parameters
channelsolenoid channel
Returns
Solenoid object

Implements frc::PneumaticsBase.

◆ ReserveCompressor()

bool frc::PneumaticsControlModule::ReserveCompressor ( )
overridevirtual

Reserve the compressor.

Returns
true if successful; false if compressor already reserved

Implements frc::PneumaticsBase.

◆ SetOneShotDuration()

void frc::PneumaticsControlModule::SetOneShotDuration ( int  index,
units::second_t  duration 
)
overridevirtual

Set the duration for a single solenoid shot.

Parameters
indexsolenoid index
durationshot duration

Implements frc::PneumaticsBase.

◆ SetSolenoids()

void frc::PneumaticsControlModule::SetSolenoids ( int  mask,
int  values 
)
overridevirtual

Sets solenoids on a pneumatics module.

Parameters
maskbitmask to set
valuessolenoid values

Implements frc::PneumaticsBase.

◆ UnreserveCompressor()

void frc::PneumaticsControlModule::UnreserveCompressor ( )
overridevirtual

Unreserve the compressor.

Implements frc::PneumaticsBase.

◆ UnreserveSolenoids()

void frc::PneumaticsControlModule::UnreserveSolenoids ( int  mask)
overridevirtual

Unreserve the masked solenoids.

Parameters
maskThe bitmask of solenoids to unreserve

Implements frc::PneumaticsBase.

Friends And Related Function Documentation

◆ DataStore

friend class DataStore
friend

◆ PneumaticsBase

friend class PneumaticsBase
friend

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