WPILibC++ 2024.1.1-beta-4
frc::DoubleSolenoid Class Reference

DoubleSolenoid class for running 2 channels of high voltage Digital Output on a pneumatics module. More...

#include <frc/DoubleSolenoid.h>

Inheritance diagram for frc::DoubleSolenoid:
wpi::Sendable wpi::SendableHelper< DoubleSolenoid >

Public Types

enum  Value { kOff , kForward , kReverse }
 

Public Member Functions

 DoubleSolenoid (int module, PneumaticsModuleType moduleType, int forwardChannel, int reverseChannel)
 Constructs a double solenoid for a specified module of a specific module type. More...
 
 DoubleSolenoid (PneumaticsModuleType moduleType, int forwardChannel, int reverseChannel)
 Constructs a double solenoid for a default module of a specific module type. More...
 
 ~DoubleSolenoid () override
 
 DoubleSolenoid (DoubleSolenoid &&)=default
 
DoubleSolenoidoperator= (DoubleSolenoid &&)=default
 
virtual void Set (Value value)
 Set the value of a solenoid. More...
 
virtual Value Get () const
 Read the current value of the solenoid. More...
 
void Toggle ()
 Toggle the value of the solenoid. More...
 
int GetFwdChannel () const
 Get the forward channel. More...
 
int GetRevChannel () const
 Get the reverse channel. More...
 
bool IsFwdSolenoidDisabled () const
 Check if the forward solenoid is Disabled. More...
 
bool IsRevSolenoidDisabled () const
 Check if the reverse solenoid is Disabled. More...
 
void InitSendable (wpi::SendableBuilder &builder) override
 Initializes this Sendable object. More...
 
- Public Member Functions inherited from wpi::Sendable
virtual ~Sendable ()=default
 
virtual void InitSendable (SendableBuilder &builder)=0
 Initializes this Sendable object. More...
 
- Public Member Functions inherited from wpi::SendableHelper< DoubleSolenoid >
 SendableHelper (const SendableHelper &rhs)=default
 
 SendableHelper (SendableHelper &&rhs)
 
SendableHelperoperator= (const SendableHelper &rhs)=default
 
SendableHelperoperator= (SendableHelper &&rhs)
 

Additional Inherited Members

- Protected Member Functions inherited from wpi::SendableHelper< DoubleSolenoid >
 SendableHelper ()=default
 
 ~SendableHelper ()
 

Detailed Description

DoubleSolenoid class for running 2 channels of high voltage Digital Output on a pneumatics module.

The DoubleSolenoid class is typically used for pneumatics solenoids that have two positions controlled by two separate channels.

Member Enumeration Documentation

◆ Value

Enumerator
kOff 
kForward 
kReverse 

Constructor & Destructor Documentation

◆ DoubleSolenoid() [1/3]

frc::DoubleSolenoid::DoubleSolenoid ( int  module,
PneumaticsModuleType  moduleType,
int  forwardChannel,
int  reverseChannel 
)

Constructs a double solenoid for a specified module of a specific module type.

Parameters
moduleThe module of the solenoid module to use.
moduleTypeThe module type to use.
forwardChannelThe forward channel on the module to control.
reverseChannelThe reverse channel on the module to control.

◆ DoubleSolenoid() [2/3]

frc::DoubleSolenoid::DoubleSolenoid ( PneumaticsModuleType  moduleType,
int  forwardChannel,
int  reverseChannel 
)

Constructs a double solenoid for a default module of a specific module type.

Parameters
moduleTypeThe module type to use.
forwardChannelThe forward channel on the module to control.
reverseChannelThe reverse channel on the module to control.

◆ ~DoubleSolenoid()

frc::DoubleSolenoid::~DoubleSolenoid ( )
override

◆ DoubleSolenoid() [3/3]

frc::DoubleSolenoid::DoubleSolenoid ( DoubleSolenoid &&  )
default

Member Function Documentation

◆ Get()

virtual Value frc::DoubleSolenoid::Get ( ) const
virtual

Read the current value of the solenoid.

Returns
The current value of the solenoid.

◆ GetFwdChannel()

int frc::DoubleSolenoid::GetFwdChannel ( ) const

Get the forward channel.

Returns
the forward channel.

◆ GetRevChannel()

int frc::DoubleSolenoid::GetRevChannel ( ) const

Get the reverse channel.

Returns
the reverse channel.

◆ InitSendable()

void frc::DoubleSolenoid::InitSendable ( wpi::SendableBuilder builder)
overridevirtual

Initializes this Sendable object.

Parameters
buildersendable builder

Implements wpi::Sendable.

◆ IsFwdSolenoidDisabled()

bool frc::DoubleSolenoid::IsFwdSolenoidDisabled ( ) const

Check if the forward solenoid is Disabled.

If a solenoid is shorted, it is added to the DisabledList and disabled until power cycle, or until faults are cleared.

See also
ClearAllStickyFaults()
Returns
If solenoid is disabled due to short.

◆ IsRevSolenoidDisabled()

bool frc::DoubleSolenoid::IsRevSolenoidDisabled ( ) const

Check if the reverse solenoid is Disabled.

If a solenoid is shorted, it is added to the DisabledList and disabled until power cycle, or until faults are cleared.

See also
ClearAllStickyFaults()
Returns
If solenoid is disabled due to short.

◆ operator=()

DoubleSolenoid & frc::DoubleSolenoid::operator= ( DoubleSolenoid &&  )
default

◆ Set()

virtual void frc::DoubleSolenoid::Set ( Value  value)
virtual

Set the value of a solenoid.

Parameters
valueThe value to set (Off, Forward or Reverse)

◆ Toggle()

void frc::DoubleSolenoid::Toggle ( )

Toggle the value of the solenoid.

If the solenoid is set to forward, it'll be set to reverse. If the solenoid is set to reverse, it'll be set to forward. If the solenoid is set to off, nothing happens.


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