WPILibC++ 2024.3.2
|
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< CallbackStore > | RegisterInitializedCallback (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< CallbackStore > | RegisterAverageBitsCallback (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< CallbackStore > | RegisterOversampleBitsCallback (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< CallbackStore > | RegisterVoltageCallback (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< CallbackStore > | RegisterAccumulatorInitializedCallback (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< CallbackStore > | RegisterAccumulatorValueCallback (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< CallbackStore > | RegisterAccumulatorCountCallback (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< CallbackStore > | RegisterAccumulatorCenterCallback (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< CallbackStore > | RegisterAccumulatorDeadbandCallback (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... | |
Class to control a simulated analog input.
|
explicit |
Constructs from an AnalogInput object.
analogInput | AnalogInput to simulate |
|
explicit |
Constructs from an analog input channel number.
channel | Channel number |
int frc::sim::AnalogInputSim::GetAccumulatorCenter | ( | ) | const |
Get the accumulator center.
int64_t frc::sim::AnalogInputSim::GetAccumulatorCount | ( | ) | const |
Get the accumulator count.
int frc::sim::AnalogInputSim::GetAccumulatorDeadband | ( | ) | const |
Get the accumulator deadband.
bool frc::sim::AnalogInputSim::GetAccumulatorInitialized | ( | ) | const |
Check if the accumulator has been initialized.
int64_t frc::sim::AnalogInputSim::GetAccumulatorValue | ( | ) | const |
Get the accumulator value.
int frc::sim::AnalogInputSim::GetAverageBits | ( | ) | const |
Get the number of average bits.
bool frc::sim::AnalogInputSim::GetInitialized | ( | ) | const |
Check if this analog input has been initialized.
int frc::sim::AnalogInputSim::GetOversampleBits | ( | ) | const |
Get the amount of oversampling bits.
double frc::sim::AnalogInputSim::GetVoltage | ( | ) | const |
Get the voltage.
std::unique_ptr< CallbackStore > frc::sim::AnalogInputSim::RegisterAccumulatorCenterCallback | ( | NotifyCallback | callback, |
bool | initialNotify | ||
) |
Register a callback on the accumulator center.
callback | the callback that will be called whenever the accumulator center is changed |
initialNotify | if true, the callback will be run on the initial value |
std::unique_ptr< CallbackStore > frc::sim::AnalogInputSim::RegisterAccumulatorCountCallback | ( | NotifyCallback | callback, |
bool | initialNotify | ||
) |
Register a callback on the accumulator count.
callback | the callback that will be called whenever the accumulator count is changed |
initialNotify | if true, the callback will be run on the initial value |
std::unique_ptr< CallbackStore > frc::sim::AnalogInputSim::RegisterAccumulatorDeadbandCallback | ( | NotifyCallback | callback, |
bool | initialNotify | ||
) |
Register a callback on the accumulator deadband.
callback | the callback that will be called whenever the accumulator deadband is changed |
initialNotify | if true, the callback will be run on the initial value |
std::unique_ptr< CallbackStore > frc::sim::AnalogInputSim::RegisterAccumulatorInitializedCallback | ( | NotifyCallback | callback, |
bool | initialNotify | ||
) |
Register a callback on whether the accumulator is initialized.
callback | the callback that will be called whenever the accumulator is initialized |
initialNotify | if true, the callback will be run on the initial value |
std::unique_ptr< CallbackStore > frc::sim::AnalogInputSim::RegisterAccumulatorValueCallback | ( | NotifyCallback | callback, |
bool | initialNotify | ||
) |
Register a callback on the accumulator value.
callback | the callback that will be called whenever the accumulator value is changed |
initialNotify | if true, the callback will be run on the initial value |
std::unique_ptr< CallbackStore > frc::sim::AnalogInputSim::RegisterAverageBitsCallback | ( | NotifyCallback | callback, |
bool | initialNotify | ||
) |
Register a callback on the number of average bits.
callback | the callback that will be called whenever the number of average bits is changed |
initialNotify | if true, the callback will be run on the initial value |
std::unique_ptr< CallbackStore > frc::sim::AnalogInputSim::RegisterInitializedCallback | ( | NotifyCallback | callback, |
bool | initialNotify | ||
) |
Register a callback on whether the analog input is initialized.
callback | the callback that will be called whenever the analog input is initialized |
initialNotify | if true, the callback will be run on the initial value |
std::unique_ptr< CallbackStore > frc::sim::AnalogInputSim::RegisterOversampleBitsCallback | ( | NotifyCallback | callback, |
bool | initialNotify | ||
) |
Register a callback on the amount of oversampling bits.
callback | the callback that will be called whenever the oversampling bits are changed |
initialNotify | if true, the callback will be run on the initial value |
std::unique_ptr< CallbackStore > frc::sim::AnalogInputSim::RegisterVoltageCallback | ( | NotifyCallback | callback, |
bool | initialNotify | ||
) |
Register a callback on the voltage.
callback | the callback that will be called whenever the voltage is changed |
initialNotify | if true, the callback will be run on the initial value |
void frc::sim::AnalogInputSim::ResetData | ( | ) |
Reset all simulation data for this object.
void frc::sim::AnalogInputSim::SetAccumulatorCenter | ( | int | accumulatorCenter | ) |
Change the accumulator center.
accumulatorCenter | the new center |
void frc::sim::AnalogInputSim::SetAccumulatorCount | ( | int64_t | accumulatorCount | ) |
Change the accumulator count.
accumulatorCount | the new count. |
void frc::sim::AnalogInputSim::SetAccumulatorDeadband | ( | int | accumulatorDeadband | ) |
Change the accumulator deadband.
accumulatorDeadband | the new deadband |
void frc::sim::AnalogInputSim::SetAccumulatorInitialized | ( | bool | accumulatorInitialized | ) |
Change whether the accumulator has been initialized.
accumulatorInitialized | the new value |
void frc::sim::AnalogInputSim::SetAccumulatorValue | ( | int64_t | accumulatorValue | ) |
Change the accumulator value.
accumulatorValue | the new value |
void frc::sim::AnalogInputSim::SetAverageBits | ( | int | averageBits | ) |
Change the number of average bits.
averageBits | the new value |
void frc::sim::AnalogInputSim::SetInitialized | ( | bool | initialized | ) |
Change whether this analog input has been initialized.
initialized | the new value |
void frc::sim::AnalogInputSim::SetOversampleBits | ( | int | oversampleBits | ) |
Change the amount of oversampling bits.
oversampleBits | the new value |
void frc::sim::AnalogInputSim::SetVoltage | ( | double | voltage | ) |
Change the voltage.
voltage | the new value |