WPILibC++ 2023.4.3
frc::sim::AnalogInputSim Class Reference

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

#include <frc/simulation/AnalogInputSim.h>

Public Member Functions

 AnalogInputSim (const AnalogInput &analogInput)
 Constructs from an AnalogInput object. More...
 
 AnalogInputSim (int channel)
 Constructs from an analog input channel number. More...
 
std::unique_ptr< CallbackStoreRegisterInitializedCallback (NotifyCallback callback, bool initialNotify)
 Register a callback on whether the analog input is initialized. More...
 
bool GetInitialized () const
 Check if this analog input has been initialized. More...
 
void SetInitialized (bool initialized)
 Change whether this analog input has been initialized. More...
 
std::unique_ptr< CallbackStoreRegisterAverageBitsCallback (NotifyCallback callback, bool initialNotify)
 Register a callback on the number of average bits. More...
 
int GetAverageBits () const
 Get the number of average bits. More...
 
void SetAverageBits (int averageBits)
 Change the number of average bits. More...
 
std::unique_ptr< CallbackStoreRegisterOversampleBitsCallback (NotifyCallback callback, bool initialNotify)
 Register a callback on the amount of oversampling bits. More...
 
int GetOversampleBits () const
 Get the amount of oversampling bits. More...
 
void SetOversampleBits (int oversampleBits)
 Change the amount of oversampling bits. More...
 
std::unique_ptr< CallbackStoreRegisterVoltageCallback (NotifyCallback callback, bool initialNotify)
 Register a callback on the voltage. More...
 
double GetVoltage () const
 Get the voltage. More...
 
void SetVoltage (double voltage)
 Change the voltage. More...
 
std::unique_ptr< CallbackStoreRegisterAccumulatorInitializedCallback (NotifyCallback callback, bool initialNotify)
 Register a callback on whether the accumulator is initialized. More...
 
bool GetAccumulatorInitialized () const
 Check if the accumulator has been initialized. More...
 
void SetAccumulatorInitialized (bool accumulatorInitialized)
 Change whether the accumulator has been initialized. More...
 
std::unique_ptr< CallbackStoreRegisterAccumulatorValueCallback (NotifyCallback callback, bool initialNotify)
 Register a callback on the accumulator value. More...
 
int64_t GetAccumulatorValue () const
 Get the accumulator value. More...
 
void SetAccumulatorValue (int64_t accumulatorValue)
 Change the accumulator value. More...
 
std::unique_ptr< CallbackStoreRegisterAccumulatorCountCallback (NotifyCallback callback, bool initialNotify)
 Register a callback on the accumulator count. More...
 
int64_t GetAccumulatorCount () const
 Get the accumulator count. More...
 
void SetAccumulatorCount (int64_t accumulatorCount)
 Change the accumulator count. More...
 
std::unique_ptr< CallbackStoreRegisterAccumulatorCenterCallback (NotifyCallback callback, bool initialNotify)
 Register a callback on the accumulator center. More...
 
int GetAccumulatorCenter () const
 Get the accumulator center. More...
 
void SetAccumulatorCenter (int accumulatorCenter)
 Change the accumulator center. More...
 
std::unique_ptr< CallbackStoreRegisterAccumulatorDeadbandCallback (NotifyCallback callback, bool initialNotify)
 Register a callback on the accumulator deadband. More...
 
int GetAccumulatorDeadband () const
 Get the accumulator deadband. More...
 
void SetAccumulatorDeadband (int accumulatorDeadband)
 Change the accumulator deadband. More...
 
void ResetData ()
 Reset all simulation data for this object. More...
 

Detailed Description

Class to control a simulated analog input.

Constructor & Destructor Documentation

◆ AnalogInputSim() [1/2]

frc::sim::AnalogInputSim::AnalogInputSim ( const AnalogInput analogInput)
explicit

Constructs from an AnalogInput object.

Parameters
analogInputAnalogInput to simulate

◆ AnalogInputSim() [2/2]

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

Constructs from an analog input channel number.

Parameters
channelChannel number

Member Function Documentation

◆ GetAccumulatorCenter()

int frc::sim::AnalogInputSim::GetAccumulatorCenter ( ) const

Get the accumulator center.

Returns
the accumulator center

◆ GetAccumulatorCount()

int64_t frc::sim::AnalogInputSim::GetAccumulatorCount ( ) const

Get the accumulator count.

Returns
the accumulator count.

◆ GetAccumulatorDeadband()

int frc::sim::AnalogInputSim::GetAccumulatorDeadband ( ) const

Get the accumulator deadband.

Returns
the accumulator deadband

◆ GetAccumulatorInitialized()

