WPILibC++ 2024.3.2
frc::sim::RelaySim Class Reference

Class to control a simulated relay. More...

#include <frc/simulation/RelaySim.h>

Public Member Functions

 RelaySim (const Relay &relay)
 Constructs from a Relay object. More...
 
 RelaySim (int channel)
 Constructs from a relay channel number. More...
 
std::unique_ptr< CallbackStoreRegisterInitializedForwardCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run when the forward direction is initialized. More...
 
bool GetInitializedForward () const
 Check whether the forward direction has been initialized. More...
 
void SetInitializedForward (bool initializedForward)
 Define whether the forward direction has been initialized. More...
 
std::unique_ptr< CallbackStoreRegisterInitializedReverseCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run when the reverse direction is initialized. More...
 
bool GetInitializedReverse () const
 Check whether the reverse direction has been initialized. More...
 
void SetInitializedReverse (bool initializedReverse)
 Define whether the reverse direction has been initialized. More...
 
std::unique_ptr< CallbackStoreRegisterForwardCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run when the forward direction changes state. More...
 
bool GetForward () const
 Check whether the forward direction is active. More...
 
void SetForward (bool forward)
 Set whether the forward direction is active. More...
 
std::unique_ptr< CallbackStoreRegisterReverseCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run when the reverse direction changes state. More...
 
bool GetReverse () const
 Check whether the reverse direction is active. More...
 
void SetReverse (bool reverse)
 Set whether the reverse direction is active. More...
 
void ResetData ()
 Reset all simulation data. More...
 

Detailed Description

Class to control a simulated relay.

Constructor & Destructor Documentation

◆ RelaySim() [1/2]

frc::sim::RelaySim::RelaySim ( const Relay relay)
explicit

Constructs from a Relay object.

Parameters
relayRelay to simulate

◆ RelaySim() [2/2]

frc::sim::RelaySim::RelaySim ( int  channel)
explicit

Constructs from a relay channel number.

Parameters
channelChannel number

Member Function Documentation

◆ GetForward()

bool frc::sim::RelaySim::GetForward ( ) const

Check whether the forward direction is active.

Returns
true if active

◆ GetInitializedForward()

bool frc::sim::RelaySim::GetInitializedForward ( ) const

Check whether the forward direction has been initialized.

Returns
true if initialized

◆ GetInitializedReverse()

bool frc::sim::RelaySim::GetInitializedReverse ( ) const

Check whether the reverse direction has been initialized.

Returns
true if initialized

◆ GetReverse()

bool frc::sim::RelaySim::GetReverse ( ) const

Check whether the reverse direction is active.

Returns
true if active

◆ RegisterForwardCallback()

std::unique_ptr< CallbackStore > frc::sim::RelaySim::RegisterForwardCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback to be run when the forward direction changes state.

Parameters
callbackthe callback
initialNotifywhether to run the callback with the initial state
Returns
the CallbackStore object associated with this callback

◆ RegisterInitializedForwardCallback()

std::unique_ptr< CallbackStore > frc::sim::RelaySim::RegisterInitializedForwardCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback to be run when the forward direction is initialized.

Parameters
callbackthe callback
initialNotifywhether to run the callback with the initial state
Returns
the CallbackStore object associated with this callback

◆ RegisterInitializedReverseCallback()

std::unique_ptr< CallbackStore > frc::sim::RelaySim::RegisterInitializedReverseCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback to be run when the reverse direction is initialized.

Parameters
callbackthe callback
initialNotifywhether to run the callback with the initial state
Returns
the CallbackStore object associated with this callback

◆ RegisterReverseCallback()

std::unique_ptr< CallbackStore > frc::sim::RelaySim::RegisterReverseCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback to be run when the reverse direction changes state.

Parameters
callbackthe callback
initialNotifywhether to run the callback with the initial state
Returns
the CallbackStore object associated with this callback

◆ ResetData()

void frc::sim::RelaySim::ResetData ( )

Reset all simulation data.

◆ SetForward()

void frc::sim::RelaySim::SetForward ( bool  forward)

Set whether the forward direction is active.

Parameters
forwardtrue to make active

◆ SetInitializedForward()

void frc::sim::RelaySim::SetInitializedForward ( bool  initializedForward)

Define whether the forward direction has been initialized.

Parameters
initializedForwardwhether this object is initialized

◆ SetInitializedReverse()

void frc::sim::RelaySim::SetInitializedReverse ( bool  initializedReverse)

Define whether the reverse direction has been initialized.

Parameters
initializedReversewhether this object is initialized

◆ SetReverse()

void frc::sim::RelaySim::SetReverse ( bool  reverse)

Set whether the reverse direction is active.

Parameters
reversetrue to make active

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