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

#include <frc/simulation/SPIAccelerometerSim.h>

Public Member Functions

 SPIAccelerometerSim (int index)
 Construct a new simulation object. More...
 
std::unique_ptr< CallbackStoreRegisterActiveCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run when this accelerometer activates. More...
 
bool GetActive () const
 Check whether the accelerometer is active. More...
 
void SetActive (bool active)
 Define whether this accelerometer is active. More...
 
std::unique_ptr< CallbackStoreRegisterRangeCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run whenever the range changes. More...
 
int GetRange () const
 Check the range of this accelerometer. More...
 
void SetRange (int range)
 Change the range of this accelerometer. More...
 
std::unique_ptr< CallbackStoreRegisterXCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run whenever the X axis value changes. More...
 
double GetX () const
 Measure the X axis value. More...
 
void SetX (double x)
 Change the X axis value of the accelerometer. More...
 
std::unique_ptr< CallbackStoreRegisterYCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run whenever the Y axis value changes. More...
 
double GetY () const
 Measure the Y axis value. More...
 
void SetY (double y)
 Change the Y axis value of the accelerometer. More...
 
std::unique_ptr< CallbackStoreRegisterZCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run whenever the Z axis value changes. More...
 
double GetZ () const
 Measure the Z axis value. More...
 
void SetZ (double z)
 Change the Z axis value of the accelerometer. More...
 
void ResetData ()
 Reset all simulation data of this object. More...
 

Constructor & Destructor Documentation

◆ SPIAccelerometerSim()

frc::sim::SPIAccelerometerSim::SPIAccelerometerSim ( int  index)
explicit

Construct a new simulation object.

Parameters
indexthe HAL index of the accelerometer

Member Function Documentation

◆ GetActive()

bool frc::sim::SPIAccelerometerSim::GetActive ( ) const

Check whether the accelerometer is active.

Returns
true if active

◆ GetRange()

int frc::sim::SPIAccelerometerSim::GetRange ( ) const

Check the range of this accelerometer.

Returns
the accelerometer range

◆ GetX()

double frc::sim::SPIAccelerometerSim::GetX ( ) const

Measure the X axis value.

Returns
the X axis measurement

◆ GetY()

double frc::sim::SPIAccelerometerSim::GetY ( ) const

Measure the Y axis value.

Returns
the Y axis measurement

◆ GetZ()

double frc::sim::SPIAccelerometerSim::GetZ ( ) const

Measure the Z axis value.

Returns
the Z axis measurement

◆ RegisterActiveCallback()

std::unique_ptr< CallbackStore > frc::sim::SPIAccelerometerSim::RegisterActiveCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback to be run when this accelerometer activates.

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

◆ RegisterRangeCallback()

std::unique_ptr< CallbackStore > frc::sim::SPIAccelerometerSim::RegisterRangeCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback to be run whenever the range changes.

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

◆ RegisterXCallback()

std::unique_ptr< CallbackStore > frc::sim::SPIAccelerometerSim::RegisterXCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback to be run whenever the X axis value changes.

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

◆ RegisterYCallback()

std::unique_ptr< CallbackStore > frc::sim::SPIAccelerometerSim::RegisterYCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback to be run whenever the Y axis value changes.

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

◆ RegisterZCallback()

std::unique_ptr< CallbackStore > frc::sim::SPIAccelerometerSim::RegisterZCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback to be run whenever the Z axis value changes.

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

◆ ResetData()

void frc::sim::SPIAccelerometerSim::ResetData ( )

Reset all simulation data of this object.

◆ SetActive()

void frc::sim::SPIAccelerometerSim::SetActive ( bool  active)

Define whether this accelerometer is active.

Parameters
activethe new state

◆ SetRange()

void frc::sim::SPIAccelerometerSim::SetRange ( int  range)

Change the range of this accelerometer.

Parameters
rangethe new accelerometer range

◆ SetX()

void frc::sim::SPIAccelerometerSim::SetX ( double  x)

Change the X axis value of the accelerometer.

Parameters
xthe new reading of the X axis

◆ SetY()

void frc::sim::SPIAccelerometerSim::SetY ( double  y)

Change the Y axis value of the accelerometer.

Parameters
ythe new reading of the Y axis

◆ SetZ()

void frc::sim::SPIAccelerometerSim::SetZ ( double  z)

Change the Z axis value of the accelerometer.

Parameters
zthe new reading of the Z axis

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