bool frc::sim::AnalogInputSim::GetAccumulatorInitialized ( ) const

Check if the accumulator has been initialized.

Returns
true if initialized

◆ GetAccumulatorValue()

int64_t frc::sim::AnalogInputSim::GetAccumulatorValue ( ) const

Get the accumulator value.

Returns
the accumulator value

◆ GetAverageBits()

int frc::sim::AnalogInputSim::GetAverageBits ( ) const

Get the number of average bits.

Returns
the number of average bits

◆ GetInitialized()

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

Check if this analog input has been initialized.

Returns
true if initialized

◆ GetOversampleBits()

int frc::sim::AnalogInputSim::GetOversampleBits ( ) const

Get the amount of oversampling bits.

Returns
the amount of oversampling bits

◆ GetVoltage()

double frc::sim::AnalogInputSim::GetVoltage ( ) const

Get the voltage.

Returns
the voltage

◆ RegisterAccumulatorCenterCallback()

std::unique_ptr< CallbackStore > frc::sim::AnalogInputSim::RegisterAccumulatorCenterCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback on the accumulator center.

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

◆ RegisterAccumulatorCountCallback()

std::unique_ptr< CallbackStore > frc::sim::AnalogInputSim::RegisterAccumulatorCountCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback on the accumulator count.

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

◆ RegisterAccumulatorDeadbandCallback()

std::unique_ptr< CallbackStore > frc::sim::AnalogInputSim::RegisterAccumulatorDeadbandCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback on the accumulator deadband.

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

◆ RegisterAccumulatorInitializedCallback()

std::unique_ptr< CallbackStore > frc::sim::AnalogInputSim::RegisterAccumulatorInitializedCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback on whether the accumulator is initialized.

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

◆ RegisterAccumulatorValueCallback()

std::unique_ptr< CallbackStore > frc::sim::AnalogInputSim::RegisterAccumulatorValueCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback on the accumulator value.

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

◆ RegisterAverageBitsCallback()

std::unique_ptr< CallbackStore > frc::sim::AnalogInputSim::RegisterAverageBitsCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback on the number of average bits.

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

◆ RegisterInitializedCallback()

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

Register a callback on whether the analog input is initialized.

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

◆ RegisterOversampleBitsCallback()

std::unique_ptr< CallbackStore > frc::sim::AnalogInputSim::RegisterOversampleBitsCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback on the amount of oversampling bits.

Parameters
callbackthe callback that will be called whenever the oversampling bits are changed
initialNotifyif true, the callback will be run on the initial value
Returns
the CallbackStore object associated with this callback

◆ RegisterVoltageCallback()

std::unique_ptr< CallbackStore > frc::sim::AnalogInputSim::RegisterVoltageCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback on the voltage.

Parameters
callbackthe callback that will be called whenever the voltage 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::AnalogInputSim::ResetData ( )

Reset all simulation data for this object.

◆ SetAccumulatorCenter()

void frc::sim::AnalogInputSim::SetAccumulatorCenter ( int  accumulatorCenter)

Change the accumulator center.

Parameters
accumulatorCenterthe new center

◆ SetAccumulatorCount()

void frc::sim::AnalogInputSim::SetAccumulatorCount ( int64_t  accumulatorCount)

Change the accumulator count.

Parameters
accumulatorCountthe new count.

◆ SetAccumulatorDeadband()

void frc::sim::AnalogInputSim::SetAccumulatorDeadband ( int  accumulatorDeadband)

Change the accumulator deadband.

Parameters
accumulatorDeadbandthe new deadband

◆ SetAccumulatorInitialized()

void frc::sim::AnalogInputSim::SetAccumulatorInitialized ( bool  accumulatorInitialized)

Change whether the accumulator has been initialized.

Parameters
accumulatorInitializedthe new value

◆ SetAccumulatorValue()

void frc::sim::AnalogInputSim::SetAccumulatorValue ( int64_t  accumulatorValue)

Change the accumulator value.

Parameters
accumulatorValuethe new value

◆ SetAverageBits()

void frc::sim::AnalogInputSim::SetAverageBits ( int  averageBits)

Change the number of average bits.

Parameters
averageBitsthe new value

◆ SetInitialized()

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

Change whether this analog input has been initialized.

Parameters
initializedthe new value

◆ SetOversampleBits()

void frc::sim::AnalogInputSim::SetOversampleBits ( int  oversampleBits)

Change the amount of oversampling bits.

Parameters
oversampleBitsthe new value

◆ SetVoltage()

void frc::sim::AnalogInputSim::SetVoltage ( double  voltage)

Change the voltage.

Parameters
voltagethe new value

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