WPILibC++ 2023.4.3-108-ge5452e3
frc::sim::AnalogTriggerSim Class Reference

Class to control a simulated analog trigger. More...

#include <frc/simulation/AnalogTriggerSim.h>

Public Member Functions

 AnalogTriggerSim (const AnalogTrigger &analogTrigger)
 Constructs from an AnalogTrigger object. More...
 
std::unique_ptr< CallbackStoreRegisterInitializedCallback (NotifyCallback callback, bool initialNotify)
 Register a callback on whether the analog trigger is initialized. More...
 
bool GetInitialized () const
 Check if this analog trigger has been initialized. More...
 
void SetInitialized (bool initialized)
 Change whether this analog trigger has been initialized. More...
 
std::unique_ptr< CallbackStoreRegisterTriggerLowerBoundCallback (NotifyCallback callback, bool initialNotify)
 Register a callback on the lower bound. More...
 
double GetTriggerLowerBound () const
 Get the lower bound. More...
 
void SetTriggerLowerBound (double triggerLowerBound)
 Change the lower bound. More...
 
std::unique_ptr< CallbackStoreRegisterTriggerUpperBoundCallback (NotifyCallback callback, bool initialNotify)
 Register a callback on the upper bound. More...
 
double GetTriggerUpperBound () const
 Get the upper bound. More...
 
void SetTriggerUpperBound (double triggerUpperBound)
 Change the upper bound. More...
 
void ResetData ()
 Reset all simulation data for this object. More...
 

Static Public Member Functions

static AnalogTriggerSim CreateForChannel (int channel)
 Creates an AnalogTriggerSim for an analog input channel. More...
 
static AnalogTriggerSim CreateForIndex (int index)
 Creates an AnalogTriggerSim for a simulated index. More...
 

Detailed Description

Class to control a simulated analog trigger.

Constructor & Destructor Documentation

◆ AnalogTriggerSim()

frc::sim::AnalogTriggerSim::AnalogTriggerSim ( const AnalogTrigger analogTrigger)
explicit

Constructs from an AnalogTrigger object.

Parameters
analogTriggerAnalogTrigger to simulate

Member Function Documentation

◆ CreateForChannel()

static AnalogTriggerSim frc::sim::AnalogTriggerSim::CreateForChannel ( int  channel)
static

Creates an AnalogTriggerSim for an analog input channel.

Parameters
channelanalog input channel
Returns
Simulated object
Exceptions
std::out_of_rangeif no AnalogTrigger is configured for that channel

◆ CreateForIndex()

static AnalogTriggerSim frc::sim::AnalogTriggerSim::CreateForIndex ( int  index)
static

Creates an AnalogTriggerSim for a simulated index.

The index is incremented for each simulated AnalogTrigger.

Parameters
indexsimulator index
Returns
Simulated object

◆ GetInitialized()

bool frc::sim::AnalogTriggerSim::GetInitialized ( ) const

Check if this analog trigger has been initialized.

Returns
true if initialized

◆ GetTriggerLowerBound()

double frc::sim::AnalogTriggerSim::GetTriggerLowerBound ( ) const

Get the lower bound.

Returns
the lower bound

◆ GetTriggerUpperBound()

double frc::sim::AnalogTriggerSim::GetTriggerUpperBound ( ) const

Get the upper bound.

Returns
the upper bound

◆ RegisterInitializedCallback()

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

Register a callback on whether the analog trigger is initialized.

Parameters
callbackthe callback that will be called whenever the analog trigger is initialized
initialNotifyif true, the callback will be run on the initial value
Returns
the CallbackStore object associated with this callback

◆ RegisterTriggerLowerBoundCallback()

std::unique_ptr< CallbackStore > frc::sim::AnalogTriggerSim::RegisterTriggerLowerBoundCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback on the lower bound.

Parameters
callbackthe callback that will be called whenever the lower bound is changed
initialNotifyif true, the callback will be run on the initial value
Returns
the CallbackStore object associated with this callback

◆ RegisterTriggerUpperBoundCallback()

std::unique_ptr< CallbackStore > frc::sim::AnalogTriggerSim::RegisterTriggerUpperBoundCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback on the upper bound.

Parameters
callbackthe callback that will be called whenever the upper bound is changed
initialNotifyif true, the callback will be run on the initial value
Returns
the CallbackStore object associated with this callback

◆ ResetData()

void frc::sim::AnalogTriggerSim::ResetData ( )

Reset all simulation data for this object.

◆ SetInitialized()

void frc::sim::AnalogTriggerSim::SetInitialized ( bool  initialized)

Change whether this analog trigger has been initialized.

Parameters
initializedthe new value

◆ SetTriggerLowerBound()

void frc::sim::AnalogTriggerSim::SetTriggerLowerBound ( double  triggerLowerBound)

Change the lower bound.

Parameters
triggerLowerBoundthe new lower bound

◆ SetTriggerUpperBound()

void frc::sim::AnalogTriggerSim::SetTriggerUpperBound ( double  triggerUpperBound)

Change the upper bound.

Parameters
triggerUpperBoundthe new upper bound

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